iOS 10.3 文本转语音适用于模拟器但不适用于设备 [英] iOS 10.3 text to speech works on simulator but not on device

查看:49
本文介绍了iOS 10.3 文本转语音适用于模拟器但不适用于设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为法语进行文字转语音通话.

I'm calling text to speech for the French language.

这在:iOS 9.3 模拟器、iOS 9.3 设备(iPad 3rd gen)、iOS 10.3 上按预期工作代码>模拟器.在 iOS 10.3 设备 (iPhone 6s) 上无法(静默)运行.

This works as expected on: iOS 9.3 simulator, iOS 9.3 device (iPad 3rd gen), iOS 10.3 simulator. Does not work (silently) on iOS 10.3 device (iPhone 6s).

默认法语语音已安装并根据设备设置工作.

Default French voice is installed and works according to device settings.

static AVSpeechSynthesizer* synthesizer = NULL;
//...
+(void)readText:(NSString*)text
{
    if(synthesizer == NULL)
      synthesizer = [[AVSpeechSynthesizer alloc] init];
    AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"fr-FR"];
    [synthesizer speakUtterance:utterance];
}

推荐答案

原来语音合成器是由铃声音量控制的,而不是媒体音量.测试者设备上的铃声已静音.

Turns out the speech synthesizer is controlled by the ringer volume, not the media volume. The ringer was muted on the tester's device.

这篇关于iOS 10.3 文本转语音适用于模拟器但不适用于设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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