Time Strech and SDL

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?

I’m using this code

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.

Thanks, Sean. It’s difficult to me. For some reasons I need use SDL… Maybe to be impossible. I Will search more…

what you’re trying to do is much more difficult than just squeezing the sound (and rising the pitch), by several orders of magnitude :wink:
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.

It’s not necessary real time… really not necessary…

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

this one looks nice too: http://www.surina.net/soundtouch/README.html

Big Thanks, Sanette… really big thanks… this step is very important to me… for the finish my application… Do you know one free library that can do it?

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.

1 Like