audiobuffer-arraybuffer-serializer

0.0.36 • Public • Published

audiobuffer-arraybuffer-serializer

npm

CircleCI

AudioBuffer serializer. Provide a serializer between AudioBuffer and ArrayBuffer.

About ArrayBuffer representation of AudioBuffer see.

Installation

Node.js

npm install audiobuffer-arraybuffer-serializer
const Encoder = require('audiobuffer-arraybuffer-serializer').Encoder;
const Decoder = require('audiobuffer-arraybuffer-serializer').Decoder;

Browser

<script src="aas.js"></script>
<script>
  let encoder = new aas.Encoder();
</script> 

Usage

API Reference

Classes

Constructor

Set littleEndian If you want to use specified byte order

// Little endian(default)
let encoder = new Encoder();
let decoder = new Decoder();
// Little endian
let encoder = new Encoder({ littleEndian: true });
let decoder = new Decoder({ littleEndian: true });
// Big endian
let encoder = new Encoder({ littleEndian: false });
let decoder = new Decoder({ littleEndian: false });

Encode/Docode AudioBuffer/ArrayBuffer to ArrayBuffer/AudioBuffer

Simple encode/decode

let arrayBuffer = encoder.execute(audioBuffer);
let audioBuffer = decoder.execute(arrayBuffer);

Set decoded result into destination buffer.

encoder.execute(audioBuffer, arrayBuffer);
decoder.execute(arrayBuffer, audioBuffer);

Examples

Development

Build environment

npm install

Build distributed javascript file(Run unit test)

npm run test-report-dev

Show coverage report

npm run test-browser-dev
open ./coverage/lcov-report/index.html
For Built file
node.js ./main.js
browser ./aas.js

Version up

npm version patch
git push origin --tags

Browser test

npm run test-report-dev
open test/index.html

Supported browser

|Chrome|Firefox|

Package Sidebar

Install

npm i audiobuffer-arraybuffer-serializer

Weekly Downloads

18

Version

0.0.36

License

MIT

Last publish

Collaborators

  • suzuito