Seamless audio loop

Is there a way to have an audio file playing back in a seamless loop?

I have a couple of music files that I have edited so that it can play in a loop.
The music has an intro. After a few seconds I have point that matches the end of the audio clip. After that clip is done, I want to playback to jump back to that “loop-point”, and seamlessly continue playing.

Is that at al possible?

EDIT:

Too bad that the AUPlayerMBS is not cross platform. That would actually work perfectly.

Does anybody know if there is a Windows alternative?
I use MacOS myself. But I would like to make my app cross platform, in the future

2 Likes

You mean the Sound class?

https://documentation.xojo.com/api/os/sound.html#sound
playlooping = true

Not really. It does loop. But I need to be able to set the exact loop points, like it is possible with the AUPlayerMBS class.

Yeah, it’s kind of a leap of having a sound loop not just “over and over again” but it starts at the beginning, goes to the end, continues starting at a point in the sound file, goes to the end, continues at that spot in the sound file. Most/all in-the-box sound players don’t include this. AUPlayerMBS is a wrapper around CoreAudio AUPlayer, which has pro-leanings.
A couple long-time REAL/Xojo users here (me, Aaron Andrew Hunt, others) have apps in the mainstream where we use usually the MBS audio features and have built our own sound system, where SS SE LS LE is possible. (SampleStart SampleEnd LoopStart LoopEnd) The nice thing about our own system is that it allows for streaming (no need to preload into memory), allows progress callbacks, and (for me) dealing with crazy audio formats. And of course you want it seamless - no clicks or artifacts.
But, yeah, you just want SS SE LS LE, and no, not any easy solution. I wish I had time, I’d make a free version of my system, but long ago it got too complicated…