How to use the virtual-audio-graph.bufferSource function in virtual-audio-graph

To help you get started, we’ve selected a few virtual-audio-graph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miselaytes-anton / web-audio-experiments / packages / tape-app / src / components / Audio / index.js View on Github external
const paramsToGraph = ({tapeSpeed, feedbackAmount, reader1Position, audioBuffer, mix, lowpass}) => {
  //ensure a new node is created each time
  const bufferSourceDry = `bufferSourceDry${new Date().getTime()}`;
  const bufferSourceWet = `bufferSourceWet${new Date().getTime()}`;
  return {
    master: gain('output', {gain: 0.7}),
    dry: gain('master', {gain: normDry(mix)}),
    wet: gain('master', {gain: normWet(mix)}),
    feedback: gain(['delay'], {gain: normFeedback(feedbackAmount)}),
    lowpass: biquadFilter(['feedback', 'wet'], {type: 'lowpass', frequency: normFrequency(lowpass)}),
    delay: delay('lowpass', {delayTime: normDelay(reader1Position)}),
    [bufferSourceDry]: bufferSource('dry', {buffer: audioBuffer, loop: true}),
    [bufferSourceWet]: bufferSource('delay', {buffer: audioBuffer, loop: true, playbackRate: normSpeed(tapeSpeed)}),
  };
};
github miselaytes-anton / web-audio-experiments / packages / tape-app / src / components / Audio / index.js View on Github external
const paramsToGraph = ({tapeSpeed, feedbackAmount, reader1Position, audioBuffer, mix, lowpass}) => {
  //ensure a new node is created each time
  const bufferSourceDry = `bufferSourceDry${new Date().getTime()}`;
  const bufferSourceWet = `bufferSourceWet${new Date().getTime()}`;
  return {
    master: gain('output', {gain: 0.7}),
    dry: gain('master', {gain: normDry(mix)}),
    wet: gain('master', {gain: normWet(mix)}),
    feedback: gain(['delay'], {gain: normFeedback(feedbackAmount)}),
    lowpass: biquadFilter(['feedback', 'wet'], {type: 'lowpass', frequency: normFrequency(lowpass)}),
    delay: delay('lowpass', {delayTime: normDelay(reader1Position)}),
    [bufferSourceDry]: bufferSource('dry', {buffer: audioBuffer, loop: true}),
    [bufferSourceWet]: bufferSource('delay', {buffer: audioBuffer, loop: true, playbackRate: normSpeed(tapeSpeed)}),
  };
};