Android:如何检测用户何时停止对着麦克风说话
我有一个 Android 应用程序,在应用程序启动时开始从麦克风录音。在我当前的版本中,用户必须按“停止”按钮才能停止录制。
如何检测用户已停止说话并使用它来触发录音机停止?
类似于 Android 中语音识别功能的实现。用户停止说话,然后语音被翻译。我见过其他应用程序可以做到这一点,例如“汤姆猫”类型的应用程序。
作为旁注,我还想展示某种类型的视觉效果,表明麦克风正在接收声音。可以显示声音级别的东西。
任何帮助表示赞赏。
I have an Android application that begins recording from the microphone when the application starts. In my current version, the user must press a STOP button to stop recording.
How do I detect that the user has stopped talking and use that to trigger the recorder to stop?
Similar to what is implemented in the Speech Recognition functionality in Android. The user stops talking and then the speech is translated. I have seen other apps that do it, like Talking Tom type apps.
As a side note I would also love to show some type of visual indicating that the microphone is receiving sound. Something to show the sound level coming in.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种方法是在记录时使用线程,并在记录的字节上使用语音功率分析过程,
有一个示例代码供您参考:http://musicg.googlecode.com/files/musicg_android_demo.zip
An approach is to use threads on recording and the speech power analyzing process on the recorded bytes,
there's a sample code for your reference: http://musicg.googlecode.com/files/musicg_android_demo.zip
你用什么来录制音频?这可能会提供一些线索:
android.media.MediaRecorder:
android.speech.SpeechRecognizer:
What are you using to record audio? This may provide some clues:
android.media.MediaRecorder:
android.speech.SpeechRecognizer: