Play an audio subsegment

I want to play back a subsegment of an audio, and while I can specify a precise starting point, it’s not clear what the best approach would be for ensuring it stops playing where I want it. Obviously I can get status updates at a high rate (for better precision) and stop the audio when the endpoint is reached. Is there some better way to do this?

Ok figured it out. you can use setPositionAsync to start playing at a certain time and you can use setTimeout and call stopAsync to stop the audio after some time has passed.

1 Like