2
美好的一天!我只是想问我是否需要在我的代码和条件内输入什么值,以便检测用户的正常语音,以便在我检测到语音后,我会自动记录并在停止记录时停止记录它是无声/录像机didnt检测的声音,这是我的代码,我得到的是从目标C detecting when a user blows into the mic.目的C:探测声音
- (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];}
}
即时通讯新,任何帮助将是对我非常有帮助...在此先感谢。
我怎么能够在我检测到它的时刻录制音频 – 2012-08-03 02:22:36
这是一个不同的问题,但简短的答案是缓冲你的音频,所以当你检测到某些东西时,你实际记录了一点点。通常将适当的数据结构称为环缓冲器。 – 2012-08-03 15:08:52