Quantcast
Channel: Latest Questions by Braza
Viewing all articles
Browse latest Browse all 23

Browsers prevent WebGL Audio to start at Awake. How to get notification of actual Audio start?

0
0
> 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;

Viewing all articles
Browse latest Browse all 23

Latest Images

Trending Articles





Latest Images