Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.37k stars 976 forks source link

Query on Player vs GrainPlayer #1141

Open aMadReason opened 1 year ago

aMadReason commented 1 year ago

Describe the bug

I'm not sure if this is a bug or if I don't understand something, so please be patient. (Tone 14.7.77)

I have noticed that the fadeIn and fadeOut properties on GrainPlayer don't seem to work while reverse does.

fadeIn and fadeOutwork for Player but reverse doesn't.

The fadeIn, fadeOut and reverse settings are all changed 'after' the files have loaded.

The only part of my code that changes is the initialiser (changing from Player to GrainPlayer)

  this.player = new Tone.Player({
    loop: true,
    autostart: false,
    ...options
  });

To Reproduce

I'm not sure this is worth reproducing as it's probably me mis-undertanding something.

Expected behavior Based on the documentation (both Player and GrainPlayer both have fadeIn, fadeOut and reverse properties) I expect both Player types to support all three featrures.

What I've tried I looked through old issues and and read that applying reverse = true after the buffer loaded can help. I apply it after it's playing so I assume it's loaded by that time (I have also tried setting it before it plays)

Additional context Again, this may be my inexperience with the library and audio API in general.