1

This is similar to The Pitch Shift question, except I want to keep my audio at the same pitch, but play it slower or faster -- time shift it. (On the iPhone.)

Can anyone point me to a library, tutorial or other reading to help with that?

Thanks!

Community
  • 1
  • 1
Olie
  • 24,597
  • 18
  • 99
  • 131
  • I ended up using the Dirac library, which handles this problem quite nicely. Maybe someday I'll learn all about FFTs and implement that on my own. http://www.dspdimension.com/technology-licensing/dirac2-iphone/ – Olie Aug 24 '10 at 18:43

2 Answers2

0

Isn't this essentially the same thing? For example, if you pitch-shift something up an octave, then play it back at half speed, then it will play at the original pitch, but last twice as long...

psmears
  • 26,070
  • 4
  • 40
  • 48
  • Right. The question is: how to play it back at half speed. "Just modify the sound samples" isn't a detailed enough answer for me to follow what needs to be done. – Olie Jul 02 '10 at 14:21
  • @Olie - I didn't say "Just modify the sound samples" :-) How to change the playback rate depends on what API you're using to play the audio, but if you're using one that uses the `AudioStreamBasicDescription` structure, you may be able to modify the `mSampleRate` element to adjust the playback rate. Have you tried out any of the solutions from the "Pitch Shift" question yet? Which API did you use to play the sounds? – psmears Jul 02 '10 at 14:47
  • Ah, yes -- sorry, I didn't mean to imply that you said that, only that it's a common theme in other answers I've seen, and I'm not quite up to the level of being able to interpret that sort of glossing-over. I'm not currently tied to any particular playback mechanism, as tempo-shifting is a necessary component. I'll investigate the AudioStream stuff. To the answer you gave: "If you pitch shift something up an octave" -- how? "...then play it back at half speed" -- how? That's what I was getting at. Thanks! – Olie Jul 02 '10 at 23:17
0

A "time shift" is simply a delay. "Time Stretching" is what you will want, which is the reciprocal case to pitch shifting. As others have mentioned, Dirac should fit the bill.

tahome
  • 268
  • 2
  • 5