Tonejs / Tone.js

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

Offset a Player relative to Tone.Transport.position #938

Closed arpo closed 3 years ago

arpo commented 3 years ago

Offset a Player relative to Tone.Transport.position

I have a song as a mp3 that I sync to the Transport using a Player. This song begins with silence for some ms before it starts. What I would like to do, and haven't found how to, is to offset the players start time relative to the Tone.Transport.position with a negative number. I tried to set the player.start(-0.2) but that didn't work.

tambien commented 3 years ago

You can use the second argument of player.start to do this and start the player at a 0.2 second offset like this:

player.start(0, 0.2)