Skip to content

Instantly share code, notes, and snippets.

@s3thi
Created January 11, 2016 12:41
Show Gist options
  • Select an option

  • Save s3thi/b87cc000bdfdd661ae19 to your computer and use it in GitHub Desktop.

Select an option

Save s3thi/b87cc000bdfdd661ae19 to your computer and use it in GitHub Desktop.
sampler.js – playSample() with playback rate
playSample() {
let bufferSource = this.audioContext.createBufferSource();
bufferSource.buffer = this.audioBuffer;
bufferSource.playbackRate.value = this.playbackRate;
bufferSource.connect(this.audioContext.destination);
bufferSource.start(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment