Comparing version 8.1.0 to 8.1.1
# CHANGELOG | ||
## version 8.1.1 (2018-07-04) | ||
- Fix documentation issues. | ||
## version 8.1.0 (2018-07-04) | ||
@@ -4,0 +7,0 @@ - Add CLI to manipulate wave files from the command line. |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
# Distribution | ||
This library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. | ||
This library is a ES module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. | ||
@@ -8,3 +8,3 @@ ## If you are using this lib in a browser: | ||
[unpkg](https://www.unpkg.com): | ||
[unpkg](https://unpkg.com/wavefile): | ||
```html | ||
@@ -14,3 +14,3 @@ <script src="https://unpkg.com/wavefile"></script> | ||
[jsDelivr](https://www.jsdelivr.com): | ||
[jsDelivr](https://cdn.jsdelivr.net/npm/wavefile): | ||
```html | ||
@@ -17,0 +17,0 @@ <script src="https://cdn.jsdelivr.net/npm/wavefile"></script> |
{ | ||
"name": "wavefile", | ||
"version": "8.1.0", | ||
"version": "8.1.1", | ||
"description": "Read and write huge .wav files.", | ||
@@ -27,5 +27,2 @@ "homepage": "https://github.com/rochars/wavefile", | ||
"audio", | ||
"read", | ||
"write", | ||
"create", | ||
"8-bit", | ||
@@ -43,11 +40,4 @@ "11-bit", | ||
"decode", | ||
"compander", | ||
"A-Law", | ||
"mu-Law", | ||
"cue", | ||
"smpl", | ||
"ltxt", | ||
"bext", | ||
"LIST", | ||
"INFO" | ||
"mu-Law" | ||
], | ||
@@ -66,7 +56,7 @@ "repository": { | ||
"lint": "jshint index.js externs.js cli.js", | ||
"test": "nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=120000", | ||
"test-esm": "nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=120000", | ||
"test-min": "node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=120000", | ||
"test-cjs": "node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=120000", | ||
"test-umd": "node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=120000", | ||
"test": "nyc --require=esm ./node_modules/mocha/bin/_mocha test --recursive -R dot --timeout=240000", | ||
"test-esm": "nyc ./node_modules/mocha/bin/_mocha test --esm --require=esm --recursive -R dot --timeout=240000", | ||
"test-min": "node ./node_modules/mocha/bin/_mocha test --min --recursive -R dot --timeout=240000", | ||
"test-cjs": "node ./node_modules/mocha/bin/_mocha test --cjs --recursive -R dot --timeout=240000", | ||
"test-umd": "node ./node_modules/mocha/bin/_mocha test --umd --recursive -R dot --timeout=240000", | ||
"test-cli": "wavefile ./test/files/M1F1-int12WE-AFsp.wav --tag=ICMT", | ||
@@ -73,0 +63,0 @@ "test-dist": "npm run test-min && npm run test-esm && npm run test-cjs && npm run test-umd && npm run test-cli", |
302
README.md
@@ -10,7 +10,7 @@ # wavefile | ||
- **Works out of the box in the browser** | ||
- **Works out of the box in Node** | ||
- **Works out of the box with TypeScript** | ||
- **Works with huge wave files** | ||
- **Works as a command line tool** | ||
- **Use it out of the box in the browser** | ||
- **Use it out of the box in Node** | ||
- **Use it out of the box with TypeScript** | ||
- **Handle wave files up to 2GB** | ||
- **Use it as a command line tool** | ||
- Create wave files from scratch | ||
@@ -24,3 +24,3 @@ - Read and write tags on .wav files | ||
- **All MIT-licensed** | ||
- Less than 10kb minified + compressed, less than 32kb minified | ||
- **Less than 10kb minified + compressed, less than 32kb minified** | ||
- Made with Closure Compiler in mind (works great with others, too) | ||
@@ -30,31 +30,2 @@ | ||
## Table of Contents | ||
- [Install](#install) | ||
- [Use](#use) | ||
- [See it in action](#see-it-in-action) | ||
- [Example](#example) | ||
- [Operation Manual](#operation-manual) | ||
* [Create wave files from scratch](#create-wave-files-from-scratch) | ||
* [Add RIFF tags to files](#add-riff-tags-to-files) | ||
* [Add cue points to files](#add-cue-points-to-files) | ||
* [RIFX](#rifx) | ||
* [IMA-ADPCM](#ima-adpcm) | ||
* [A-Law](#a-law) | ||
* [mu-Law](#mu-law) | ||
* [Change the bit depth](#change-the-bit-depth) | ||
* [Add BWF metadata](#add-bwf-metadata) | ||
* [RF64](#rf64) | ||
* [Command line interface](#cli-usage) | ||
- [API](#api) | ||
* [The WaveFile methods:](#the-wavefile-methods-) | ||
* [The WaveFile properties](#the-wavefile-properties) | ||
+ [Cue points](#cue-points) | ||
+ [Sample loops](#sample-loops) | ||
+ [LIST chunk](#list-chunk) | ||
- [The samples](#the-samples) | ||
- [Distribution](#distribution) | ||
- [Contributing to wavefile](#contributing-to-wavefile) | ||
- [References](#references) | ||
- [Legal](#legal) | ||
## Install | ||
@@ -79,9 +50,2 @@ To use it in your programs: | ||
### ES6 | ||
import WaveFile from **wavefile.js**: | ||
```javascript | ||
import WaveFile from 'wavefile.js'; | ||
let wav = new WaveFile(); | ||
``` | ||
### Node | ||
@@ -100,6 +64,13 @@ Require WaveFile from **wavefile**: | ||
### ES module | ||
import WaveFile from **wavefile.js**: | ||
```javascript | ||
import WaveFile from './dist/wavefile.js'; | ||
let wav = new WaveFile(); | ||
``` | ||
### Browser | ||
Use the compiled file in the */dist* folder: | ||
```html | ||
<script src="wavefile.min.js"></script> | ||
<script src="./dist/wavefile.min.js"></script> | ||
<script> | ||
@@ -110,3 +81,3 @@ var WaveFile = new WaveFile(); | ||
Or get it from the [jsDelivr](https://www.jsdelivr.com) CDN: | ||
Or get it from the [jsDelivr](https://cdn.jsdelivr.net/npm/wavefile) CDN: | ||
```html | ||
@@ -116,3 +87,3 @@ <script src="https://cdn.jsdelivr.net/npm/wavefile"></script> | ||
Or get it from [unpkg](https://www.unpkg.com): | ||
Or get it from [unpkg](https://unpkg.com/wavefile): | ||
```html | ||
@@ -133,2 +104,31 @@ <script src="https://unpkg.com/wavefile"></script> | ||
## Table of Contents | ||
- [Install](#install) | ||
- [Use](#use) | ||
- [See it in action](#see-it-in-action) | ||
- [Example](#example) | ||
- [Operation Manual](#operation-manual) | ||
* [Create wave files from scratch](#create-wave-files-from-scratch) | ||
* [Add RIFF tags to files](#add-riff-tags-to-files) | ||
* [Add cue points to files](#add-cue-points-to-files) | ||
* [RIFX](#rifx) | ||
* [IMA-ADPCM](#ima-adpcm) | ||
* [A-Law](#a-law) | ||
* [mu-Law](#mu-law) | ||
* [Change the bit depth](#change-the-bit-depth) | ||
* [Add BWF metadata](#add-bwf-metadata) | ||
* [RF64](#rf64) | ||
* [Command line interface](#cli-usage) | ||
- [API](#api) | ||
* [The WaveFile methods:](#the-wavefile-methods-) | ||
* [The WaveFile properties](#the-wavefile-properties) | ||
+ [Cue points](#cue-points) | ||
+ [Sample loops](#sample-loops) | ||
+ [LIST chunk](#list-chunk) | ||
- [The samples](#the-samples) | ||
- [Distribution](#distribution) | ||
- [Contributing to wavefile](#contributing-to-wavefile) | ||
- [References](#references) | ||
- [Legal](#legal) | ||
## See it in action | ||
@@ -479,3 +479,3 @@ | ||
*/ | ||
WaveFile.fromIMAADPCM(bitDepth="16") {} | ||
WaveFile.fromIMAADPCM(bitDepth='16') {} | ||
@@ -493,3 +493,3 @@ /** | ||
*/ | ||
WaveFile.fromALaw(bitDepth="16") {} | ||
WaveFile.fromALaw(bitDepth='16') {} | ||
@@ -507,3 +507,3 @@ /** | ||
*/ | ||
WaveFile.fromMuLaw(bitDepth="16") {} | ||
WaveFile.fromMuLaw(bitDepth='16') {} | ||
@@ -538,3 +538,3 @@ /** | ||
*/ | ||
WaveFile.setCuePoint(position, labl="") {} | ||
WaveFile.setCuePoint(position, labl='') {} | ||
@@ -563,3 +563,3 @@ /** | ||
*/ | ||
WaveFile.container = ""; | ||
WaveFile.container = ''; | ||
/** | ||
@@ -571,6 +571,6 @@ * @type {number} | ||
* The format. | ||
* Always "WAVE". | ||
* Always 'WAVE'. | ||
* @type {string} | ||
*/ | ||
WaveFile.format = ""; | ||
WaveFile.format = ''; | ||
/** | ||
@@ -582,23 +582,23 @@ * The data of the "fmt" chunk. | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {number} */ | ||
"audioFormat": 0, | ||
audioFormat: 0, | ||
/** @export @type {number} */ | ||
"numChannels": 0, | ||
numChannels: 0, | ||
/** @export @type {number} */ | ||
"sampleRate": 0, | ||
sampleRate: 0, | ||
/** @export @type {number} */ | ||
"byteRate": 0, | ||
byteRate: 0, | ||
/** @export @type {number} */ | ||
"blockAlign": 0, | ||
blockAlign: 0, | ||
/** @export @type {number} */ | ||
"bitsPerSample": 0, | ||
bitsPerSample: 0, | ||
/** @export @type {number} */ | ||
"cbSize": 0, | ||
cbSize: 0, | ||
/** @export @type {number} */ | ||
"validBitsPerSample": 0, | ||
validBitsPerSample: 0, | ||
/** @export @type {number} */ | ||
"dwChannelMask": 0, | ||
dwChannelMask: 0, | ||
/** | ||
@@ -608,3 +608,3 @@ * 4 32-bit values representing a 128-bit ID | ||
*/ | ||
"subformat": [] | ||
subformat: [] | ||
}; | ||
@@ -617,7 +617,7 @@ /** | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {number} */ | ||
"dwSampleLength": 0 | ||
dwSampleLength: 0 | ||
}; | ||
@@ -630,9 +630,9 @@ /** | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {number} */ | ||
"dwCuePoints": 0, | ||
dwCuePoints: 0, | ||
/** @export @type {!Array<!Object>} */ | ||
"points": [], | ||
points: [], | ||
}; | ||
@@ -645,25 +645,25 @@ /** | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {number} */ | ||
"dwManufacturer": 0, | ||
dwManufacturer: 0, | ||
/** @export @type {number} */ | ||
"dwProduct": 0, | ||
dwProduct: 0, | ||
/** @export @type {number} */ | ||
"dwSamplePeriod": 0, | ||
dwSamplePeriod: 0, | ||
/** @export @type {number} */ | ||
"dwMIDIUnityNote": 0, | ||
dwMIDIUnityNote: 0, | ||
/** @export @type {number} */ | ||
"dwMIDIPitchFraction": 0, | ||
dwMIDIPitchFraction: 0, | ||
/** @export @type {number} */ | ||
"dwSMPTEFormat": 0, | ||
dwSMPTEFormat: 0, | ||
/** @export @type {number} */ | ||
"dwSMPTEOffset": 0, | ||
dwSMPTEOffset: 0, | ||
/** @export @type {number} */ | ||
"dwNumSampleLoops": 0, | ||
dwNumSampleLoops: 0, | ||
/** @export @type {number} */ | ||
"dwSamplerData": 0, | ||
dwSamplerData: 0, | ||
/** @export @type {!Array<!Object>} */ | ||
"loops": [], | ||
loops: [], | ||
}; | ||
@@ -676,15 +676,15 @@ /** | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {string} */ | ||
"description": "", //256 | ||
description: '', //256 | ||
/** @export @type {string} */ | ||
"originator": "", //32 | ||
originator: '', //32 | ||
/** @export @type {string} */ | ||
"originatorReference": "", //32 | ||
originatorReference: '', //32 | ||
/** @export @type {string} */ | ||
"originationDate": "", //10 | ||
originationDate: '', //10 | ||
/** @export @type {string} */ | ||
"originationTime": "", //8 | ||
originationTime: '', //8 | ||
/** | ||
@@ -694,21 +694,21 @@ * 2 32-bit values, timeReference high and low | ||
*/ | ||
"timeReference": [0, 0], | ||
timeReference: [0, 0], | ||
/** @export @type {number} */ | ||
"version": 0, //WORD | ||
version: 0, //WORD | ||
/** @export @type {string} */ | ||
"UMID": "", // 64 chars | ||
UMID: '', // 64 chars | ||
/** @export @type {number} */ | ||
"loudnessValue": 0, //WORD | ||
loudnessValue: 0, //WORD | ||
/** @export @type {number} */ | ||
"loudnessRange": 0, //WORD | ||
loudnessRange: 0, //WORD | ||
/** @export @type {number} */ | ||
"maxTruePeakLevel": 0, //WORD | ||
maxTruePeakLevel: 0, //WORD | ||
/** @export @type {number} */ | ||
"maxMomentaryLoudness": 0, //WORD | ||
maxMomentaryLoudness: 0, //WORD | ||
/** @export @type {number} */ | ||
"maxShortTermLoudness": 0, //WORD | ||
maxShortTermLoudness: 0, //WORD | ||
/** @export @type {string} */ | ||
"reserved": "", //180 | ||
reserved: '', //180 | ||
/** @export @type {string} */ | ||
"codingHistory": "" // string, unlimited | ||
codingHistory: '' // string, unlimited | ||
}; | ||
@@ -722,19 +722,19 @@ /** | ||
/** @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {number} */ | ||
"riffSizeHigh": 0, // DWORD | ||
riffSizeHigh: 0, // DWORD | ||
/** @export @type {number} */ | ||
"riffSizeLow": 0, // DWORD | ||
riffSizeLow: 0, // DWORD | ||
/** @export @type {number} */ | ||
"dataSizeHigh": 0, // DWORD | ||
dataSizeHigh: 0, // DWORD | ||
/** @export @type {number} */ | ||
"dataSizeLow": 0, // DWORD | ||
dataSizeLow: 0, // DWORD | ||
/** @export @type {number} */ | ||
"originationTime": 0, // DWORD | ||
originationTime: 0, // DWORD | ||
/** @export @type {number} */ | ||
"sampleCountHigh": 0, // DWORD | ||
sampleCountHigh: 0, // DWORD | ||
/** @export @type {number} */ | ||
"sampleCountLow": 0, // DWORD | ||
sampleCountLow: 0, // DWORD | ||
/** @export @type {number} */ | ||
@@ -751,16 +751,16 @@ //"tableLength": 0, // DWORD | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {!Uint8Array} */ | ||
"samples": new Uint8Array(0) | ||
samples: new Uint8Array(0) | ||
}; | ||
/** | ||
* The data of the "LIST" chunks. | ||
* Each item in this list must have this signature: | ||
* Each item in this list look like this: | ||
* { | ||
* "chunkId": "", | ||
* "chunkSize": 0, | ||
* "format": "", | ||
* "subChunks": [] | ||
* chunkId: '', | ||
* chunkSize: 0, | ||
* format: '', | ||
* subChunks: [] | ||
* } | ||
@@ -776,7 +776,7 @@ * @type {!Array<!Object>} | ||
/** @export @type {string} */ | ||
"chunkId": "", | ||
chunkId: '', | ||
/** @export @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @export @type {!Array<number>} */ | ||
"chunkData": [] | ||
chunkData: [] | ||
}; | ||
@@ -787,3 +787,3 @@ /** | ||
*/ | ||
WaveFile.bitDepth = ""; | ||
WaveFile.bitDepth = ''; | ||
``` | ||
@@ -795,8 +795,14 @@ | ||
{ | ||
"dwName": 0, // a cue point ID | ||
"dwPosition": 0, | ||
"fccChunk": 0, | ||
"dwChunkStart": 0, | ||
"dwBlockStart": 0, | ||
"dwSampleOffset": 0, | ||
/** @type {number} */ | ||
dwName: 0, // a cue point ID | ||
/** @type {number} */ | ||
dwPosition: 0, | ||
/** @type {number} */ | ||
fccChunk: 0, | ||
/** @type {number} */ | ||
dwChunkStart: 0, | ||
/** @type {number} */ | ||
dwBlockStart: 0, | ||
/** @type {number} */ | ||
dwSampleOffset: 0 | ||
} | ||
@@ -809,8 +815,14 @@ ``` | ||
{ | ||
"dwName": "", // a cue point ID | ||
"dwType": 0, | ||
"dwStart": 0, | ||
"dwEnd": 0, | ||
"dwFraction": 0, | ||
"dwPlayCount": 0, | ||
/** @type {string} */ | ||
dwName: '', // a cue point ID | ||
/** @type {number} */ | ||
dwType: 0, | ||
/** @type {number} */ | ||
dwStart: 0, | ||
/** @type {number} */ | ||
dwEnd: 0, | ||
/** @type {number} */ | ||
dwFraction: 0, | ||
/** @type {number} */ | ||
dwPlayCount: 0 | ||
} | ||
@@ -829,13 +841,13 @@ ``` | ||
*WaveFile.LIST* is an array of objects with this signature: | ||
Items in *WaveFile.LIST* are objects that look like this: | ||
```javascript | ||
{ | ||
/** @type {string} */ | ||
"chunkId": "", // always 'LIST' | ||
chunkId: '', // always 'LIST' | ||
/** @type {number} */ | ||
"chunkSize": 0, | ||
chunkSize: 0, | ||
/** @type {string} */ | ||
"format": "", // 'adtl' or 'INFO' | ||
format: '', // 'adtl' or 'INFO' | ||
/** @type {!Array<!Object>} */ | ||
"subChunks": [] | ||
subChunks: [] | ||
}; | ||
@@ -845,11 +857,11 @@ ``` | ||
For "LIST" chunks with the "INFO" format, "subChunks" will be an array of objects with this signature: | ||
For "LIST" chunks with the "INFO" format, "subChunks" will be an array of objects like this: | ||
```javascript | ||
{ | ||
/** @type {string} */ | ||
"chunkId": "" // some RIFF tag | ||
chunkId: '', // some RIFF tag | ||
/** @type {number} */ | ||
"chunkSize" 0, | ||
chunkSize 0, | ||
/** @type {string} */ | ||
"value": "" | ||
value: '' | ||
} | ||
@@ -871,3 +883,3 @@ ``` | ||
## Distribution | ||
This library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. | ||
This library is a ES module also distributed as a CommonJS module, UMD module and a compiled script for browsers. It works out of the box in Node when installed with ```npm install wavefile```. | ||
@@ -878,3 +890,3 @@ ### If you are using this lib in a browser: | ||
[unpkg](https://www.unpkg.com): | ||
[unpkg](https://unpkg.com/wavefile): | ||
```html | ||
@@ -884,3 +896,3 @@ <script src="https://unpkg.com/wavefile"></script> | ||
[jsDelivr](https://www.jsdelivr.com): | ||
[jsDelivr](https://cdn.jsdelivr.net/npm/wavefile): | ||
```html | ||
@@ -887,0 +899,0 @@ <script src="https://cdn.jsdelivr.net/npm/wavefile"></script> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
942
517762