简体   繁体   English

检测音频文件中的静音

[英]Detect silence in audio file

I wonder if there any example showing how to detect silence in audio file.我想知道是否有任何示例显示如何检测音频文件中的静音。

Would I would like to achieve is to record a audio with a format such as WAV, and check if there is real sound is recorded or just silence.我想实现的是用WAV等格式录制音频,并检查是否录制了真实的声音或只是静音。

any clue is appreciated.任何线索表示赞赏。

If you read the samples in from the WAV, you can sum their absolute value to get an idea of the total amplitude represented in the file.如果您从 WAV 中读取样本,您可以将它们的绝对值相加,以了解文件中表示的总振幅。 Lower values will indicate lower amplitude.较低的值将表示较低的幅度。 You will likely have to calibrate this calculation to your specific problem.您可能必须针对您的特定问题校准此计算。

In OS X or iOS, you can use Extended Audio File Services to obtain the samples.在 OS X 或 iOS 中,您可以使用扩展音频文件服务来获取样本。 I have some example code posted at https://gist.github.com/d108/1ea9c833b10e714defef29824362821a to get you going.我在https://gist.github.com/d108/1ea9c833b10e714defef29824362821a上发布了一些示例代码,以帮助您前进。

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

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