Skip to content

Commit

Permalink
BWF support
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Apr 25, 2018
1 parent 200a7f2 commit c049889
Show file tree
Hide file tree
Showing 15 changed files with 1,887 additions and 2,777 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ With **wavefile** you can:

And more.

**wavefile** is extensively tested, and the test folder contains samples of all supported formats. Please note that some formats (like 8-bit A-Law and 64-bit floating point) are not widely supported and may not load in every player.
**wavefile** is extensively tested and contains samples of all supported formats. Please note that some formats (like 8-bit A-Law and 64-bit floating point) are not widely supported and may not load in every player.

## Install
```
Expand Down Expand Up @@ -190,6 +190,9 @@ console.log(wav.factChunkId);
console.log(wav.factChunkSize);
console.log(wav.dwSampleLength);

// "bext"
console.log(wav.bextChunkFields);

// "data"
console.log(wav.dataChunkId);
console.log(wav.dataChunkSize);
Expand All @@ -198,6 +201,29 @@ console.log(wav.dataChunkSize);
console.log(wav.samples);
```

### BWF data
BWF data ("bext" chunk) is stored in the *bextChunkFields* property in human-readable form.
You may edit the data in the "bext" chunk by editing the *bextChunkFields* property on a WaveFile object.
```javascript
wav.bextChunkFields = {
"description": "", // 256 chars
"originator": "", // 32 chars
"originatorReference": "", // 32 chars
"originationDate": "", // 10 chars
"originationTime": "", // 8 chars
"timeReference": "", // 64-bit value kept as an array of 8 bytes
"version": "", // 16-bit number
"UMID": "", // 64 chars
"loudnessValue": "", // 16-bit number
"loudnessRange": "", // 16-bit number
"maxTruePeakLevel": "", // 16-bit number
"maxMomentaryLoudness": "", // 16-bit number
"maxShortTermLoudness": "", // 16-bit number
"reserved": "", // 180 chars
"codingHistory": "" // string, unlimited size
};
```

### The samples
Range:
- 0 to 255 for 8-bit
Expand Down
159 changes: 72 additions & 87 deletions dist/wavefile-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit c049889

Please sign in to comment.