检测语音识别激活
好吧,我有这个应用程序作为服务运行,经常采集音频样本,并跟踪幅度。它工作得很漂亮。我有 try/catch 块,这样我的应用程序就不会干扰使用麦克风的其他应用程序,等等。我遇到的唯一问题是语音识别应用程序。任何其他使用麦克风、录制备忘录、电话等的应用程序都不会因为 catch 块而打扰我的应用程序。但是,如果当我的应用程序尝试获取样本时语音识别应用程序正在运行,我的应用程序就会崩溃。据我所知,无论出于何种原因,我的应用程序在到达 stop() 函数时都会失败......但这不是我来这里的目的。
我想知道的是是否有一种方法可以检测语音识别应用程序是否正在运行/已启动。就像我说的,我有捕获块,当麦克风无法访问时,它们在其他情况下都能很好地工作,但由于某种原因,它们不适用于语音识别。
Alright, I have this app that runs as a service and takes audio samples every so often, and keeps track of the amplitude. It works beautifully. I have try/catch blocks so that my app doesn't interfere with other apps using the microphone, and all of that. The only problem I have is with the Voice Recognition app. Any other app that uses the microphone, recording memos, the phone, anything, doesn't bother my app because of the catch blocks. However, if the voice recognition app is running when my app tries to take its sample, my app crashes. To my knowledge, my app fails when it reaches the stop() function, for whatever reason...but that's not what I'm here for.
The thing I would like to know is if there is a way to detect if the Voice Recognition app is running/is started. Like I said, I have the catch blocks in place which work beautifully for every OTHER situation when the microphone wouldn't be accessible, but they, for some reason, don't work for the voice recognition.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论