WAV and OGG

Started by
7 comments, last by jbadams 19 years, 4 months ago
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
Advertisement
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?
Anthony Rufrano
RealityFactory 2 Programmer
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?

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
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.
Patrick
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).
enum Bool { True, False, FileNotFound };
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?

- Jason Astle-Adams

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?
Anthony Rufrano
RealityFactory 2 Programmer
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.

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement