Skip to content

Comments

Fix a bug where the source node gets reclaimed by the GC#33

Open
eeror wants to merge 1 commit intohiguma:masterfrom
eeror:master
Open

Fix a bug where the source node gets reclaimed by the GC#33
eeror wants to merge 1 commit intohiguma:masterfrom
eeror:master

Conversation

@eeror
Copy link

@eeror eeror commented Jun 19, 2019

Let's say the user of the library initializes it like this:

const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
const source = audioContext.createMediaStreamSource(stream)
const recorder = new WebAudioRecorder(source, recorderConfiguration)

At least in the newest version of Chrome, if source goes out of scope and gets reclaimed by the GC, the script processor will start receiving zeroes and record silence as a result.

If the user creates a source node just to pass it on to the recorder, it would be a leaky abstraction to require the user to keep a reference to it themselves. This pull request makes the library store a reference to the source node so the user wouldn't have to.

This will most likely fix #18, fix #28, and fix #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recorder not working in latest versions of browser recording doesn't work anymore web audio api broken IOS 10.1.1 ipad

1 participant