Sign in to follow this  
rpulley123

WAV and OGG

Recommended Posts

Ok, I have some nice background music that I created, the only problem is that the wav file is too big (5 megs). So, I decided to convert it to an OGG (stereo, 128 bit rate, VBR). The only problem that I have now is that everytime it looks, I hear a click, its not as smooth as it used to be. I am using the SDL_mixer for playback. Does anyone have any insight into this? Am I just doomed to have bad looping when using compressed formats? Thanks, -- Rocky

Share this post


Link to post
Share on other sites
Have you tried playing the OGG file through WinAMP or some other player? I've heard stories of sound quality problems with OGG and SDL_Mixer. If it still makes the "clicking" noise, then I would reencode the OGG file. What are you using to encode to OGG?

Share this post


Link to post
Share on other sites
Quote:
Original post by paradoxnj
Have you tried playing the OGG file through WinAMP or some other player? I've heard stories of sound quality problems with OGG and SDL_Mixer. If it still makes the "clicking" noise, then I would reencode the OGG file. What are you using to encode to OGG?


I'm using GoldWave, when I loop it inside of GoldWave, it sounds perfect as well. Is there any kind of tweaking I can do for SDL_Mixer to make it work better with OGG files?

Share this post


Link to post
Share on other sites
I use SDL_mixer with OGG files - No clicking whatsoever. I use goldwave too. The .ogg files were converted from .mp3, so that may be it, since .mp3 is already compressed.

I saving my .ogg files as 44100Hz, 128kbps, (0.4g), stereo

Share this post


Link to post
Share on other sites
Quote:
Original post by rpulley123
Ok, I have some nice background music that I created, the only problem is that the wav file is too big (5 megs). So, I decided to convert it to an OGG (stereo, 128 bit rate, VBR). The only problem that I have now is that everytime it looks, I hear a click, its not as smooth as it used to be.

I am using the SDL_mixer for playback. Does anyone have any insight into this? Am I just doomed to have bad looping when using compressed formats?

Thanks,
-- Rocky


If you can't get SDL_mixer to work I would suggest FMod.

Share this post


Link to post
Share on other sites
I suggest adding at least 100 milliseconds of silence at the beginning and at the end. Then when you loop, you should overlap-and-add the beginning and end by 200 milliseconds.

Another way of doing it is to cross-fade from the very end to the very beginning; if you use an N milliseconds cross-fade, you should make your background be N milliseconds longer than the actual loop you want (i e, 32 bars + N milliseconds, rather than exactly 32 bars for a 32-bar loop).

Share this post


Link to post
Share on other sites
Quote:
Original post by wyrzy
I use SDL_mixer with OGG files - No clicking whatsoever. I use goldwave too. The .ogg files were converted from .mp3, so that may be it, since .mp3 is already compressed.

I saving my .ogg files as 44100Hz, 128kbps, (0.4g), stereo


You're aware that converting from mp3 to ogg (or the reverse) will cause a loss of quality, as they're both lossy formats, but discard different information?

Share this post


Link to post
Share on other sites
He plays it in GoldWave and it's fine. I don't think it has anything to do with the conversion from MP3 to OGG. I believe that it's everything to do with SDL_Mixer. Can you post the SDL_Mixer code for the initialization of SDL_Mixer and the playing of the sound?

Share this post


Link to post
Share on other sites
Quote:
Original post by paradoxnj
He plays it in GoldWave and it's fine. I don't think it has anything to do with the conversion from MP3 to OGG.


I'm aware of that, and I presume the OP isn't actually doing the same, I just thought I'd point it out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this