Skip to content

Commit

Permalink
fixed bextChunkFields signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Apr 25, 2018
1 parent c049889 commit 7824b2d
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 141 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ With **wavefile** you can:
- Encode/decode files as ADPCM, A-Law and mu-Law
- Read/write the data in a wav file header
- Turn RIFF files to RIFX and RIFX files to RIFF
- Edit BWF metada ("bext" chunk)

And more.

Expand Down Expand Up @@ -203,7 +204,6 @@ 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
Expand Down
143 changes: 74 additions & 69 deletions dist/wavefile-min.js

Large diffs are not rendered by default.

115 changes: 56 additions & 59 deletions dist/wavefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@

/*!
* byte-data
* Readable data to and from byte buffers.
* Copyright (c) 2017 Rafael da Silva Rocha.
* Read and write data to and from byte buffers.
* Copyright (c) 2017-2018 Rafael da Silva Rocha.
* https://github.com/rochars/byte-data
*
*/

/** @private */
const rw = __webpack_require__(7);
let Type = __webpack_require__(1);
const Type = __webpack_require__(1);

/**
* Turn a number or fixed-length string into a byte buffer.
Expand Down Expand Up @@ -226,198 +226,198 @@ function getStructDefSize(def) {
}

// interface
exports.pack = pack;
exports.unpack = unpack;
exports.packArray = packArray;
exports.unpackArray = unpackArray;
exports.unpackStruct = unpackStruct;
exports.packStruct = packStruct;
exports.findString = findString;
exports.Type = Type;
module.exports.pack = pack;
module.exports.unpack = unpack;
module.exports.packArray = packArray;
module.exports.unpackArray = unpackArray;
module.exports.unpackStruct = unpackStruct;
module.exports.packStruct = packStruct;
module.exports.findString = findString;
module.exports.Type = Type;
/**
* A char.
* @type {Object}
*/
exports.chr = new Type({"bits": 8, "char": true});
module.exports.chr = new Type({"bits": 8, "char": true});
/**
* A 4-char string
* @type {Object}
*/
exports.fourCC = new Type({"bits": 32, "char": true});
module.exports.fourCC = new Type({"bits": 32, "char": true});
/**
* Booleans
* @type {Object}
*/
exports.bool = new Type({"bits": 1});
module.exports.bool = new Type({"bits": 1});
/**
* Signed 2-bit integers
* @type {Object}
*/
exports.int2 = new Type({"bits": 2, "signed": true});
module.exports.int2 = new Type({"bits": 2, "signed": true});
/**
* Unsigned 2-bit integers
* @type {Object}
*/
exports.uInt2 = new Type({"bits": 2});
module.exports.uInt2 = new Type({"bits": 2});
/**
* Signed 4-bit integers
* @type {Object}
*/
exports.int4 = new Type({"bits": 4, "signed": true});
module.exports.int4 = new Type({"bits": 4, "signed": true});
/**
* Unsigned 4-bit integers
* @type {Object}
*/
exports.uInt4 = new Type({"bits": 4});
module.exports.uInt4 = new Type({"bits": 4});
/**
* Signed 8-bit integers
* @type {Object}
*/
exports.int8 = new Type({"bits": 8, "signed": true});
module.exports.int8 = new Type({"bits": 8, "signed": true});
/**
* Unsigned 4-bit integers
* @type {Object}
*/
exports.uInt8 = new Type({"bits": 8});
module.exports.uInt8 = new Type({"bits": 8});
// LE
/**
* Signed 16-bit integers little-endian
* @type {Object}
*/
exports.int16 = new Type({"bits": 16, "signed": true});
module.exports.int16 = new Type({"bits": 16, "signed": true});
/**
* Unsigned 16-bit integers little-endian
* @type {Object}
*/
exports.uInt16 = new Type({"bits": 16});
module.exports.uInt16 = new Type({"bits": 16});
/**
* Half-precision floating-point numbers little-endian
* @type {Object}
*/
exports.float16 = new Type({"bits": 16, "float": true});
module.exports.float16 = new Type({"bits": 16, "float": true});
/**
* Signed 24-bit integers little-endian
* @type {Object}
*/
exports.int24 = new Type({"bits": 24, "signed": true});
module.exports.int24 = new Type({"bits": 24, "signed": true});
/**
* Unsigned 24-bit integers little-endian
* @type {Object}
*/
exports.uInt24 = new Type({"bits": 24});
module.exports.uInt24 = new Type({"bits": 24});
/**
* Signed 32-bit integers little-endian
* @type {Object}
*/
exports.int32 = new Type({"bits": 32, "signed": true});
module.exports.int32 = new Type({"bits": 32, "signed": true});
/**
* Unsigned 32-bit integers little-endian
* @type {Object}
*/
exports.uInt32 = new Type({"bits": 32});
module.exports.uInt32 = new Type({"bits": 32});
/**
* Single-precision floating-point numbers little-endian
* @type {Object}
*/
exports.float32 = new Type({"bits": 32, "float": true});
module.exports.float32 = new Type({"bits": 32, "float": true});
/**
* Signed 40-bit integers little-endian
* @type {Object}
*/
exports.int40 = new Type({"bits": 40, "signed": true});
module.exports.int40 = new Type({"bits": 40, "signed": true});
/**
* Unsigned 40-bit integers little-endian
* @type {Object}
*/
exports.uInt40 = new Type({"bits": 40});
module.exports.uInt40 = new Type({"bits": 40});
/**
* Signed 48-bit integers little-endian
* @type {Object}
*/
exports.int48 = new Type({"bits": 48, "signed": true});
module.exports.int48 = new Type({"bits": 48, "signed": true});
/**
* Unsigned 48-bit integers little-endian
* @type {Object}
*/
exports.uInt48 = new Type({"bits": 48});
module.exports.uInt48 = new Type({"bits": 48});
/**
* Double-precision floating-point numbers little-endian
* @type {Object}
*/
exports.float64 = new Type({"bits": 64, "float": true});
module.exports.float64 = new Type({"bits": 64, "float": true});
// BE
/**
* Signed 16-bit integers big-endian
* @type {Object}
*/
exports.int16BE = new Type({"bits": 16, "signed": true, "be": true});
module.exports.int16BE = new Type({"bits": 16, "signed": true, "be": true});
/**
* Unsigned 16-bit integers big-endian
* @type {Object}
*/
exports.uInt16BE = new Type({"bits": 16, "be": true});
module.exports.uInt16BE = new Type({"bits": 16, "be": true});
/**
* Half-precision floating-point numbers big-endian
* @type {Object}
*/
exports.float16BE = new Type({"bits": 16, "float": true, "be": true});
module.exports.float16BE = new Type({"bits": 16, "float": true, "be": true});
/**
* Signed 24-bit integers big-endian
* @type {Object}
*/
exports.int24BE = new Type({"bits": 24, "signed": true, "be": true});
module.exports.int24BE = new Type({"bits": 24, "signed": true, "be": true});
/**
* Unsigned 24-bit integers big-endian
* @type {Object}
*/
exports.uInt24BE = new Type({"bits": 24, "be": true});
module.exports.uInt24BE = new Type({"bits": 24, "be": true});
/**
* Signed 32-bit integers big-endian
* @type {Object}
*/
exports.int32BE = new Type({"bits": 32, "signed": true, "be": true});
module.exports.int32BE = new Type({"bits": 32, "signed": true, "be": true});
/**
* Unsigned 32-bit integers big-endian
* @type {Object}
*/
exports.uInt32BE = new Type({"bits": 32, "be": true});
module.exports.uInt32BE = new Type({"bits": 32, "be": true});
/**
* Single-precision floating-point numbers big-endian
* @type {Object}
*/
exports.float32BE = new Type({"bits": 32, "float": true, "be": true});
module.exports.float32BE = new Type({"bits": 32, "float": true, "be": true});
/**
* Signed 40-bit integers big-endian
* @type {Object}
*/
exports.int40BE = new Type({"bits": 40, "signed": true, "be": true});
module.exports.int40BE = new Type({"bits": 40, "signed": true, "be": true});
/**
* Unsigned 40-bit integers big-endian
* @type {Object}
*/
exports.uInt40BE = new Type({"bits": 40, "be": true});
module.exports.uInt40BE = new Type({"bits": 40, "be": true});
/**
* Signed 48-bit integers big-endian
* @type {Object}
*/
exports.int48BE = new Type({"bits": 48, "signed": true, "be": true});
module.exports.int48BE = new Type({"bits": 48, "signed": true, "be": true});
/**
* Unsigned 48-bit integers big-endian
* @type {Object}
*/
exports.uInt48BE = new Type({"bits": 48, "be": true});
module.exports.uInt48BE = new Type({"bits": 48, "be": true});
/**
* Double-precision floating-point numbers big-endian
* @type {Object}
*/
exports.float64BE = new Type({"bits": 64, "float": true, "be": true});
module.exports.float64BE = new Type({"bits": 64, "float": true, "be": true});


