[SOLVED] A looped engine sound sample plays with a break on repeat

Hi, all!

A looped engine sound sample plays with a break on repeat.

In Adobe Audition, the sample plays without audio interruption.

How to make it play without interruption in PlayCanvas?

https://playcanvas.com/editor/scene/1483308

Hi @SARJ and welcome! It depend on where the silence is in the sound file. If it is on start, you can adjust the start time of the sound component. If it is on the end, you can adjust the duration of the sound component.

Looking at your screenshot, I think it’s on the end. The total duration of your sound file is 2.61 seconds, so you can try to set a duration of 2.50 for example.

Great! It works for me :slight_smile:

But it’s very important to make the step for ‘StartTime’ and ‘Duration’ smaller.
I can only install 0.19, but I need 0.198 or even 0.1981 like on the screenshot. You must understand that the sound waveform changes so quickly, 0.01 step is not enough to correctly synchronize the beginning and end of the sound wave.

Thanks.

I’m afraid that’s not possible, so you need to modify the sound file in your sound editor for that.

1 Like

I believe if it’s an MP3, its not possible to loop gapless. I think OGG files don’t have this issue but is not compatible with all browsers

eg Noticeable Mp3 Audio loop gap - Audio and Graphics - Solar2D Game Engine

More info on this subject before: Mp3 looping issue

2 Likes

I think this way is fine. In the playcanvas editor, I will set the StartTime to 0.2 for example, and add the required interval to the sound file at the beginning.

And what about WAV? Doesn’t it have the same problem as MP3?
WAV is supported by all browsers?

WAV could work, it’s just a VERY big file size compared to OGG and MP3

Hi @SARJ ,

Unfortunately with the way that mp3 files are rendered, a bit of silence is automatically put at the beginning of the file once you export it out of your audio editing program. However, there are apparently methods to creating ‘gapless’ mp3’s. Here is an article explaining one method:

https://www.compuphase.com/mp3/mp3loops.htm

I haven’t tried this method myself, but you should check it out and see if it works for you.

2 Likes

“I think this way is fine. In the playcanvas editor, I will set the StartTime to 0.2 for example, and add the required interval to the sound file at the beginning.”
This is what helped me solve the problem.