Posts: 265
Joined: Dec 2007
Reputation:
4
s7mx1
Senior Member
Posts: 265
Hi there,
As you probably know the built-in movie player DvdPlayer will output audio through it's dedicated direct alsa interface which will ignore any SDL_AUDIODRIVER string defined by the user. My question is could any shed a light on how to force DvdPlayer to use SDL instead of alsa?
Many thanks
Posts: 418
Joined: Oct 2004
Reputation:
0
Oh yes the GUI uses SDL audio, but it uses very simple fire-and-forget Mix_LoadWAV, Mix_PlayChannel which are just for playing a sound effect and not streaming audio to. To stream audio to the SDL device you basically:
SDL_OpenAudio()
// set your sample rate / channels / bits per sample
SDL_PauseAudio(0)
Then SDL will start calling you back and you have to provide samples. This is slightly different than the ALSA/DirectSound devices work (they write directly) so you'll need to implement a buffer system to hold the data until SDL calls you back for it. If you're not a C++ programmer this may be difficult to construct depending on your expertise level in other languages.
Posts: 418
Joined: Oct 2004
Reputation:
0
The article you linked again isn't for streaming data to the sound card. The SDL audio stack has two access methonds. One is for playing a sample, used for a sound effect which is loaded in its entirety before playing. The other is for continuous playback. All the Mix_* functions are for the first access method, but the dvdplayer needs the second. (Actually the Mix_* functions are probably wrappers to the second method so maybe looking at the SDL source for them is a good first step)