-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add al_set_audio_output_device for audio output device selection #1542
base: master
Are you sure you want to change the base?
add al_set_audio_output_device for audio output device selection #1542
Conversation
Thanks! It looks like for AQueue all the voices remain valid, but what about DirectSound? I see you re-create it for the default voice, but what about the others? Maybe we should maintain a vector of voices to update them. I'll take a look at what the other backends can handle (although I'm sure re-creating the voices works no matter what). |
It would also be possible to let the user specify the voice to update e.g al_set_audio_output_device_for_voice(device, voice). |
That would certainly be ideal, if it's possible, but we'd need to investigate that it's an option for all backends. |
Just glancing at the code dsound, aqueue and SDL2 backend will only require minor changes. for PulseAudio & ALSA the buffer fill routine seems to not lock mutex while writing so might have to do something like openal, opensl, oss do not have device iteration yet so not looking at it for now. recreating the voice is probably the easiest way to go, but at that point you might as well just let the user call a function like user code would then look something like:
I'm fine with both methods |
Currently only implemented on dsound and aqueue backend. I also extended ex_audio_simple for easy testing.