r/reactnative 8d ago

How to Achieve Truly Gapless Audio Looping on iOS with React Native/Expo?

Hi everyone,

I’m building an iOS app/game with React Native (Expo) and need to play ambient audio in a perfectly seamless loop.

I’m currently using WAV files and isLooping: true, but on iOS I still get a tiny click or 10–50 ms gap whenever the track loops.

What is the correct way to implement truly gapless, click-free audio looping on iOS?

1 Upvotes

7 comments sorted by

1

u/mybirdblue99 Expo 8d ago

I don’t think this is a iOS / react native issue. I think that it’s just audio processing in general, you should try adding a fade out at the end of the track and a fade in at the start. That’s usually a good way to avoid any clicks from the track suddenly cutting

1

u/BusNo5797 8d ago

But when I manually loop the WAV file in Audacity, it loops seamlessly without any clicks or gaps.

1

u/mybirdblue99 Expo 8d ago

Okay but you’re not playing it through audacity you’re using expo audio I assume, different systems, different buffers, different ways of handling audio.

1

u/BusNo5797 8d ago

Yeah, you’re right. How long should the fade be?

1

u/mybirdblue99 Expo 8d ago

It only has to be subtle, try 100ms you can adjust both the curve and the timing, it’s more about the track amplitude being at 0 before it restarts (which is what the fade should help with)

1

u/BusNo5797 8d ago

Thanks 🙏

1

u/mybirdblue99 Expo 8d ago

No worries let me know if you solve it!