Reputation: 4356
I'm writing a very simple game with C++ and SDL/SDL_mixer. The game uses some simple audio functions that play sound effects when something happens, and my program has been working fine until now. At a seemingly random time, the program will start making screeching and static noises (but will still be able to play sound effects.) I recorded the sound with my laptop's mic: http://www.mediafire.com/?oe9nrdk9w5r572k. While making the sounds the program may or may not crash. I'm at a loss with what to do.
Upvotes: 0
Views: 519
Reputation: 229754
It sounds like the memory area where you store the sound data is overwritten/corrupted (leading to "noise" output). That your program crashes with an access violation also points to memory corruption.
Make sure that the buffer with the audio data is properly allocated and isn't freed/deleted/... while it is still in use.
Upvotes: 0