You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I wrapped a class based on tonejs and then provided a function to play midi like this:
public play(midi: number, durationInSeconds: number) { const frequency = (Tone.Midi(midi) as any).toFrequency() as number; this.sampler?.triggerAttackRelease(frequency, durationInSeconds); }
What should I do if I need to stop the audio I'm playing based on a situation?
I tried to use the following function to achieve my needs, but it didn't get the effect I wanted, and the audio didn't stop.
public stop() { this.sampler?.triggerAttackRelease(1, 0.1); }
The text was updated successfully, but these errors were encountered:
Hello, I wrapped a class based on tonejs and then provided a function to play midi like this:
public play(midi: number, durationInSeconds: number) { const frequency = (Tone.Midi(midi) as any).toFrequency() as number; this.sampler?.triggerAttackRelease(frequency, durationInSeconds); }
What should I do if I need to stop the audio I'm playing based on a situation?
I tried to use the following function to achieve my needs, but it didn't get the effect I wanted, and the audio didn't stop.
public stop() { this.sampler?.triggerAttackRelease(1, 0.1); }
The text was updated successfully, but these errors were encountered: