diff --git a/README.md b/README.md index 0ae78a3..a13e1d1 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,11 @@ wavDataURI = wav.toDataURI(); #### WaveFile.fromBuffer() Load a .wav file from a byte buffer into a WaveFile object: ```javascript +wav.fromBuffer(buffer); +``` + +This is the same as passing the buffer when creating the WaveFile object: +```javascript let wav = new Wavefile(buffer); ``` diff --git a/docs/WaveFile.html b/docs/WaveFile.html index 25c621d..35fd348 100644 --- a/docs/WaveFile.html +++ b/docs/WaveFile.html @@ -3316,7 +3316,7 @@
const fs = req
// Call toDataURI() to get the file as a base64-encoded
// DataURI to load the file a web browser:
wavDataURI = wav.toDataURI();
Load a .wav file from a byte buffer into a WaveFile object:
+wav.fromBuffer(buffer);
This is the same as passing the buffer when creating the WaveFile object:
let wav = new Wavefile(buffer);
Create a WaveFile object with the arguments you pass:
// A mono, 44.1 kHz, 32-bit .wav file with just 4 samples:
wav.fromScratch(1, 44100, '32', [0, -2147483648, 2147483647, 4]);
Return a Uint8Array with the WaveFile object data. The buffer is a .wav file and can be written to disk:
@@ -342,7 +343,7 @@Copyright (c) 2017-2018 Rafael da Silva Rocha.