Continuously looping audio produces glitches

When creating a continuous audio loop, there is a very noticeable gap in the audio between every loop. How can this be prevented so that the audio loops continuously, without a break? In this case, using a rushing water background sound. Need to prevent a break in the sound. Would a different sound file format produce a different result (I’ve noticed this in some other js sound file libraries like howler.js).

Here is the relevant code:

import { Audio } from ‘expo’
const backgroundObject = new Audio.Sound()

async play() {
try {
await backgroundObject.loadAsync(
require(’…/assets/sounds/background001repeating.mp3’),
{ isLooping: true }
)
await backgroundObject.playAsync()
} catch (error) {
// An error occurred!
}
}

Thank you

Hey @cdcv,

Could you put your code into a Snack so we can test it?

Cheers,
Adam

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