在 iOS 中同时管理文本转语音和语音识别 [英] Managing text-to-speech and speech recognition at same time in iOS

查看:38
本文介绍了在 iOS 中同时管理文本转语音和语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的 iOS 应用程序使用文本到语音转换来向用户读取它从服务器接收到的一些信息,并且我还希望允许用户停止通过语音命令进行此类演讲.我已经尝试过像 OpenEars 这样的 iOS 语音识别框架,我发现问题在于它正在监听和检测应用程序本身说"的信息,并且它干扰了用户语音命令的识别.>

是否有人在 iOS 中处理过这种情况并找到了解决方案?提前致谢

解决方案

实施起来不是一件小事.不幸的是,iOS 和其他人录制了通过扬声器播放的声音.您唯一的选择是使用耳机.在这种情况下,语音识别可以继续监听输入.除非插入耳机,否则在 TTS 期间将禁用 Openears 识别.

如果您仍然想实现这个称为barge-in"的功能,您必须执行以下操作:

  1. 存储您通过麦克风播放的音频
  2. 实施噪音消除算法,有效地从录音中去除音频.您可以使用互相关在录音和频谱减法中找到合适的偏移量以去除音频.
  3. 识别剩余信号中的语音.

如果不对 openears 源进行重大修改,这是不可能做到的.

相关问题是播放音乐时的Android语音识别

I'd like my iOS app to use text-to-speech to read to the user some information that it receives from a server, and I'd also like to allow the user to stop such speech by a voice command. I have tried speech recognition frameworks for iOS like OpenEars and I find the problem that it is listening and detecting the information the app itself is "saying" and it intereferes in the recognition of user's voice commands.

Has somebody dealt with this scenario in iOS and found a solution for that? Thanks in advance

解决方案

It is not a trivial thing to implement. Unfortunately iOS and others record the sound which is playing through speaker. The only choice you have is to use the headset. In that case speech recognition can continue listening for input. In Openears recognition is disabled during TTS unless headset is plugged in.

If you still want to implement this feature which is called "barge-in" you have to do the following:

  1. Store the audio you play though microphone
  2. Implement noise cancellation algorithm which effectively will remove the audio from the recording. You can use cross-correlation to find a proper offset in the recording and spectral subtraction to remove the audio.
  3. Recognize the speech in remaining signal.

It is not possible to do that without significant modification of openears sources.

Related question is Android Speech Recognition while music is playing

这篇关于在 iOS 中同时管理文本转语音和语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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