Get started with aurora.js-flac CDN

LGPL licensed

Aurora.js-FLAC is a library for decoding FLAC audio files.

Tags:
  • audio
  • av
  • aurora.js
  • aurora
  • decode

Stable version

Copied!

How to start using aurora.js-flac CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with aurora.js-flac CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/aurora.js-flac/0.2.1/flac.min.js"></script>
</head>
<body>
  <script>
    async function decodeFLAC() {
      const data = await fetch('path/to/your/flac-file.data').arrayBuffer();
      const decoder = new FLACDecoder();
      const decodedData = await decoder.decodeBuffer(data);
      const decodedArrayBuffer = decoder.decodeToArrayBuffer(decodedData);
      const audioContext = new AudioContext();
      const decodedAudioBuffer = await audioContext.decodeAudioData(decodedArrayBuffer);
      const source = audioContext.createBufferSource();
      source.buffer = decodedAudioBuffer;
      source.connect(audioContext.destination);
      source.start();
    }

    decodeFLAC();
  </script>
</body>
</html>
Copied!
Copied!

All versions