Skip to content

Instantly share code, notes, and snippets.

@vitaliy-bobrov
Created June 11, 2019 06:57
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/97f4741abd2f64b84a12e27f95d704b0 to your computer and use it in GitHub Desktop.
Save vitaliy-bobrov/97f4741abd2f64b84a12e27f95d704b0 to your computer and use it in GitHub Desktop.
// Create a gain node and set the initial value to 0.5
// that means that volume will be haft of the original.
const gainNode = new GainNode(context, {gain: 0.5});
// Disconnect source before constructing a new graph.
lineInSource.disconnect();
// Connect nodes
lineInSource.connect(gainNode).connect(context.destination);
// Increasing volume.
gainNode.gain.value = 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment