Search code examples
androidhtmlbrowserbluetoothweb-audio-api

How play web audio with bluetooth devices


I programmmed a website which uses text to speech engine to generate audio files.

Then these mp3 files are started using Web Audio API.

Everything works fine when hearing aufio from speakers on a computer or on a smart phone.

However, as soon as I connect my bluetooth helmet to the smart phone, the audio is not played.

Is it a famous issue that Web Audio API doesn't work with bluetooth devices, or does the issue come from my code?

Do I need to change the context's destination ? How can I set it to buetooth? (ex : https://www.html5rocks.com/en/tutorials/webaudio/intro/)

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

This question has already been posted on stackoverflow, but I can't find an answer.

Please help me.


Solution

  • Hi use the web bluetooth library for more reference read this here