rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.89k stars 160 forks source link

Feature: pass Offset as argument when playing #68

Closed phal0r closed 6 years ago

phal0r commented 8 years ago

Start playing an audiobuffer with a certain offset. The native api supports it on start. Is it difficult to introduce this parameter on play? What do you think?

rserota commented 8 years ago

If it's in the native API, it shouldn't be hard to implement on play, but I haven't tried to implement it. It would probably weird to use offset in combination with a volume envelope, though I'm not sure if anyone would want to do that anyway.

phal0r commented 8 years ago

I was digging deeper in the source today and now I understand what you mean. The use case is to start playback and dynamically stop it or start with an offset. As I understand the asdr envlope is not usable for this scenario, so there should be a kind of "dynamic" mode, where stop is not scheduled in startEnv but controlled from outside.

rserota commented 6 years ago

I just added an offset parameter to the constructor and the play() method that allows you to play an audio clip starting from partway through the clip.