wishy at comcast.net
Mon Jan 20 13:11:01 EST 2003
Doh! Oh well, I spent the weekend ripping out the libao stuff and using
This actually wasn't a big deal to do, until I got to the ogg stuff.
SMPEG sends a full buffer worth of data, but libvorbis does not. It took
me most of the weekend to figure out how to split the decoded data up into
chunks that would fit perfectly into the *stream buffer. Once I got it
working, it was fine, but I still could have avoided the problem.
Oh well, I learned a little about the internals of SDL and SDL_sound in
the process, so all was not lost. :)
> Sorry if this is late (I currently have limited
> internet access).
> If you're using other sound libraries other than SDL
> with SDL_sound, after the Sound_Init() call, try doing
> SDL_QuitSubsystem(SDL_INIT_AUDIO). I had to do this
> hack to get SDL_sound to work with OpenAL for SMPEG
> because I also had the SMPEG silence problem.
> Disabling it for me reactivated SMPEG.
> It seems that the SDL_InitSubsystem() call in
> SDL_Sound is sort of a 'half-way to hell' scenario.
> You either need to fully enable SDL audio yourself to
> get SMPEG playback, or you need to fully
> disable SDL audio and use your alternative audio
> Ryan, perhaps this should be removed from SDL_sound
> unless there are other reasons to init the audio
> It seems reasonable to me that if a person intends to
> use SDL_Audio, they should be responsible for calling
> SDL_InitSubsystem() and SDL_OpenAudio() themselves and
> it's no fault of SDL_sound if they don't.
> --- Ted Kulp <wishy at comcast.net> wrote:
>> Thanks for your help. Time for me to figure out how
>> to do sound in SDL.
>> I'm still using libao from when the program was ogg
>> only. I only put SDL
>> in to use SDL_sound (and get easy MP3 support).
>> Guess it's time to rip
>> out the libao stuff and go SDL only.
>> Thanks again,
>> >> If I enable SMPEG, I get no sound. Nada. It's
>> filling the buffer with
>> >> data, because I have my counter working from the
>> size of the data in the
>> >> buffer, and it's full everytime. If I disable
>> SMPEG, everytime I play a
>> >> file with id3v2 tags, I get garbage and it just
>> moves on to the next
>> >> song.
>> > SMPEG requires you to have the audio device opened
>> through SDL_OpenAudio()
>> > before decoding. This is a stupid requirement, but
>> that's how it is at the
>> > moment. That's the usual cause of problems.
>> > The other MP3 decoder (mpglib) doesn't deal with
>> file corruption at all,
>> > and doesn't understand ID3v2 tags. There's a hack
>> to discard ID3v1 tags
>> > before passing them to the decoder, and the same
>> could be done for ID3v2,
>> > I suppose.
>> > --ryan.
>> Ted Kulp
>> wishy at comcast.net
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
wishy at comcast.net
More information about the sdlsound