Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.2.4f1

Issue ID

1091374

Regression

No

Audio loading with UnityWebRequest returns 0 channels in WebGL

WebGL

-

To reproduce:
1) Open attached project and scene (corrected one with scene saved)
2) Play it on Editor
3) Press the button and upload an audio file

Expected: The audio plays and info on samples and channels is returned on screen in labels

4) Build and run on WebGL
5) Press the button and upload an audio file

Actual: The audio plays, but the channels remain at zero even when isReadyToPlay is true

Reproduced in 2017.4.2f2, 2018.2.13f1, 2018.3.0b6

  1. Resolution Note (2019.1.X):

    AudioClip.samples will return a non-zero value as soon as AudioClip.isReadyToPlay switches to true. Channels returning incorrect value we believe is low impact and not a priority to fix at this point.

Comments (2)

  1. doron-matific1

    Jan 30, 2023 11:17

    The length is mostly important here, and it is returning as 0.
    It cannot be calculated just from .samples alone, and the other needed variables are also returned as 0.
    How can you think this is not important?
    Knowing the length of the audio???
    I'll have to go with a specific implementation for WebGL, which will not really fix the issue, just ignore it better.

  2. BayouSoftware

    May 05, 2021 16:11

    It's not just channels, length, samples and frequency all return zero and GetData just fails. This has cost me a day finding out this was the cause and trying to find a way around.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.