I was wondering could you please help. I am using the web audio to play music for a certain amount of time. After around 90 seconds (depending on length of song), i want to call my loadAndPlay() function again to repeat play. The function will be called every 90 seconds or so.
I would like to use the same method to trigger effects at the same time, using Tuna.js
it seems that this will not work:
if (context.currentTime > 90*totalPlays)
{
loadAndPlay();
}
i have also tried using this method:
if (time > 90*totalPlays){
source.onended = function()
{
console.log("End. starting again");
loadAndPlay();
totalPlays++
}
time will usually be around 90 and 105. This works sometimes but not all the time unfortunately. I would like to steer away from 'source.onended' anyway as it is unreliable.
the same idea using effects, cueing a delay for 15 seconds
while (context.currentTime > 90 && context.currentTime < 105){
delay.wetLevel = 10
}
if anyone could point out where i'm going wrong that would be fantastic. thank you!
Aucun commentaire:
Enregistrer un commentaire