So I've been playing with the Web Audio API and have the following issue.
I am making a project in which I call an external library's API with Ajax and get audio back (arraybuffer).
- I send them the text and get audio back.
- This is not necessarily a GET request (can be POST, etc.)
- If text is too large, I split it into smaller chunks and send multiple requests
So far so good, now comes the issue of how to play the multiple audios that I got back.
Since users do not care that I have split the text and actually have multiple audio tracks, I need somehow to make it look like a single track or as a playlist.
So I have tried to:
- merge arraybuffer (apparently it does not work like that and most likely I need ffmpeg or simiar tools to do the merging, which is hard to do on client-side? (like there is ffmpeg for browsers, but I don't know how good is it to burden a client with it). If it's not so, maybe you can suggest something here)
- load it as a playlist, but so far cannot find a library that accepts multiple audiobuffers/audiocontexts and/or gives a playlist with it back.
The easiest solution that I see so far is to create my own small library that accepts AudioBuffers/arraybuffers and go either with the playlist approach or play the 'chunked' audios one by one and make scrubber that jumps between audio contexts.
Is there a library/easier approach?
Will be thankful for any suggestions :]
Aucun commentaire:
Enregistrer un commentaire