我喜欢通过呼叫接收器扬声器播放音频,目前我正在使用它来播放某些文本作为音频。如何通过呼叫接收器扬声器播放AVSpeechSynthesizer?
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:_strTextCheck];
AVSpeechSynthesizer *syn = [[AVSpeechSynthesizer alloc] init];
[syn speakUtterance:utterance];
我得到了,但是这不是AVSpeechSynthesizer:
[AVAudioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&error];
正确的在一个普通的扬声器工作,但我想打通过电话受话器扬声器播放,是有可能做到这一点?
但仍然通过其受话器扬声器音箱上运行的兄弟http://paste.ofcode.org/uEi8M5FjcGhB97NurcEEsM –
其没有运行 –
@KishoreKumar - 看到我的更新 - 你需要检查你的audioSession类别是否正确 – foundry