cordova-plugin-nativeaudio icon indicating copy to clipboard operation
cordova-plugin-nativeaudio copied to clipboard

Gapless sound looping

Open manzapanza opened this issue 8 years ago • 4 comments

Hi there, I'm trying to loop a short sound (mp3 about 45kb) using exactly the Example Code, but between each iteration there's a little gap. I'm getting the same result obtained with the Media Audio Plugin :( (obs.: the same audio file loop perfectly with Audacity)

I tried also with many values of the delay parameter (preloadComplex method), but from the doc there's not many info about him: Change the float-based delay parameter to increase the fade-in/fade-out timing. I tried with 0, 0.1, 0.5 but I don't heard difference.

Some suggestions? Maybe I'm doing something wrong? Thanks!

manzapanza avatar Dec 08 '15 13:12 manzapanza

There is always a little time (even very short) before playing again. Maybe you can edit the MP3 to make it just end at quiet segment.

floatinghotpot avatar Dec 09 '15 00:12 floatinghotpot

Thank you for your quick reply! I tried editing the mp3 file but I not been able to resolve the problem. I would like that the audio looping it was imperceptible without any gap.. I would like to use a short audio of about 1 second and repeat many many times like a background music without any interruptions.. Do you think that is possible to achive this? Thank you!

manzapanza avatar Dec 09 '15 13:12 manzapanza

Are you on Android by the way?

For some reason Android Audio just doesn't perform, regardless of this plugin

kaansoral avatar Dec 10 '15 07:12 kaansoral

Yes I'm on Android but I need a solution that works on iOS too. So the "solution" could be create a long file to decrease the number of gaps between loops but will increase the file size too :( Now I understand why some music apps are only for iOS...

manzapanza avatar Dec 10 '15 17:12 manzapanza