AudioSource.PlayScheduled doesn't work as expected if AudioSource has been Paused

Hello :slight_smile:

Using Unity 2022.3.13f1

I am having an issue when using AudioSource.PlayScheduled when I have paused the AudioSource, with AudioSource.Pause.

PlayScheduled works as expected when AudioSource hasn’t been started yet : I can reliably sync my game with the music.

However, if I pause the AudioSource, and try to use PlayScheduled again, the AudioSource will resume playing instantaneously.
Despite any dspTime I am trying to set, ahead of AudioSettings.dspTime, the AudioSource is always playing instantaneously if it was paused before.

I do not have this issue if I stop the AudioSource, (re)set the AudioSource time to the time when it has been stopped, and call PlayScheduled.

Should we be able to use AudioSource.Pause and AudioSource.PlayScheduled together ? Or do I have to Stop->PlayScheduled everytime I want to pause the AudioSource or move its playback time ?

Thanks in advance !

I feel like using .Pause should not be an issue and I don’t believe this behaviour is “by-design”. I’m glad you got a workaround, but this would certainly be worth filing a bug!

Thank you for spotting this! :slight_smile:

1 Like

I’ll try to submit a bug report during the week :slight_smile:

Also, I saw you’re posting a lot in this subforum : it is very welcome to have a direct contact with a Unity dev !

1 Like

Thank you for noticing!

It’s not part of the job per se, but no one argues when we spend an hour here and there to support the community. It’s much better than looking at the editor compiling :stuck_out_tongue: