So there are a lot of suggestions about Emscripten but nobody did, so I ported the encoder opus-tools to JavaScript using Emscripten. Dependent on what one has in mind, there are now the following opportunities:
- Encoding FLAC, WAVE, AIFF, RAW files || demo || Web Worker size: 1.3 MiB
- Encoding raw stuff for immediately processing or sending without container || demo || Web Worker size: 0.6 MiB
- Encoding to Ogg-Opus and WAV from
getUserMedia
stream - When using Mozilla Firefox, it's possible to use a
MediaRecorder
, which would also allow to convert arbitrary sound files into Opus format on supported platforms together withAudioContext.decodeAudioData()