audiobuffer-arraybuffer-serializer
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 = Encoder;const Decoder = Decoder;
Browser
Usage
Classes
- Encoder
- Serialize AudioBuffer to ArrayBuffer.
- Decoder
- Deserialize ArrayBuffer to AudioBuffer.
Constructor
Set littleEndian
If you want to use specified byte order
// Little endian(default)let encoder = ;let decoder = ;// Little endianlet encoder = littleEndian: true ;let decoder = littleEndian: true ;// Big endianlet encoder = littleEndian: false ;let decoder = littleEndian: false ;
Encode/Docode AudioBuffer/ArrayBuffer to ArrayBuffer/AudioBuffer
Simple encode/decode
let arrayBuffer = encoder;let audioBuffer = decoder;
Set decoded result into destination buffer.
encoder;decoder;
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-devopen ./coverage/lcov-report/index.html
For | Built file |
---|---|
node.js | ./main.js |
browser | ./aas.js |
Version up
npm version patchgit push origin --tags
Browser test
npm run test-report-devopen test/index.html
Supported browser
|Chrome|Firefox|