如何使用蓝牙设备播放网络音频

时间:2021-01-11 02:47:38

标签: android html browser bluetooth web-audio-api

我编写了一个使用文本到语音引擎生成音频文件的网站。

然后使用 Web Audio API 启动这些 mp3 文件。

从计算机或智能手机上的扬声器听到 aufio 时一切正常。

但是,一旦我将蓝牙头盔连接到智能手机,就不会播放音频。

Web Audio API 不适用于蓝牙设备是一个著名的问题,还是来自我的代码?

我需要更改上下文的目的地吗?我怎样才能将它设置为蓝牙? (例如:https://www.html5rocks.com/en/tutorials/webaudio/intro/

source.connect(context.destination); // connect the source to the context's destination (the speakers)

这个问题已经在stackoverflow上发布了,但是我找不到答案。

请帮帮我。

1 个答案:

答案 0 :(得分:2)

您好,请使用网络蓝牙库获取更多参考,请阅读此here