You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm just trying to schedule a buffered AudioPlayer, at multiple, specific times. I am running entirely in offline mode. For context, my code currently looks like this, which I've had to do the following to avoid weird pops when playback starts: (sampleTimeDelay function just calculates the delay correctly based on the buffers sample rate)
^ (I mention this in case any of it looks weird. Because I was also expecting to not have to call play on the node after scheduling, but if I remove play nothing plays back.)
Anyways, rather than calling the schedule function as above, I'm essentially just trying to do this:
But if I do that, then the last call to schedule overrides all the previous calls, and it only plays at the the time for the last value in the array.
So I thought I could work around it by using the completion handler to reschedule/ play the buffer after it stops (although that's not really what I want either because then if the sample is > length than the pause it won't trigger), but the completion handler isn't called at all when engine is in offline mode it looks like.
Any idea how I can achieve this, or whether I'm missing something obvious?
Crash Logs, Screenshots or Other Attachments (if applicable)
No response
The text was updated successfully, but these errors were encountered:
Are you trying to schedule multiple different nodes? Or are you trying to schedule a single node to play at multiple times? From what I can tell, calling .schedule(at:) more than once will just replace the existing scheduled AVAudioTime. So once your code is compiled, the last item in trigger_at_times is what will be set.
Also is the actual issue here the popping that occurs when playback starts?
macOS Version(s) Used to Build
macOS 12 Monterey
Xcode Version(s)
Xcode 14
Description
So I'm just trying to schedule a buffered AudioPlayer, at multiple, specific times. I am running entirely in offline mode. For context, my code currently looks like this, which I've had to do the following to avoid weird pops when playback starts: (sampleTimeDelay function just calculates the delay correctly based on the buffers sample rate)
^ (I mention this in case any of it looks weird. Because I was also expecting to not have to call play on the node after scheduling, but if I remove play nothing plays back.)
Anyways, rather than calling the schedule function as above, I'm essentially just trying to do this:
But if I do that, then the last call to schedule overrides all the previous calls, and it only plays at the the time for the last value in the array.
So I thought I could work around it by using the completion handler to reschedule/ play the buffer after it stops (although that's not really what I want either because then if the sample is > length than the pause it won't trigger), but the completion handler isn't called at all when engine is in offline mode it looks like.
Any idea how I can achieve this, or whether I'm missing something obvious?
Crash Logs, Screenshots or Other Attachments (if applicable)
No response
The text was updated successfully, but these errors were encountered: