是否有任何机构可以帮助我找到音频文件的音高。我有一个代码,通过Mic计算音高,但我想检测音高信号及其强度?
答案 0 :(得分:0)
为此你需要使用avaudioplayer。它将为您提供音频音高的峰值功率。这些峰值电影实际上是信号强度,你可以从中做动画。
audioPlayer.meteringEnabled = YES;
[audioPlayer updateMeters];
if([audioPlayer isMeteringEnabled] ){
for (int currChannel = 0; currChannel < [audioPlayer numberOfChannels]; currChannel++) {
//strength of audio channel
NSLog(@"channel# %d %0.2f %0.2f", currChannel, [audioPlayer peakPowerForChannel:currChannel], [audioPlayer averagePowerForChannel:currChannel]);
}
}