我正在为新的 Apple Watch 创建一个应用程序。我想使用文本转语音功能。现在,我正在使用旧代码(iPhone):
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
speechPaused = YES;
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:@""];
utterance.rate = 0.15;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"it_IT"];
[synthesizer speakUtterance:utterance];
在我的模拟器中,它适用于 watch 。
我很困惑,因为我在几个论坛上读到过无法使用文本到语音转换。
我想知道我的代码是否适用于真正的 Apple Watch。
谢谢你。
最佳答案
根据文档 developer.apple.com AVSpeechSynthesizer API 可用于 watchOS 2+。
此外,截至 2017 年 6 月 9 日,我可以验证我可以在实际设备上在手腕上播放 AVSpeechUtterance,Series 0 Apple Watch,38mm,可以从内置扬声器播放或通过蓝牙耳机(BeatsX )。
关于text-to-speech - WatchKit:我可以使用文字转语音吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30144834/