Skip to content

Commit 24dda42

Browse files
authored
Merge pull request #163 from chris-rudmin/cleanup
Remove leaveStreamOpen option
2 parents 0305c21 + 77bdc76 commit 24dda42

19 files changed

+35514
-44592
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ A javascript library to encode the output of Web Audio API nodes in Ogg Opus or
55

66
#### Libraries Used
77

8-
- Libopus: v1.2.1 compiled with emscripten 1.38.1
9-
- speexDSP: 1.2RC3 compiled with emscripten 1.38.1
8+
- Libopus: v1.2.1 compiled with emscripten 1.38.11
9+
- speexDSP: 1.2RC3 compiled with emscripten 1.38.11
1010

1111
#### Required Files
1212

@@ -35,7 +35,6 @@ Creates a recorder instance.
3535

3636
- **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`.
3737
- **encoderPath** - (*optional*) Path to `encoderWorker.min.js` or `waveWorker.min.js` worker script. Defaults to `encoderWorker.min.js`
38-
- **leaveStreamOpen** - (*optional*) Keep the stream and context around when trying to `stop` recording, so you can re-`start` without re-initializing the stream and context. Defaults to `false`.
3938
- **mediaTrackConstraints** - (*optional*) Object to specify [media track constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). Defaults to `true`.
4039
- **monitorGain** - (*optional*) Sets the gain of the monitoring output. Gain is an a-weighted value between `0` and `1`. Defaults to `0`
4140
- **numberOfChannels** - (*optional*) The number of channels to record. `1` = mono, `2` = stereo. Defaults to `1`. Maximum `2` channels are supported.
@@ -63,11 +62,6 @@ Creates a recorder instance.
6362
---------
6463
#### Instance Methods
6564

66-
```js
67-
rec.clearStream()
68-
```
69-
70-
**clearStream** will stop and delete the stream as well as close the audio context. You will only ever call this manually if you have `config.leaveStreamOpen` set to `true`.
7165

7266
```js
7367
rec.pause()
@@ -97,7 +91,7 @@ rec.setMonitorGain( gain )
9791
rec.start( [sourceNode] )
9892
```
9993

100-
**start** Initalizes the worker, audio context, and an audio stream and begin capturing audio. Returns a promise which resolves when recording is started. Will callback `onstart` when started. Optionally accepts a source node which can be used in place of initializing the microphone stream. For iOS support, `start` needs to be initiated from a user action.
94+
**start** Initalizes the worker, audio context, and an audio stream and begin capturing audio. Returns a promise which resolves when recording is started. Will callback `onstart` when started. Optionally accepts a source node which can be used in place of initializing the microphone stream. For iOS support, `start` needs to be initiated from a user action. If a sourceNode is provided, then the stream and audioContext will need to be managed by the implementation.
10195

10296
```js
10397
rec.stop()

dist-unminified/decoderWorker.js

Lines changed: 142 additions & 92 deletions
Large diffs are not rendered by default.

dist-unminified/decoderWorker.wasm

-3.98 KB
Binary file not shown.

dist-unminified/decoderWorker.wast

Lines changed: 11212 additions & 13931 deletions
Large diffs are not rendered by default.

dist-unminified/encoderWorker.js

Lines changed: 153 additions & 92 deletions
Large diffs are not rendered by default.

dist-unminified/encoderWorker.wasm

-4.5 KB
Binary file not shown.

dist-unminified/encoderWorker.wast

Lines changed: 22112 additions & 25268 deletions
Large diffs are not rendered by default.

dist-unminified/recorder.js

Lines changed: 22 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist-unminified/waveWorker.js

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/decoderWorker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)