【发布时间】:2012-08-02 06:22:28
【问题描述】:
美好的一天!我只是想问一下我是否需要在我的代码和条件中输入什么值才能检测到用户的常规语音,这样在我检测到语音后,我会自动录制它并在何时停止录制静音/录音机没有检测到声音,这是我的代码,我从detecting when a user blows into the mic. 得到的
- (void)levelTimerCallback:(NSTimer *)timer {
[recorder updateMeters];
const double ALPHA = 0.05;
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
lowPassResults = ALPHA * peakPowerForChannel + (1.0 - ALPHA) * lowPassResults;
[recorder record];
if (lowPassResults < 0.95)
{NSLog(@"Recording");
[recorder record];}
}
我是目标 c 的新手,任何帮助都会对我非常有帮助...在此先感谢。
【问题讨论】:
标签: objective-c audio avfoundation audio-recording