@mediabunny/truehd
Browsers have no support for the Dolby TrueHD audio codec in their WebCodecs implementations. This extension package provides both a decoder and encoder for use with Mediabunny, allowing you to decode and encode this codec directly in the browser. It is implemented using Mediabunny's custom coder API and uses a fast, size-optimized WASM build of FFmpeg's TrueHD coders under the hood.
GitHub pageInstallation
This library peer-depends on Mediabunny. Install both using npm:
npm install mediabunny @mediabunny/truehdAlternatively, directly include them using a script tag:
<script src="mediabunny.js"></script>
<script src="mediabunny-truehd.js"></script>This will expose the global objects Mediabunny and MediabunnyTrueHd. Use mediabunny-truehd.d.ts to provide types for these globals. You can download the built distribution files from the releases page.
Usage
import { registerTrueHdDecoder, registerTrueHdEncoder } from '@mediabunny/truehd';
registerTrueHdDecoder();
registerTrueHdEncoder();That's it - Mediabunny now uses the registered TrueHD decoder and encoder automatically.