How to play audio byte array (not file!) with JavaScript in a browser

后端 未结 4 2059
终归单人心
终归单人心 2021-02-08 14:51

For mostly security reasons, I\'m not allowed to store a WAV file on the server to be accessed by a browser. What I have is a byte array contains audio data (the data portion of

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-08 15:42

    I suspect you can achieve this with HTML5 Audio API easily enough:

    https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension

    This library might come in handy too, though I'm not sure if it reflects the latest browser behaviours:

    https://github.com/jussi-kalliokoski/audiolib.js

提交回复
热议问题