Search Issue Tracker
Fixed in 2019.3.X
[Webgl] Setting AudioSource.time or AudioSource.timeSamples after the AudioSource is paused results in smaller value than set
1. Open the attached project.
2. Run the Main.unity scene in editor.
3. Let the music play for a while (to 10 seconds for example).
The left number is the time in seconds while the right number is the timeSamples of the AudioSource.
4. Use the Play/Pause button to pause the music.
5. Use the input field above the "Set Time" button to set the time to 4 seconds (any other number works)
6. Notice that the time in seconds shown on the left is set to 4.
7. Repeatedly press the Set Time button and verify that it remains as 4.
8. Press the play button to resume playback.
9. Playback should sound normal.
10. Use the input field above the "Set Time Samples" button to set the time samples to 2200000 (for example, any other number works).
11. Notice that the time samples in seconds shown on the left is set to 2200000.
12. Repeatedly press the Set Time Samples button and verify that it remains as 2200000.
13. Press the play button to resume playback.
14. Playback should sound normal.
Now for the WebGL build
15. Let the music play for a while (to 10 seconds for example).
16. Use the Play/Pause button to pause the music.
17. Use the input field above the "Set Time" button to set the time to 4 seconds (any other number works)
18. Notice that the time in seconds shown on the left is NOT set to 4 as it should be but a lower value (3.8 for example).
19. Repeatedly press the Set Time button and notice that it becomes smaller and smaller.
20. Press the play button to resume playback.
21. The playback starts at the 4 second mark (use another media player to verify this) but the time and timeSamples given by the AudioSource and shown on screen are lower than what is actually playing.
22. Repeat steps 15 to 21 but using the "Set Time Samples" button instead.
Notes: Not reproduced in Win Standalone, confirming it's platform specific. If the playback is not paused when time/time samples are changed and you try to change set time or time samples - they are set completely correct - both text/parameter and sound-wise. It's only when paused that time parameter set gets out of sync, while still keeping it on point on audio track
Reproduced in 2017.1.0f3, 2017.2.0f3, 2017.3.0f2, 2018.1.0a7
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Incorrect Burst Exception Control Flow in Editor due to Mono Handling of calli instruction
- [Linux] Packman options to add package from Git URL doesn't always show the window directly below the + button
- "UnityEngine.SystemInfo.processorFrequency" logs a value of 0 on M1 macs
- Editor redirects to a broken page when pressing question mark "?" in the Inspector window
- Editor directs to non-existent page when pressing "Learn more..." for Asset Pipeline