0.2.1 • Published 4 years ago

pa-opus-audio v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

@japj/pa-opus-audio Build NPM

pa-opus-audio is a Node.js native addon for low latency PortAudio/Opus Audio Recording and Playback.

NOTE: Work in progress, see also Changelog and Current Issues

This is part of the "rehearse20" project.

Example

import { PoaInput, PoaOutput } from 'pa-opus-audio';

const input = new PoaInput();
const output = new PoaOutput();

input.setEncodedFrameAvailableCallback(function (b: Buffer) {
    if (b) {
        output.decodeAndPlay(b);
    }
});

output.initStartPlayback();
input.initStartRecord();

console.log('Recording and Playback from default OS devices');
setTimeout(function () {
    input.stopRecord();
    output.stopPlayback();
    console.log('... long wait for exiting this program');
    process.exit(0);
}, 5000);

Platform support

  • macOS x64
  • Linux x64
  • Windows x64