0

Real simple function here. Just trying to loop through an audio effect to maintain a sound. However when the SimpleAudioPlayer reaches the end of the MP3 file and restarts the sound with Loop enabled, there's a gap of silence about, i don't know, 250ms to 1 second long?

Is there any way to close that gap and keep the sound continuous?

            AudioPlayer = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.CreateSimpleAudioPlayer();
            AudioPlayer.Loop = true;
            AudioPlayer.Volume = 1;
            AudioPlayer.Load(MyAudioFileName);

0

Your audio file may have a tiny bit of silence at the start or end of the file. Or maybe it is not complete silence, but fade-in or fade-out.

Lô đề onlineTo test whether the problem is with the file, rather than the audio player, you can join two copies of your original file into a single file. You can do this, for example, with ffmpeg:

ffmpeg -i "concat:source.mp3|source.mp3" -acodec copy result.mp3

Then play the result.mp3 with any audio player. If you hear a silence in the middle, the problem was with your file.

| improve this answer | |
  • I've been editing the sound file with Audacity so i'm certain there's no fade in, fade out, or anything along those lines. Nor are there gaps at the front or end of the audio. – Rob K. Oct 14 at 1:29
  • welp, found that the Loop feature of SimpleAudioPlayer isn't working apparently. Soooo gotta figure that one out. – Rob K. Oct 14 at 2:12
  • And that was brief. Loop is working. And the gap's still there. hrrrrrrm – Rob K. Oct 14 at 2:14
  • Too bad the issue is with the player. You can still make the gaps appear less frequent if you combine several copies of your file into one longer file. Not ideal, but less noticeable if the gaps are less frquent. – George Oct 14 at 3:18
  • Pretty much what i figured. Not sure if there's a better player for Xamarin Forms. Used SimpleAudioPlayer because it supports multiple sounds playing at the same time. Even though it gets a bit dicey sometimes. – Rob K. Oct 14 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policyLô đề online

Not the answer you're looking for? Browse other questions tagged or ask your own question.