Skip to content

Commit

Permalink
fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Apr 30, 2018
1 parent 92a3057 commit 236e2ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ like the next greater bit depth that fill a full sequence of bytes:
- 17-bit is stored like 24-bit (3 bytes)
- 27-bit is stored like 32-bit (4 bytes)

So even if wave files with those bit depth are valid (and playable in most players), they allow their samples to be greater than the actual limit of their bit depth. So:
So even if files like this are valid (and playable in most players), they allow their samples to be greater than the actual limit of their audio bit depth. So:
- 11-bit files can contain 16-bit samples
- 17-bit files can contain 24-bit samples
- 29-bit files can contain 32-bit samples
Expand Down Expand Up @@ -182,7 +182,7 @@ fs.writeFileSync("11bit-file.wav", wav.toBuffer());
```

### Change the bit depth of a file without re-scaling the samples
This may be needed when dealing with files whose bit depths do not fill a full sequence of bytes (like 12-bit files), as those files may contain samples that outrange their declared bit depth limits and re-scaling their samples may result in files with clipping audio.
This may be needed when dealing with files whose bit depths do not fill a full sequence of bytes (like 12-bit files), as those files may contain samples that outrange their declared bit depth limits and re-scaling their samples may result in clipping.

You may want to change the bit depth of those files but don't touch their samples. You can do this by setting the optional changeResolution parameter to **false**.

Expand Down
2 changes: 1 addition & 1 deletion docs/WaveFile.html
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,7 @@ <h4 class="name" id="toRIFX"><span class="type-signature"></span>toRIFX<span cla
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 30 2018 14:08:31 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 Mon Apr 30 2018 14:12:35 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 @@ -82,7 +82,7 @@ <h3>A word on bit depths</h3><p>Bit depths that do not fill full bytes (like 11-
<li>17-bit is stored like 24-bit (3 bytes)</li>
<li>27-bit is stored like 32-bit (4 bytes)</li>
</ul>
<p>So even if wave files with those bit depth are valid (and playable in most players), they allow their samples to be greater than the actual limit of their bit depth. So:</p>
<p>So even if files like this are valid (and playable in most players), they allow their samples to be greater than the actual limit of their audio bit depth. So:</p>
<ul>
<li>11-bit files can contain 16-bit samples</li>
<li>17-bit files can contain 24-bit samples</li>
Expand Down Expand Up @@ -142,7 +142,7 @@ <h2>A-Law</h2><p>16-bit wave files can be encoded as A-Law:</p>

// You can use any supported bit depth:
wav.toBitDepth(&quot;11&quot;);
fs.writeFileSync(&quot;11bit-file.wav&quot;, wav.toBuffer());</code></pre><h3>Change the bit depth of a file without re-scaling the samples</h3><p>This may be needed when dealing with files whose bit depths do not fill a full sequence of bytes (like 12-bit files), as those files may contain samples that outrange their declared bit depth limits and re-scaling their samples may result in files with clipping audio.</p>
fs.writeFileSync(&quot;11bit-file.wav&quot;, wav.toBuffer());</code></pre><h3>Change the bit depth of a file without re-scaling the samples</h3><p>This may be needed when dealing with files whose bit depths do not fill a full sequence of bytes (like 12-bit files), as those files may contain samples that outrange their declared bit depth limits and re-scaling their samples may result in clipping.</p>
<p>You may want to change the bit depth of those files but don't touch their samples. You can do this by setting the optional changeResolution parameter to <strong>false</strong>.</p>
<pre class="prettyprint source lang-javascript"><code>// Load a wav file that say it has 11-bit audio, but has samples
// in the 16-bit range:
Expand Down Expand Up @@ -258,7 +258,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 Mon Apr 30 2018 14:08:31 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 Mon Apr 30 2018 14:12:35 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 @@ -441,7 +441,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 Mon Apr 30 2018 14:08:31 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 Mon Apr 30 2018 14:12:35 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

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

0 comments on commit 236e2ab

Please sign in to comment.