0

I am currently building an app where I want a specific sound to be played. The way I do this is that I call a Python API from JavaScript, which returns bytes.

My question is if it's possible to play a sound from bytes in JavaScript or is it possible for Python API to return playing audio instead of raw bytes?

Jure Games
  • 31
  • 1
  • 2
  • 1
    It's possible to [play a sound from a byte array](https://stackoverflow.com/questions/24151121/how-to-play-wav-audio-byte-array-via-javascript-html5) in JavaScript. – Anderson Green Jan 10 '20 at 18:43
  • "return playing audio" makes no sense. You will have to implement a way to output the sound from client side. – TGrif Jan 10 '20 at 18:59
  • If it's not possible to "return playing audio", is it possible to play sound from raw bytes? – Jure Games Jan 13 '20 at 16:52
  • Anderson Green, I've tried that but I always get "Uncaught (in promise) DOMException: Unable to decode audio data" error. – Jure Games Jan 15 '20 at 17:10

0 Answers0