2

I am trying to leverage the vast numbers of audio filters that FFMPEG has and see if I can use them directly in a custom AudioWorklet so I dont have to reinvent the wheel for each and every filter. One option I came across was to convert the AVFilter library to WASM and write a wrapper class to call the library functions. https://dev.to/alfg/ffmpeg-webassembly-2cbl

But I am looking for a solution where the data can be piped to the filter and the output passed instantaneously to the other audio worklet nodes so the effect can be heard without a delay.

Any kind of help would be highly appreciated.

1 Answers1

1

Have a look at Audio Worklet Design Pattern. The FFMPEG modules would be compiled to WebAssembly modules, and the AudioWorklet could communicate directly with the WASM modules, ideally through a SharedArrayBuffer for low-latency audio processing.

For browsers that don't support SharedArrayBuffer, MessagePort.postMessage() could be used, passing the Transferrable ArrayBuffers.

anthumchris
  • 8,245
  • 2
  • 28
  • 53