Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Fix memory leak in code sample #4982

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion site/en/blog/audiocontext-setsinkid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ The example below shows you how to request microphone access if needed and direc
const permission = await navigator.permissions.query({ name: "microphone" });
if (permission.state == "prompt") {
// More audio outputs are available when user grants access to the mic.
await navigator.mediaDevices.getUserMedia({ audio: true });
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
stream.getTracks().forEach((track) => track.stop());
}

// Request a list of media devices and filter audio output devices.
Expand Down