Do I have to wait until a sound finishes playing before I can play it again?

  1. SDK Version: 38
  2. Platforms: all

Suppose x is an Audio.Sound instance and I execute x.playAsync(). Do I have to wait until x finishes playing before I can play x again? So far there seems to be a delay between consecutive x.playAsync() commands. I need to be able to play x multiple times, e.g. in a game where I might fire something multiple times.

I guess the Async bit suggests this isn’t possible, but is it possible some in-built way to achieve what I want?

I guess a work around would be to create my own sound pool manager which loads the same sound say 5 times as separate Audio.Sound instances. That way I could fire my sounds in a cycle and they would appear to play synchronously.

Hopefully this wouldn’t waste memory, but not sure how expo-av would process that in the background.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.