Search Issue Tracker

Active

Under Consideration for 6000.4.X, 6000.5.X, 6000.6.X

In Progress in 6000.6.X

Votes

0

Found in

6000.4.0a1

6000.5.0a1

6000.6.0a1

Issue ID

UUM-137041

Regression

No

In a Web build AudioClip.loadState can report wrong value for clips recorded with Microphone

Web Platform

-

Steps to reproduce:
Prerequiste: A microphone or headset needs to be connected to the device.

  1.  Open attached project [^web-microphone-bug.zip] .
  2.  Click on "File > Build Profiles".
  3.  Switch to Web platform.
  4. Click on "Build & Run".
  5. In the browser allow to access to the microphone
  6. Check for errors in browser console

Actual results: An error is logged to the browser console "Can't get data from microphone sound clip because data is not yet decompressed." and data is not loaded.

Expected results: The audio data is loaded and "Got Clips successfully!" is logged to the console.

Reproducible with versions: 6000.4.0b7, 6000.5.0a1, 6000.6.0a1

Not reproducible with versions: None

Can’t test with versions:  Versions before 6000.4 do not support the Microphone API on the Web Platform.

Tested on (OS): Windows 11

Notes:

  • The main issue is that AudioClip.loadState seems to return a wrong state for a brief moment after Microphone.End(deviceId) is called. It should report Loading immediatly after recording is stopped while the compressed audio data is still decoding. Instead it is reporting Loaded at first before it switches to Loading.
  • As a workaround it is possible to wait for a few seconds after calling Microphone.End(deviceId) before querying the loadState.
  • Prebuild project [^MicrophoneTest.zip] [^MicrophoneTestWithWorkaround.zip]
  • Bug was reported by user on the forums: [https://discussions.unity.com/t/microphone-audio-load-state-issue-in-webgl/1712173/14]

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.