Skip to content

Instantly share code, notes, and snippets.

@CarloCattano
Last active May 19, 2019 07:08
Show Gist options
  • Save CarloCattano/919913b2f06fa244ad8fbd6d3530b722 to your computer and use it in GitHub Desktop.
Save CarloCattano/919913b2f06fa244ad8fbd6d3530b722 to your computer and use it in GitHub Desktop.
// Imported from within Home.vue app
import Tone from "tone";
import StartAudioContext from "startaudiocontext";
export default {
name: "home",
created() {
//need to start audio context this way due to new browser restrictions
StartAudioContext(Tone.context, "#button").then(function() {
console.log("audio context started");
});
Tone.context.latencyHint = "interactive";
const audioContext = Tone.context;
const destination = audioContext.createMediaStreamDestination();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment