- Home /
Stretching audio (making audio slower)
I'm working on a Guitar Hero type game, and am trying to figure out a way to get a sort of practice mode in. Practice mode would essentially make the song you want to practice slower, and would let the player play the notes slower so you could practice parts of a song at a slower rate than what the actual song is.
I know that you can set the pitch of the audio to lower to slow down the song, but that makes everything sound demonic, which I don't want. I've looked into time stretching with SoundTouchNet (a C# wrapper for the SoundTouch library which time stretches audio) and can't get it to work since Unity can't seem to load the DLLs.
Another way I could go about doing this is using something like Audacity to time stretch the audio and save each stretched version of the audio as a separate file, but that would eat up tons of memory and obviously not something I'd want to do.
Has anybody had any luck with time stretching audio in Unity? I don't require it happening in real-time, since I could do it during a loading screen as I know time stretching audio is pretty expensive.
Thanks
Answer by LyveIG · May 27, 2015 at 08:40 AM
Time stretching is a highly complicated algorithm if done properly and also depends on the type of content. Music is probably the worst source material you can have. I suggest taking a look at the musicdsp archive for some examples.
http://www.musicdsp.org/archive.php
If you search for "stretch" there, you get a list of examples.
Your answer
Follow this Question
Related Questions
Analyzing an audio file. 0 Answers
How can I make an alarm clock? 3 Answers
audio troubles changing from one to another (stop it consistently changing) 1 Answer
Problem using AudioSource.timeSamples 1 Answer
Unmuted sounds playing off-beat 0 Answers