Skip to content

Commit 29f5b03

Browse files
committed
Doc update on cue points, resample and bit depth
1 parent a765026 commit 29f5b03

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ With **wavefile** you can:
2323
- Create wav files
2424
- Read wav files
2525
- Change the bit depth of the audio
26+
- Change the sample rate of the audio
2627
- Read and write RIFF tags
2728
- Set and delete cue points and their labels
2829
- Create regions in wav files
@@ -371,7 +372,7 @@ wav.fromMuLaw("24");
371372
```
372373

373374
### Change the bit depth
374-
You can change the bit depth of the audio with the **toBitDepth(bitDepth)** method.
375+
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.
375376
```javascript
376377
// Load a wav file with 32-bit audio
377378
let wav = new WaveFile(fs.readFileSync("32bit-file.wav"));
@@ -675,16 +676,7 @@ WaveFile.listTags() {}
675676

676677
/**
677678
* Create a cue point in the wave file.
678-
* @param {!{
679-
* position: number,
680-
* label: ?string,
681-
* end: ?number,
682-
* dwPurposeID: ?number,
683-
* dwCountry: ?number,
684-
* dwLanguage: ?number,
685-
* dwDialect: ?number,
686-
* dwCodePage: ?number
687-
* }} pointData A object with the data of the cue point.
679+
* @param {!Object} pointData A object with the data of the cue point.
688680
*
689681
* # Only required attribute to create a cue point:
690682
* pointData.position: The position of the point in milliseconds
@@ -703,6 +695,18 @@ WaveFile.listTags() {}
703695
* pointData.dwLanguage
704696
* pointData.dwDialect
705697
* pointData.dwCodePage
698+
*
699+
* # This is what a complete pointData object look like:
700+
* {
701+
* position: number,
702+
* label: ?string,
703+
* end: ?number,
704+
* dwPurposeID: ?number,
705+
* dwCountry: ?number,
706+
* dwLanguage: ?number,
707+
* dwDialect: ?number,
708+
* dwCodePage: ?number
709+
* }
706710
*/
707711
WaveFile.setCuePoint(pointData) {}
708712

docs/index.html

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ <h2>Notice</h2>
7777
<li>Create wav files</li>
7878
<li>Read wav files</li>
7979
<li>Change the bit depth of the audio</li>
80+
<li>Change the sample rate of the audio</li>
8081
<li>Read and write RIFF tags</li>
8182
<li>Set and delete cue points and their labels</li>
8283
<li>Create regions in wav files</li>
@@ -362,7 +363,7 @@ <h3>mu-Law</h3>
362363
wav.fromMuLaw(&quot;24&quot;);
363364
</code></pre>
364365
<h3>Change the bit depth</h3>
365-
<p>You can change the bit depth of the audio with the <strong>toBitDepth(bitDepth)</strong> method.</p>
366+
<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>
366367
<pre class="prettyprint source lang-javascript"><code>// Load a wav file with 32-bit audio
367368
let wav = new WaveFile(fs.readFileSync(&quot;32bit-file.wav&quot;));
368369

@@ -637,16 +638,7 @@ <h3>The WaveFile methods</h3>
637638

638639
/**
639640
* Create a cue point in the wave file.
640-
* @param {!{
641-
* position: number,
642-
* label: ?string,
643-
* end: ?number,
644-
* dwPurposeID: ?number,
645-
* dwCountry: ?number,
646-
* dwLanguage: ?number,
647-
* dwDialect: ?number,
648-
* dwCodePage: ?number
649-
* }} pointData A object with the data of the cue point.
641+
* @param {!Object} pointData A object with the data of the cue point.
650642
*
651643
* # Only required attribute to create a cue point:
652644
* pointData.position: The position of the point in milliseconds
@@ -665,6 +657,18 @@ <h3>The WaveFile methods</h3>
665657
* pointData.dwLanguage
666658
* pointData.dwDialect
667659
* pointData.dwCodePage
660+
*
661+
* # This is what a complete pointData object look like:
662+
* {
663+
* position: number,
664+
* label: ?string,
665+
* end: ?number,
666+
* dwPurposeID: ?number,
667+
* dwCountry: ?number,
668+
* dwLanguage: ?number,
669+
* dwDialect: ?number,
670+
* dwCodePage: ?number
671+
* }
668672
*/
669673
WaveFile.setCuePoint(pointData) {}
670674

0 commit comments

Comments
 (0)