so let's see what is going on with the code over here. the first thing to do, is to start using something called avaudioengine. now this library, is packaged within the avfoundation framework and what it does, is it allows us to manipulate audio. so, as step one in our code,
How To Animate Nslayoutconstraint, what we are going to do, is create an object of avaudioengine. once we have done that, we will create an instance or an object of something called avaudioplayernode. you can think of this, as the thing that is connect to our mp3 file and
will actually play the recorded sound. okay, let's create an object of this. once you have done that, i will attach this to the av audio engine. let me do that now. like that. in the next step, we will create something called avaudiounittimepitch. this is the class that actually allows us to change the pitch of our audio. so let's do that next. and then, i will attach this to avaudioengine also.
then, towards the end, i will connect these two nodes together. there. and then, finally, i will connect avaudiounittimepitch, to some sort of an output, like the speakers, let me do that. once all of this is done, we can play the audio. oh, by the way, based on the value of the pitch in this effect. the recorded voice will sound like a chipmunk
No comments:
Post a Comment