Skip to content

Commit

Permalink
Doc update on cue points, resample and bit depth
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jan 17, 2020
1 parent a765026 commit 29f5b03
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ With **wavefile** you can:
- Create wav files
- Read wav files
- Change the bit depth of the audio
- Change the sample rate of the audio
- Read and write RIFF tags
- Set and delete cue points and their labels
- Create regions in wav files
Expand Down Expand Up @@ -371,7 +372,7 @@ wav.fromMuLaw("24");
```

### Change the bit depth
You can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.
You can change the bit depth of the audio with the **toBitDepth(bitDepth)** method. WaveFile only change the bit depth of the samples; no dithering is done.
```javascript
// Load a wav file with 32-bit audio
let wav = new WaveFile(fs.readFileSync("32bit-file.wav"));
Expand Down Expand Up @@ -675,16 +676,7 @@ WaveFile.listTags() {}

/**
* Create a cue point in the wave file.
* @param {!{
* position: number,
* label: ?string,
* end: ?number,
* dwPurposeID: ?number,
* dwCountry: ?number,
* dwLanguage: ?number,
* dwDialect: ?number,
* dwCodePage: ?number
* }} pointData A object with the data of the cue point.
* @param {!Object} pointData A object with the data of the cue point.
*
* # Only required attribute to create a cue point:
* pointData.position: The position of the point in milliseconds
Expand All @@ -703,6 +695,18 @@ WaveFile.listTags() {}
* pointData.dwLanguage
* pointData.dwDialect
* pointData.dwCodePage
*
* # This is what a complete pointData object look like:
* {
* position: number,
* label: ?string,
* end: ?number,
* dwPurposeID: ?number,
* dwCountry: ?number,
* dwLanguage: ?number,
* dwDialect: ?number,
* dwCodePage: ?number
* }
*/
WaveFile.setCuePoint(pointData) {}

Expand Down
26 changes: 15 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ <h2>Notice</h2>
<li>Create wav files</li>
<li>Read wav files</li>
<li>Change the bit depth of the audio</li>
<li>Change the sample rate of the audio</li>
<li>Read and write RIFF tags</li>
<li>Set and delete cue points and their labels</li>
<li>Create regions in wav files</li>
Expand Down Expand Up @@ -362,7 +363,7 @@ <h3>mu-Law</h3>
wav.fromMuLaw(&quot;24&quot;);
</code></pre>
<h3>Change the bit depth</h3>
<p>You can change the bit depth of the audio with the <strong>toBitDepth(bitDepth)</strong> method.</p>
<p>You can change the bit depth of the audio with the <strong>toBitDepth(bitDepth)</strong> method. WaveFile only change the bit depth of the samples; no dithering is done.</p>
<pre class="prettyprint source lang-javascript"><code>// Load a wav file with 32-bit audio
let wav = new WaveFile(fs.readFileSync(&quot;32bit-file.wav&quot;));

Expand Down Expand Up @@ -637,16 +638,7 @@ <h3>The WaveFile methods</h3>

/**
* Create a cue point in the wave file.
* @param {!{
* position: number,
* label: ?string,
* end: ?number,
* dwPurposeID: ?number,
* dwCountry: ?number,
* dwLanguage: ?number,
* dwDialect: ?number,
* dwCodePage: ?number
* }} pointData A object with the data of the cue point.
* @param {!Object} pointData A object with the data of the cue point.
*
* # Only required attribute to create a cue point:
* pointData.position: The position of the point in milliseconds
Expand All @@ -665,6 +657,18 @@ <h3>The WaveFile methods</h3>
* pointData.dwLanguage
* pointData.dwDialect
* pointData.dwCodePage
*
* # This is what a complete pointData object look like:
* {
* position: number,
* label: ?string,
* end: ?number,
* dwPurposeID: ?number,
* dwCountry: ?number,
* dwLanguage: ?number,
* dwDialect: ?number,
* dwCodePage: ?number
* }
*/
WaveFile.setCuePoint(pointData) {}

Expand Down

0 comments on commit 29f5b03

Please sign in to comment.