【问题标题】:Android audio slow to start playing over bluetooth scoAndroid 音频开始缓慢通过蓝牙 sco 开始播放
【发布时间】:2016-10-20 08:51:05
【问题描述】:

我正在开发一个应用程序,它将通过蓝牙 SCO 播放 TextToSpeech 音频。连接到目标蓝牙设备(汽车音响),然后指示 TextToSpeech 引擎说话后,音频开始播放大约需要 15 秒,即使我在通过 SCO 连接和播放 TextToSpeech 之间等待几秒钟。

这是我用来通过 SCO 连接的代码:

AudioManager audioM = (AudioManager) getApplicationContext().getSystemService(getApplicationContext().AUDIO_SERVICE);
audioM.setMode(audioM.MODE_IN_COMMUNICATION);
audioM.setBluetoothScoOn(true);
audioM.startBluetoothSco();
audioM.setSpeakerphoneOn(false);

这是我用来播放 TextToSpeech 的代码:

String text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
HashMap<String, String> ttsParams = new HashMap<String, String>();
ttsParams.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_VOICE_CALL));
mTts.speak(text, TextToSpeech.QUEUE_FLUSH, ttsParams);

其他 Android 应用(包括 VOIP 和内置电话应用)不会受到这种延迟的影响。我创建的等效 iOS 应用程序没有延迟。所以我知道问题不在于立体声。

任何帮助将不胜感激,谢谢

【问题讨论】:

    标签: android audio bluetooth text-to-speech bluetooth-sco


    【解决方案1】:

    原来问题出在我正在测试的低端设备上。我尝试过的所有其他设备都会立即播放。

    【讨论】:

      猜你喜欢
      • 2011-11-04
      • 1970-01-01
      • 1970-01-01
      • 2021-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-21
      相关资源
      最近更新 更多