Skip to content
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

How to use Synth.onsilence ? #799

Closed
Low-Hiss-Systems opened this issue Dec 3, 2020 · 2 comments
Closed

How to use Synth.onsilence ? #799

Low-Hiss-Systems opened this issue Dec 3, 2020 · 2 comments

Comments

@Low-Hiss-Systems
Copy link

Low-Hiss-Systems commented Dec 3, 2020

Hello,
I am trying to get the onsilence callback to work on synths but in my code it never gets called.
I need to know when the synth is silent so I can safely dispose() of it.

Here is a snippet where it doesn't seem to be called:

const type = 'Synth';
this.synth = new Tone[type]().toDestination();
this.synth.onsilence = () => {
    console.log('silence');
    this.isSilenced = true;
};
@tambien
Copy link
Contributor

tambien commented Dec 3, 2020

I'm unable to reproduce this issue. Here's a live example: https://codesandbox.io/s/synth-onsilence-coxtx?file=/src/index.ts

@tambien tambien closed this as completed Dec 7, 2020
@mildfuzz
Copy link

mildfuzz commented Dec 3, 2024

This is maybe related to this #1296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants