Closed rtwalz closed 2 years ago
The web audio api has native methods for doing this super smoothly which Tone exposes, check out GrainPlayer.volume.rampTo(value, rampTime, startTime)
and more broadly https://developer.mozilla.org/en-US/docs/Web/API/AudioParam
Thank you! This is exactly what I was looking for.
Hello, new to Tone.js and it seems really powerful so far.
I'm trying to fade in an mp3 sample I'm loading using a GrainPlayer. According to the docs,
fadeIn
orfadeOut
properties don't exist on GrainPlayer. However, the regularPlayer
class does havefadeIn
andfadeOut
properties. I need to use GrainPlayer because I want to control the playback rate while preserving pitch. How would I go about doing a nice fade-in with GrainPlayer? My initial solution is to slowly raise the volume manually every couple fractions of a second or so, but maybe someone else has a better idea.