Skip to content

A javascript library that enables encoding and decoding of audio with Lyra, a neural audio codec.

License

Notifications You must be signed in to change notification settings

neuvideo/lyra-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lyra-js

A Webassembly/Javascript port of Lyra, a neural audio codec from Google. It enables audio encoding and decoding with Lyra on web browsers.

Installation.

NPM

npm install lyra-codec --save
import {encodeWithLyra, decodeWithLyra, isLyraReady} from 'lyra-codec'

UNPKG

import {encodeWithLyra, decodeWithLyra, isLyraReady} from 'https://unpkg.com/lyra-codec/dist/lyra_bundle.js'

Usage

if (isLyraReady()) {
  // Encode with Lyra codec.
  const rawAudio = new Float32Array(...);
  const encodedAudio = encodeWithLyra(audioArray, kSampleRate);

  const decoded = decodeWithLyra(encodedAudio, kSampleRate, rawAudio.length);
} else {
  ...
}

Example

See Lyra on webassembly for a demo of lyra-js in action, and Playing with Lyra on how to use it for webrtc.

About

A javascript library that enables encoding and decoding of audio with Lyra, a neural audio codec.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published