Skip to content

emscripten: add audio output module

Mehdi Sabwat requested to merge aout.em/2 into master

The module currently has a dependency, it is integrated when linking by adding --js-library vlc/module/audio_output/webaudio/webaudio.js

The webaudio api will create a graph with one audio worklet node. It will write audio buffers into a ring buffer, the audio worklet then reads from the ring buffer, and can be controlled with sab->can_write / sab->is_paused via shared memory.

Even thought sometimes the browser (in some browsers, Windows for eg.) can upmix despite the AudioContext.destination configuration, the way it works is it will try to set the sample rate and channels from the mediafile, and fallback to the maximum supported settings depending on the browser configuration.

Missing: (?)

  • do the format conversion instead of letting vlc do it
  • add function to delay playing a sample
  • is it possible to add filters?

(WIP: two patches are needed, to allow linking without errors)

Edited by Mehdi Sabwat

Merge request reports