expo-av not working properly on android

Please provide the following:

  1. SDK Version: ~37.0.9
  2. Platforms(Android/iOS/web/all): Android

I am trying to create a “homegrown looping” mechanism to loop some nature sounds. Since expo-av does not support gapless/seamless looping, i had to “roll my own” logic. I basically create 2 players and when the first is reaching the end, the second one starts and there’s a crossfade during the final 10 seconds of the mp3 that is about to end.

You can clone this open source example to see the behavior on iOS versus Android: GitHub - happyruss/expo-fader-loop: Illustration of an attempt to seamlessly loop an mp3 using the expo-av library

This works reasonably well within iOS, but when i run it on android there are multiple issues:

  1. The playbackStatusUpdate gets called 2 (or sometimes 3) times each second, instead of just once per second like in iOS
  2. Once it moves to the 2nd sound, the playbackStatusUpdate of that second sound is not really called at all so it never crossfades back.
  3. It also seems like the component does not respect the “fading out” of the first sound in Android. the volume remains the same until it abruptly stops as it ends (instead of gracefully fading out like in iOS)

Any help would be appreciated

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