如何在录制过程中检查5秒静音并根据静音停止录制? [英] How to check for 5 sec silence during recording and stop recording based on silence?

查看:151
本文介绍了如何在录制过程中检查5秒静音并根据静音停止录制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用录音机对象录制用户输入,然后我需要确定静音并停止录音。有关实施的任何提示吗?

解决方案

您将遇到的问题是Recorder类使用MediaSink实例来记录媒体流和WMAFileSink是一个您用来录制到WMA文件,不会公开媒体流。 因此,您无法查看媒体内容以检测静音。

您可以实现自己的MediaSink类并以这种方式访问​​数据,但是您还需要实现写作您也可以使用适当的输出格式的数据。

您是否考虑过使用语音识别? 也许UCMA工作流程可以满足您的需求。 它不会记录原始语音,但它确实为您提供了一种检测静音的方法。

I'm recording user imput using recorder object and then I need to determine silence and stop recording. Any tips for implementation?

解决方案

The problem you will have is that the Recorder class uses an instance of MediaSink to record the media stream and the WMAFileSink which is the one that you use to record to a WMA file, does not expose the media stream.  So you don't have any way to look at the media content to detect silence.

You could implement your own MediaSink class and get access to the data that way, but then you also need to implement writing the data to the appropriate output format yourself as well.

Have you looked at using speech recognition instead?  Maybe the UCMA workflow would meet your needs.  It does not record the raw speech, but it does give you a way to detect silence.


这篇关于如何在录制过程中检查5秒静音并根据静音停止录制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