Delay in sound loop?

Hello,

I am using a BY8X01-16P sound module and the following code to loop a sound and there is a short space with no sound in between each instance of the sound playing. Is there a way to make the sound loop seamlessly?

Thanks :slight_smile:

// BY8X01-16P-Arduino Simple Example

#include "BY8X01-16P.h"

BY8X0116P audioController; // Library using default Serial1 UART and no busy pin hookup

void setup() {
Serial1.begin(9600); // Serial1 must be started first - only supported UART baud rate is 9600

audioController.init(); // Initializes module

audioController.setVolume(25); // Sets player volume to 25 (out of 30 max)
}

void loop() {
audioController.play(); // Plays 001.wav sound
}

It is likely that the delay is part of the WAV file. Get an application called Audacity (free) and remove the silence at the start and end of the file.

Thank you Grumpy_Mike for your reply.

The sound file was created in Audacity by someone familiar with the software. It has been checked and there is definitely not silence at the beginning or end of the file. Placing multiple versions of the clip end to end in Audacity does not recreate the silence, that's why I thought it is a code issue.

Thanks

Not a code issue, might be a hardware issue with the sound player, although I would not bombard it with many hundreds of thousands of requests to play the same file, I would wait until the file actually finished before asking it to play again.

Thank you Grumpy_Mike, I think I'll need to make use of the Busy pin.