Search code examples
androidplaybackinfiniteinterruption

play music infinitely until a button is clicked


I'm just trying to play music continuously in an infinite loop until a button is clicked.it works fine but,say for eg: my sound file is 5 sec. after every 5 sec there is a pause and the music plays again.Is there anyway to prevent that and play the music without interruption? I have used Setlooping(true) for that infinite loop.


Solution

  • Your problem is that your music file likely contains a short pause at the end (or the beginning). You will need to edit this file in a sound editor to make it more suitable for continuous playback.

    EDIT

    To be clear, are you looking to loop one specific sound file, or any sound file in general?