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
Copy file name to clipboardExpand all lines: README.md
+22-9
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
# Opus & Wave Recorder
2
2
3
-
A javascript library to encode the output of Web Audio API nodes in Ogg Opus or WAV format. Audio encoded and decoded using libopus v1.2.1. Audio resampling is performed by speexDSP 1.2RC3.
3
+
A javascript library to encode the output of Web Audio API nodes in Ogg Opus or WAV format using WebAssembly. Audio encoded and decoded using libopus v1.2.1. Audio resampling is performed by speexDSP 1.2RC3.
4
4
Encoded and muxed audio will be returned as typedArray in `dataAvailable` event.
5
5
6
+
For legacy asm.js, please use version 1.2.0
7
+
6
8
### Usage
7
9
8
10
@@ -20,7 +22,7 @@ Creates a recorder instance.
20
22
21
23
22
24
---------
23
-
#### Config
25
+
#### Config options for OGG OPUS encoder
24
26
25
27
-**bufferLength** - (*optional*) The length of the buffer that the internal JavaScriptNode uses to capture the audio. Can be tweaked if experiencing performance issues. Defaults to `4096`.
26
28
-**encoderApplication** - (*optional*) Supported values are: `2048` - Voice, `2049` - Full Band Audio, `2051` - Restricted Low Delay. Defaults to `2049`.
@@ -37,7 +39,18 @@ Creates a recorder instance.
37
39
-**originalSampleRateOverride** - (*optional*) Override the ogg opus 'input sample rate' field. Google Speech API requires this field to be `16000`.
38
40
-**resampleQuality** - (*optional*) Value between 0 and 10 which determines latency and processing for resampling. `0` is fastest with lowest quality. `10` is slowest with highest quality. Defaults to `3`.
39
41
-**streamPages** - (*optional*) `dataAvailable` event will fire after each encoded page. Defaults to `false`.
40
-
-**wavBitDepth** - (*optional*) Desired bit depth of the WAV file. Defaults to `16`. Supported values are `8`, `16`, `24` and `32` bits per sample. Only applies to `waveWorker.min.js`
42
+
43
+
44
+
---------
45
+
#### Config Options for WAV recorder
46
+
47
+
-**bufferLength** - (*optional*) The length of the buffer that the internal JavaScriptNode uses to capture the audio. Can be tweaked if experiencing performance issues. Defaults to `4096`.
48
+
-**encoderPath** - (*optional*) Path to `encoderWorker.min.js` or `waveWorker.min.js` worker script. Defaults to `encoderWorker.min.js`
49
+
-**leaveStreamOpen** - (*optional*) Keep the stream around when trying to `stop` recording, so you can re-`start` without re-`initStream`. Defaults to `false`.
50
+
-**mediaTrackConstraints** - (*optional*) Object to specify [media track constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). Defaults to `true`.
51
+
-**monitorGain** - (*optional*) Sets the gain of the monitoring output. Gain is an a-weighted value between `0` and `1`. Defaults to `0`
52
+
-**numberOfChannels** - (*optional*) The number of channels to record. `1` = mono, `2` = stereo. Defaults to `1`. Maximum `2` channels are supported.
53
+
-**wavBitDepth** - (*optional*) Desired bit depth of the WAV file. Defaults to `16`. Supported values are `8`, `16`, `24` and `32` bits per sample.
41
54
42
55
43
56
---------
@@ -115,10 +128,10 @@ Returns a truthy value indicating if the browser supports recording.
115
128
Supported:
116
129
- Chrome v58
117
130
- Firefox v53
118
-
- Microsoft Edge
131
+
- Microsoft Edge v41
119
132
- Opera v44
120
-
- Safari v11
121
-
- iOS 11 Safari
133
+
-macOS Safari v11
134
+
- iOS Safari v11
122
135
123
136
Unsupported:
124
137
- IE 11 and below
@@ -129,9 +142,9 @@ Unsupported:
129
142
### Known Issues
130
143
131
144
- Firefox does not support sample rates above 48000Hz: https://bugzilla.mozilla.org/show_bug.cgi?id=1124981
132
-
- Safari v11 does not sample rates above 44100Hz
133
-
- Safari v11 native opus playback not yet supported
134
-
- iOS 11 Safari native opus playback not yet supported
145
+
-macOS Safari v11 does not sample rates above 44100Hz
146
+
-macOS Safari v11 native opus playback not yet supported
147
+
- iOS Safari v11 native opus playback not yet supported
135
148
- Microsoft Edge native opus playback not yet supported
0 commit comments