I need acelerate the sound, change your speed. For this, I’m using pitch code, that i found in GitHub… Ok, it’s possible, but, when the sound acelerate, it becomes more acute, and it’s my problem… I need change the speed, but keeping your característics… Someone could give me some tip about this?
Thanks…
It’s a real shame that SDL_mixer can’t do this! I use:
alSourcef(sourceID, AL_PITCH, fPitch);
on my native iOS apps, but for the SDL port of my WW2 game I ended up using Audacity to alter the pitch of the tank engine sound and created about 20 differently pitched .wav files which I switch between to get the same effect.
what you’re trying to do is much more difficult than just squeezing the sound (and rising the pitch), by several orders of magnitude
It’s not surprising that a simple mixer like SDL_mixer does not offer this. Even audacity does not offer to do this in real-time.
Real-time is possible if you’re not too picky about quality of sound. For best quality, doing it beforehand (like @SeanOConnor suggest) is probably the way to go.
Unless you have a strong scientific background, it’s almost impossible to program this yourself. You need instead to use an specific library, like rubber-band https://breakfastquay.com/rubberband/index.html
both libraries: soundtouch and rubberband that I mentioned above can be used freely in opensource applications. For more specific needs you need to have a look a their license.