SFML community forums
Help => Audio => Topic started by: danw on September 19, 2016, 11:52:35 pm
-
I have my own audio code using WASAPI for low latency audio, which is a necessity for my program.
Before I get too far into converting my project to SFML, I want to be sure that this isn't going to be a conflict.
I don't see any requirement to "enable" audio support, so it seems like audio is always enabled in SFML?
Also, can I point SFML at my own audio rendering function? I want users to choose whether to use the WASAPI exclusive audio mode, or shared audio, in case the exclusive audio does not work for them for some reason. All of my audio is generated real-time by a renderer function. For shared audio mode, I would like SFML to call my audio renderer function, rather than dealing with sf::Sound or sf::Music objects.
-
Oh, I think this answers my question about using my own renderer: http://www.sfml-dev.org/tutorials/2.4/audio-streams.php
But I'm still not sure if I can disable and re-enable SFML's audio.
-
I managed to make a test and WASAPI audio does seem to work with SFML. I don't think I need to disable anything. Cheers.
-
If you're not using the Audio module, there shouldn't be any interference and even if you use it, you should still be able to use other libraries in parallel as long as you won't need exclusive access.
-
Here is some info that might hopefully help somebody in the future.
I found that I couldn't use anything in the sfml-audio.dll at all, I suppose because SFML's audio thread must have been interfering with my own WASAPI audio thread, which of course needs to run very fast at very high priority. What was happening is that my audio was glitching semi-frequently.
I fixed this by removing sfml-audio.dll and anything that was using it.
So, that means I couldn't use sf::SoundBuffer for the purpose of loading audio files, but that functionality is easy to find elsewhere.