Tell me what's wrong with that and I'll try to help you :)
I know that this can be done even in web games made with javascript without any framework, because a client once asked me to make loops of this type for his game made purely in javascript. The trick was simply to have an audio listener so that when the playback reached the end point, it immediately jumped to the start point.
I would say that concept works for practically any engine.