问题
What is the best way to accomplish this?
From what I have read so far, it seems you have to setup IO Remote (which is a pain itself). Do you need to do a FFT? Are there any examples out there?
Can I just speed up / slow down playback?
Thanks
回答1:
OpenAL lets you pitch-shift with the AL_PITCH source property. Maybe you could run your audio through OpenAL and use that.
回答2:
I've never developed for an iPhone, but if you have sufficient control over the buffer sent to the audiodevice, then you could do the following:
say you have a buffer read from an audiofile, if you send only every even sample to the audiodevice (probably put in some other buffer which is passed to some function), then it will double the frequency and half the time to play the file.
If you want something in between you need to compute in between samples or resample the audiofile = interpolate values between successive samples.
来源:https://stackoverflow.com/questions/869859/change-pitch-of-audio-during-playback-on-iphone