I am looking for a browser native solution to do some basic audio processing entirely on the client-side, in-browser. I want users to select a short time range (say, no more than 2mins) anywhere in the audio and post-process the fragment to create short clips with fancy waveform visualization. This is a good example of what we want to achieve.
After spending a good amount of time looking at Web APIs, Webaudio APIs, FFmpeg WASM port (20MB+ in size + licensing issues), I am running into the following problems:
Ideally, once the user has selected the short-time range, we would like to download the audio fragment and add fancy visualization using OfflineAudioContext and custom ScriptProcessorNode.
However, the ability to fetch fragments is not readily available, except through HTML5 audio tag or HTMLElementNode. However, audio tag or HTMLElementNode doesn't allow for batch processing with OfflineAudioContext, your can only process audio in a streaming fashion using AudioContext.
The crux of the problem is that is it not possible to programmatically fetch (based on user input) media fragments with XHR or fetch API. One can use client-side FFmpeg WASM port for this, however large library size disqualifies it for this project.
Please note that the servers serving the audio files do accept Range header (think of most of the podcast mp3 hosts).
Does this project solve the problem of downloading media fragments?
Only indirectly. WebCodecs provides audio decoding, but does not provide demuxing. (In FFmpeg terminology, it is like libavcodec, and not like libavformat.)
Hi,
I am looking for a browser native solution to do some basic audio processing entirely on the client-side, in-browser. I want users to select a short time range (say, no more than 2mins) anywhere in the audio and post-process the fragment to create short clips with fancy waveform visualization. This is a good example of what we want to achieve.
After spending a good amount of time looking at Web APIs, Webaudio APIs, FFmpeg WASM port (20MB+ in size + licensing issues), I am running into the following problems:
OfflineAudioContext
and customScriptProcessorNode
.audio
tag orHTMLElementNode
. However,audio
tag orHTMLElementNode
doesn't allow for batch processing withOfflineAudioContext
, your can only process audio in a streaming fashion usingAudioContext
.The crux of the problem is that is it not possible to programmatically fetch (based on user input) media fragments with XHR or fetch API. One can use client-side FFmpeg WASM port for this, however large library size disqualifies it for this project.
Please note that the servers serving the audio files do accept
Range
header (think of most of the podcast mp3 hosts).Does this project solve the problem of downloading media fragments?
Thanks!