We’re facing an issue when we try to access the AudioClip information after downloading it from a remote server.
It works on Unity Editor but the same code fails on WebGL.
I will revive this old thread as I’m facing the same problem with Unity 2018.2.18f1 using .wav files from a TTS file. I need the duration to coordinate some stuff and I’m getting 0 from GetComponent().clip.length when in Unity Editor I get the correct value.
There’s any solution to this? clip.length work with some type of audio? which?
Running into a similar issue at the moment: we’re downloading some audio from a remote server using UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG) and DownloadHandlerAudioClip.GetContent(request), and are noticing some differences in the file the moment we’ve downloaded it between the editor and WebGL.
When downloaded in the editor, the audio clip has a length of 7.176:
Whereas when downloaded in WebGL, using the same methods, the same audio clip has a length of 4.055:
So in the editor the clip plays in full, whereas in WebGL the same clip cuts out some of the way through. I’m conscious this may be a bit niche, but the audio clips we’re downloading were generated with CereProc and do have some slight audio glitches around the point they’re cut short in WebGL. When we paste the URL we used for the request into the same browser the audio plays in full, albeit with the glitch. I’m wondering if somewhere along the line some code is mistaking the audio glitch for the end of the clip somehow?