ios – AVSpeechUtterance最大音量非常安静且速度非常快
2020年02月18日
作者:佚名
我正在为我的应用程序添加语音提示并在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];
以上是来客网为你收集整理的ios – AVSpeechUtterance最大音量非常安静且速度非常快全部内容,希望文章能够帮你解决ios – AVSpeechUtterance最大音量非常安静且速度非常快所遇到的程序开发问题。
如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。