SDL Mixer 1.8 audio rate issue with OGG

I created some ogg files at 22050. I play them back in ubuntu’s media
player and the play great and show a sample rate of 22050. When using these
files in a game I wrote I init SDL mixer to 22050 and use Mix_PlayChannel
which plays the file but it sounds horrible with lots of crackle. If I set
the mixer to 44100 it plays back perfectly and sounds great. I use sdl
mixer because I need multiple channels btw. My questions:

  1.  I didn't want to use 44100 because I thought the game I'm writing
    

would suffer a performance hit and that 22050 would be fine. Am I correct
in thinking that?

  1.  Is there a simple reason why the 22050 file will only sound good
    

playing at 44100?

  1.  Should I not be concerned about performance and just be happy it
    

sounds good at 44100?

Thanks.

Unfortunately I can’t offer a solution, but I will say that as far as I know
at least, there shouldn’t be any problem doing what you describe.

In my projects I regularly play back files encoded at 22050 using
frequencies of both 22050 and 44100, and haven’t had any problems. However,
I haven’t used SDL_mixer in Linux (only OS X and Windows).

  1.  I didn't want to use 44100 because I thought the game I'm writing
    

would suffer a performance hit and that 22050 would be fine. Am I correct
in thinking that?

44100 can use more resources (both in terms of memory and CPU usage), but
whether this will impact performance depends on the context. One option
would be to make it an option that can be changed via an 'audio options’
menu, and let the user decide (this is how I handle it).

  1.  Is there a simple reason why the 22050 file will only sound good
    

playing at 44100?

Not that I know of.

  1.  Should I not be concerned about performance and just be happy it
    

sounds good at 44100?

It sounds to me like something is wrong somewhere, so if I were you I’d
pursue it a bit further and see if you can get it sorted out. (Sorry I can’t
offer more specific advice - maybe someone more familiar with Linux or with
the internals of SDL_mixer will be able to help.)–
View this message in context: http://www.nabble.com/SDL-Mixer-1.8-audio-rate-issue-with-OGG-tp22393770p22402313.html
Sent from the SDL mailing list archive at Nabble.com.