【问题标题】:how to do text to speech using custom keyboard in IOS 8?如何在 IOS 8 中使用自定义键盘进行文本转语音?
【发布时间】:2014-10-07 18:39:35
【问题描述】:

我使用此链接制作了一个自定义键盘 https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html

现在我需要在语音中添加文本功能。换句话说,当用户按下键时,它会说出那个词。你能告诉我这是怎么可能的吗?在 IOS 8 中可能吗?

【问题讨论】:

  • Apple 目前还没有为自定义键盘提供语音听写功能。

标签: ios objective-c iphone ios7


【解决方案1】:

查看 ios7 及以后的以下类

AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"whatever text"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];

[synth speakUtterance:utterance];

更多信息请查看苹果的图书馆文档

AVSpeechSynthesizer

AVSpeechUtterance

【讨论】:

  • 您是否在自定义键盘中使用过该功能?
猜你喜欢
  • 1970-01-01
  • 2014-08-11
  • 2015-02-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多