How to modify SpeakHere sample code to record and play audio like a loopback?
I want to change SpeakHere application to record and play audio like a loopback, means after recording.. the开发者_JAVA百科 recorded voice should immediately repeats what is recorded like a eco.
Can anyone tell me in which part of code I have to make changes to achieve this.
Also am not able to download sample code of SpeakHere application from following link. Kindly guide from where to download the code.
https://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007802-Intro-DontLinkElementID_2
Thanks in advance
I just tried the link you posted and it works fine.
To echo the users voice you will need another AudioQueue to monitor input levels. When the input level passes a certain threshold, start recording. When the input level falls below that threshold for a length of time, stop recording and start playback.
You can set up another AudioQueue to monitor by copying the code that does the recording. Just dummy out the callback code so it doesn't actually do anything.
Set the controller as a delegate in the monitor class. That should then receive method calls stating whether the monitor has checked a level above or below the threshold.
Then, in the controller you can start, stop, and playback as need be.
精彩评论