Skip to content

hazelmeow/wasm-opus-transcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasm Opus Transcoder

This library transcodes audio files to OGG Opus in the browser using WASM. It also provides some other WASM-compatible utilities for hashing bytes and converting embedded cover arts.

Encoding to Opus uses unsafe-libopus and this patch (actually my fork) for opus-rs. Then we glue that together with Symphonia for audio decoding, Rubato for resampling, and ogg. You can see this in transcoder/.

transcoder-wasm/ is a simple wrapper that provides JS bindings which gets compiled with wasm-pack.

There's a Svelte demo in transcoder-demo/. The transcoding is done in a web worker that comunicates with the UI to prevent it from blocking the page while it's working. You can try it online here.