/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

/**
/*
* type: The Type class.
* Copyright (c) 2017 Rafael da Silva Rocha.
* https://github.com/rochars/byte-data
Expand All @@ -432,7 +432,7 @@ let f64 = new Float64Array(1);
/** @private */
let ui32 = new Uint32Array(f64.buffer);
/** @private */
let GInt = __webpack_require__(8);
const GInt = __webpack_require__(8);

/**
* A class to represent byte-data types.
Expand Down Expand Up @@ -1280,8 +1280,7 @@ window['WaveFile'] = WaveFile;
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

/**
* from-bytes: Numbers and strings from bytes.
/*
* Copyright (c) 2017 Rafael da Silva Rocha.
* https://github.com/rochars/byte-data
*/
Expand Down Expand Up @@ -1415,16 +1414,16 @@ function bytesToBase(bytes, base) {
}
}

exports.getType = getType;
exports.toBytes = toBytes;
exports.fromBytes = fromBytes;
module.exports.getType = getType;
module.exports.toBytes = toBytes;
module.exports.fromBytes = fromBytes;


/***/ }),
/* 8 */
/***/ (function(module, exports) {

/**
/*
* gint: Generic integer.
* A class to represent any integer from 1 to 53-Bit.
* Copyright (c) 2017 Rafael da Silva Rocha.
Expand Down Expand Up @@ -2433,18 +2432,16 @@ class WaveFileHeader {
this.bextChunkSize = 0;
/** @type {!Array<number>} */
this.bextChunkData = [];
/** @type {!Object} */
/** @type {Object} */
this.bextChunkFields = {
"description": "", //256
"originator": "", //32
"originatorReference": "", //32
"originationDate": "", //10
"originationTime": "", //8
"timeReferenceLow": "", //DWORD
"timeReferenceHigh": "", //DWORD
"timeReference": "", //64-bit value
"version": "", //WORD
"UMID_0 ": "", //byte
"UMID_63 ": "", //byte
"UMID": "", // 64
"loudnessValue": "", //WORD
"loudnessRange": "", //WORD
"maxTruePeakLevel": "", //WORD
Expand Down
2 changes: 1 addition & 1 deletion docs/WaveFile.html
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ <h5>Throws:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Apr 24 2018 23:24:21 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 25 2018 00:52:38 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ <h2>About</h2><p><strong>wavefile</strong> is a module to work with wav files. I
<li>Encode/decode files as ADPCM, A-Law and mu-Law</li>
<li>Read/write the data in a wav file header</li>
<li>Turn RIFF files to RIFX and RIFX files to RIFF</li>
<li>Edit BWF metada (&quot;bext&quot; chunk)</li>
</ul>
<p>And more.</p>
<p><strong>wavefile</strong> 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.</p>
Expand Down Expand Up @@ -152,8 +153,7 @@ <h2>Use</h2><pre class="prettyprint source lang-javascript"><code>let fs = requi
console.log(wav.dataChunkSize);

// array of numbers
console.log(wav.samples);</code></pre><h3>BWF data</h3><p>BWF data (&quot;bext&quot; chunk) is stored in the <em>bextChunkFields</em> property in human-readable form.
You may edit the data in the &quot;bext&quot; chunk by editing the <em>bextChunkFields</em> property on a WaveFile object.</p>
console.log(wav.samples);</code></pre><h3>BWF data</h3><p>BWF data (&quot;bext&quot; chunk) is stored in the <em>bextChunkFields</em> property in human-readable form.</p>
<pre class="prettyprint source lang-javascript"><code>wav.bextChunkFields = {
&quot;description&quot;: &quot;&quot;, // 256 chars
&quot;originator&quot;: &quot;&quot;, // 32 chars
Expand Down Expand Up @@ -208,7 +208,7 @@ <h2>LICENSE</h2><p>Copyright (c) 2017-2018 Rafael da Silva Rocha.</p>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Apr 24 2018 23:24:21 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 25 2018 00:52:38 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Apr 24 2018 23:24:21 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 25 2018 00:52:38 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit 7824b2d

Please sign in to comment.