new MediaElementAudioStream(source, optsopt)
Turns a MediaStream object (from getUserMedia) into a Node.js Readable stream and converts the audio to Buffers
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
MediaStream | HTMLMediaElement | either https://developer.mozilla.org/en-US/docs/Web/API/MediaStream or https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement | ||||||||||||||||
opts |
Object |
<optional> |
options
Properties
|
Methods
(static) toRaw(chunk) → {Float32Array}
Converts a Buffer back into the raw Float32Array format that browsers use.
Note: this is just a new DataView for the same underlying buffer -
the actual audio data is not copied or changed here.
Parameters:
| Name | Type | Description |
|---|---|---|
chunk |
Buffer | node-style buffer of audio data from a 'data' event or read() call |
- Source:
Returns:
raw 32-bit float data view of audio data
- Type
- Float32Array
(inner) processAudio(e)
Convert and emit the raw audio data
Parameters:
| Name | Type | Description |
|---|---|---|
e |
AudioProcessingEvent | https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent |