【发布时间】:2018-04-28 15:50:36
【问题描述】:
我正在尝试将我的 TTS 输出路由到外部蓝牙 SCO 设备(与本地扬声器和麦克风一起工作正常),但它无法播放。
我正在为 AudioManager 设置路由如下 -
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audioManager.startBluetoothSco();
audioManager.setBluetoothScoOn(true);
用这种方法播放话语-
private void say(String text, String utteranceId) {
Log.d(TAG, "Saying: " + text);
final Bundle ttsParams = new Bundle();
ttsParams.putInt(TextToSpeech.Engine.KEY_PARAM_STREAM, AudioManager.STREAM_VOICE_CALL);
mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, ttsParams, utteranceId);
}
扬声器没有声音。如果我不将BluetoothScoOn 设置为 true,它可以与内置扬声器一起正常工作。
【问题讨论】:
标签: android google-text-to-speech