我正在为我的应用程序添加语音提示并在iOS 7中测试AVSpeechUtterance,但默认语音速率非常快.最低语速更容易理解.但最大音量值1太安静了!我在iPhone 4上测试了它,音量一直在变高.某些东西一定是错的,否则它将如何可用.
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init]; NSString *mystring = [NSString stringWithFormat:@"Talk String Here %@",myObject.name]; AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:mystring]; [utterance setRate:AVSpeechUtteranceMinimumSpeechRate]; [utterance setVolume:1]; [synthesizer speakUtterance:utterance];
解决方法
@ tmr的帖子
here为我解决了这个问题:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。