-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting oscilloscope with audio using tone.js and nexus ui #90
Comments
See the very recent issue #89 . Let me know if that helps you solve this.
I'll leave this issue open until I get this in the documentation, which is clearly needed!
… On Aug 21, 2017, at 6:55 PM, Nathanael Wa Mwenze ***@***.***> wrote:
Hi,
I'm trying to figure out why my oscilloscope isn't working with my audio. I tried using the .connect(node) from the api but it's still not working for me. What i get back when i run the console is "InvalidAccessError: Failed to execute 'connect' on 'AudioNode': cannot connect to a destination belonging to a different audio context."
here's the body of my html file
`
<div id="button"></div>
<div id="visualizer"></div>
<canvas id="waveform" width=600 height="200"></canvas>
<script>
//analyse the frequency/amplitude of the incoming signal
var fft = new Tone.Analyser("fft", 32);
//get the waveform data for the audio
var waveform = new Tone.Analyser("waveform", 1024);
var player = new Tone.Player ({
"url" : "https://res.cloudinary.com/dvwvkt7iq/video/upload/v1502945343/fake_aah_qxkkcr.wav",
"loop" : true
})
player.fan(fft,waveform);
player.toMaster();
var button = new Nexus.Button('#button',{
'size': [80,80],
'mode': 'aftertouch',
'state': false
})
button.on('change', function(){
if (button.state === true){
player.start();
}
else{
player.stop();
}
});
// start it right away
// var canvas = document.getElementById('tutorial');
// var ctx = canvas.getContext('2d');
var graphic = new Nexus.Oscilloscope('#visualizer')
graphic.connect(waveform);
</script>
</body>`
To see more go to:
https://nmwenz90.github.io/oscilloscope-test/
I'm new to javascript and apis help would be greatly appreciated.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes this worked thanks so much!!! |
There is now clearer documentation about this in the description for the .connect() method of each audio visualization. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to figure out why my oscilloscope isn't working with my audio. I tried using the .connect(node) from the api but it's still not working for me. What i get back when i run the console is "InvalidAccessError: Failed to execute 'connect' on 'AudioNode': cannot connect to a destination belonging to a different audio context."
here's the body of my html file
`
// var canvas = document.getElementById('tutorial');
// var ctx = canvas.getContext('2d');
To see more go to:
https://nmwenz90.github.io/oscilloscope-test/
I'm new to javascript and apis help would be greatly appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: