> The AudioContext was not allowed to> start. It must be resumed (or created)> after a user gesture on the page.
I use PlaySheduled to play smooth looping clips back-to-back. This requires me to calculate schedule starting from the 1st clip started at Awake. But Browsers won't let Unity play audio until Canvas is clicked. This causes Scheduled clips to overlap.
How can I get notified in Unity when WebGL actually started playing music?
Here's scheduling logic:
musicSource.PlayScheduled(nextStartTime);
// Checks how long the Clip will last and updates the Next Start Time with a new value
double duration = (double)musicSource.clip.samples / musicSource.clip.frequency;
nextStartTime = nextStartTime + duration;
Trending Articles
More Pages to Explore .....