Skip to content

Instantly share code, notes, and snippets.

@vitaliy-bobrov
Created June 11, 2019 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitaliy-bobrov/fdc4549520f7d9b1dce463540defc956 to your computer and use it in GitHub Desktop.
Save vitaliy-bobrov/fdc4549520f7d9b1dce463540defc956 to your computer and use it in GitHub Desktop.
const context = new AudioContext();
if (context.state === 'suspended') {
await context.resume();
}
const stream = await navigator.mediaDevices
.getUserMedia({
audio: {
echoCancellation: false,
autoGainControl: false,
noiseSuppression: false,
latency: 0
}
});
const lineInSource = context.createMediaStreamSource(stream);
lineInSource.connect(context.destination);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment