- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要使用某种文本转语音工具来发音多种语言。我试过这段代码:
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
AVSpeechSynthesizer *syn = [[[AVSpeechSynthesizer alloc] init]autorelease];
[syn speakUtterance:utterance];
哪个工作正常,但由于我想使用多种语言,它似乎没有这个功能还是什么?如何选择语言?
如果上述不可能,我想使用 Google api
这个怎么玩
http://translate.google.com/translate_tts?tl=en&q=Hello
在我的 View Controller 中?
最佳答案
这真的很简单,而且肯定有这个功能,试试下面的方法:
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-gb"];
如果您需要了解所有可用的语言,请将以下代码放在某处:
NSArray* voices = [AVSpeechSynthesisVoice speechVoices];
NSLog(@"Voices: (%d) %@", voices.count, voices);
如果您需要有关 AVSpeechSynthesisVoice
的更多文档,请查看以下链接:
关于ios - 使用 google API 或 AVspeech 的文字转语音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21611497/
我需要使用某种文本转语音工具来发音多种语言。我试过这段代码: AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWit
我需要的是单独使用左声道或右声道播放音频。我知道 AVAudioPlayer 可以使用 pan 属性使用任一 channel 播放音频。如果 AVSpeechSynthesizer 没有办法做到这一点
我知道你可以使用委托(delegate)方法来判断 AV 语音何时结束 extension MyViewController: AVSpeechSynthesizerDelegate { f
为了使用 AVSpeechUtterance 说出数字,我希望 Siri 以符合数字类型约定的方式说出数字。 对于日期,我希望它把 1492 读成十四九十二,而不是一千、四百、九十二。 对于电话号码
我是一名优秀的程序员,十分优秀!