简体   繁体   English

iPhone AVAudioRecorder,AudioQueueServices,如何在检测到声音时自动录制音频

[英]iPhone AVAudioRecorder, AudioQueueServices, how to auto record audio when sound is detected

i'm using AVAudioRecorder and AudioQueueServices to record audio from the iphone's mic but I want to auto record the sound once it is detected so theres no need to press on a record button 我正在使用AVAudioRecorder和AudioQueueServices来录制来自iphone麦克风的音频,但我想在检测到声音时自动录制声音,因此无需按下录音按钮

I've looked at a tutorial about the AVFoundation: www.iphoneam.com/blog/index.php?title=using-the-iphone-to-record-audio-a-guide&more=1&c=1&tb=1&pb=1 and also a tutorial that explains how the iphone mic can detect sound levels, i've tried adding the two tutorials together but i cant get the code to work at all 我看过一个关于AVFoundation的教程: www.iphoneam.com/blog/index.php? title=using-the-iphone-to-record-audio-a-guide&more=1&c=1&tb=1&pb=1一个解释iphone麦克风如何检测声级的教程,我尝试将两个教程加在一起,但我不能让代码全部工作

Can't figure out what to do and i'm not sure if i'm taking the wrong approach 无法弄清楚要做什么,我不确定我是否采取了错误的方法

Any advice? 有什么建议?

Thanks 谢谢

Check out this tutorial: http://mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/ 查看本教程: http//mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/

I got something similar working using the above tutorial. 我使用上面的教程得到了类似的东西。 I have one AVAudioRecorder monitoring the mic's volume and another that records the mic's input when a certain threshold is reached. 我有一个AVAudioRecorder监听麦克风的音量,另一个AVAudioRecorder在达到某个阈值时记录麦克风的输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM