Encode WAV [or raw PCM data] to WebM in JavaScript?

526 Views Asked by At

BH

I'm trying to make a basic audio editor / cutter and exporter with native JavaScript, so far I have been able to read the raw PCM data of input audio files using AudioContext.deocdeAudio, as well as export as a WAV, but I want to compress it, since a two minute video is around 10mb...

I've been trying to cexport to mp3 using lamejs, but th emscripten version is very slow, and plus there are many copyright issues with mp3, so I want to export it as a webm audio, and / or add it to a webm video. [If a webm video is written with only audio, it plays as audio in the browser anyways, so I can deal with that].

Problem is, is that outside of the MediaRecorder [which is unreliable with exact timing] I haven't been able to find any JavaScript solutions that write a WebM audio file directly [although I was able to find some WebM video writers in pure JavaScript]

I have found vorbis which seems to be able to encode audio with a WebM container, but I haven't found any native JavaScript versions of it

I would use webm-muxer.js but its not supported on my chromebook, and want to use a way thats more widely supported

0

There are 0 best solutions below