Change pitch of audio during playback on iPhone [duplicate]

ぃ、小莉子 提交于 2019-12-21 02:57:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!