You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Change the bit depth of the audio](#change-the-bit-depth)
26
26
-[Change the sample rate of the audio](#change-the-sample-rate)
27
27
-[Read and write RIFF tags](#add-riff-tags-to-files)
@@ -149,6 +149,7 @@ let wavDataURI = wav.toDataURI();
149
149
-[Use](#use)
150
150
-[Operation Manual](#operation-manual)
151
151
*[Create wave files from scratch](#create-wave-files-from-scratch)
152
+
*[Read wave files](#read-wave-files)
152
153
*[Add RIFF tags to files](#add-riff-tags-to-files)
153
154
*[Add cue points to files](#add-cue-points-to-files)
154
155
*[Create regions in files](#create-regions-in-files)
@@ -213,6 +214,18 @@ You can also use any bit depth between "8" and "53", like **"11", "12", "17", "2
213
214
#### A word on bit depth
214
215
Resolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.
215
216
217
+
### Read wave files
218
+
```javascript
219
+
constWaveFile=require('wavefile').WaveFile;
220
+
wav =newWaveFile();
221
+
// Read a wav file from a buffer
222
+
wav.fromBuffer(buffer);
223
+
// Read a wav file from a base64 string
224
+
wav.fromBase64(base64);
225
+
// Read a wav file from a data URI
226
+
wav.fromDataURI(dataURI);
227
+
```
228
+
216
229
### Add RIFF tags to files
217
230
You can create (or overwrite) tags on files with the **WaveFile.setTag()** method.
<li><ahref="#add-riff-tags-to-files">Add RIFF tags to files</a></li>
184
185
<li><ahref="#add-cue-points-to-files">Add cue points to files</a></li>
185
186
<li><ahref="#create-regions-in-files">Create regions in files</a></li>
@@ -244,6 +245,16 @@ <h4>Stereo:</h4>
244
245
<p>You can also use any bit depth between "8" and "53", like <strong>"11", "12", "17", "20" and so on</strong>.</p>
245
246
<h4>A word on bit depth</h4>
246
247
<p>Resolutions other than 4-bit, 8-bit, 16-bit, 24-bit, 32-bit (integer), 32-bit (fp) and 64-bit (fp) are implemented as WAVE_FORMAT_EXTENSIBLE and may not be supported by some players.</p>
0 commit comments