I\'m using the following method to play a byte array containing wav data. The function is being called from a GWT project.
This function plays back sound, but it so
This approach will work with the latest iOS safari comparing to AudioContext. Audio object should be created on tap/click (user interaction) event, so don't do it in request callbacks.
const audio = new Audio()
fetch(url, options) // set content header to array buffer
.then((response) => {
var blob = new Blob([response.value], { type: 'audio/mp3' })
var url = window.URL.createObjectURL(blob)
audio.src = url
audio.play()
})
snippet from here