开发者

Is Real time pitch shifting possible with AudioUnit?

开发者 https://www.devze.com 2023-03-16 01:53 出处:网络
I am playing two sine wave tone generated on the fly with the help of AudioUnit. I need to give the user a UISlider which helps him to change the pitch of the tone on the fly. I am st开发者_如何学Cuck

I am playing two sine wave tone generated on the fly with the help of AudioUnit. I need to give the user a UISlider which helps him to change the pitch of the tone on the fly. I am st开发者_如何学Cuck in setting pitch for the tone with AudioUnits, please provide some code snippet to change the pitch with help of AudioUnits.


Changing the pitch of a generated waveform, such as a sine wave, being copied into an AudioUnit callback buffer, is certainly possible. Exactly how to change it depends on how you are generating the sine wave. If by table look up, then you can change the table step size and interpolate. If by calling the sinf() function, you can change the delta phase change per sample in the function call to match some relationship with your slider position. etc.

However the term "real-time pitch shifting" often refers to another different and more complicated DSP process, such as a phase vocoder used for combined time-pitch modification. Which do you mean?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号