Sign in to follow this  

Live re-sampling playback speed changes using SDL mixer?

This topic is 1122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on a game which has ability to slow down time. All of the graphics/animations are simulated in slow motion during this feature. However the sound is still playing at its normal speed. I would like all audio to play 2x slower but I am using the SDL mixer API and can't find an appropriate API for this purpose.

 

Can anyone please suggest a hack or workaround so I don't have to re-write my sound code on a different API? I would like to achieve this effect using SDL mixer. Thanks.

Edited by linuxwolf

Share this post


Link to post
Share on other sites

I don't know anything about SDL - can you supply the sampling frequency anywhere for SDL for the individual tracks playback? If so just reduce the playback sampling frequency by the amount you want the soundclip slowed - ie if your sampling frequency is 44.1k and you want the speed to be 2/3 of normal, set sampling frequency for that clip to 2/3 * 44.1 kHz for playback.

Share this post


Link to post
Share on other sites

This topic is 1122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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