Chained audio sources

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Chained audio sources

Post by _ex_ »

Hello,

I was trying to implement a custom loop for playing background music.
I wanted to loop only on some section of my music track, so the initial part doesn't loop.
I think there is no support for this in the engine, isn't it?
So I was reading the OpenAL implementation to see if I get a clue how to do this, but it seems that there are some issues I was not aware both with the OGG and OpenAL support for quick seeking and callbacks (they don't support it).
However I found that OpenAL can chain sources for continuous playback. Has somebody tried to do this?

cheers
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Chained audio sources

Post by The Burrito »

You can use audacity or something to break the files up, load them all, and play the first one (looping off)
Then check each frame if songpart1:isStopped() then start playing the next one.
It's kind of ugly but as long as your FPS stays pretty high you shouldn't notice the track switch. I did a quick test where it broke in the middle of vocals in a song and I couldn't hear the break.

I'd like to see a callback for playback ended actually, it would make audio management a lot cleaner.
User avatar
Ruirize
Prole
Posts: 20
Joined: Tue Dec 13, 2011 9:02 pm
Location: England
Contact:

Re: Chained audio sources

Post by Ruirize »

+1. Excellent idea.
User avatar
_ex_
Citizen
Posts: 65
Joined: Thu Dec 08, 2011 2:59 pm

Re: Chained audio sources

Post by _ex_ »

The Burrito wrote: I'd like to see a callback for playback ended actually, it would make audio management a lot cleaner.
thanks Burrito, I was planning to do that in the worst case, but having support for chained sources or callbacks would help here.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 217 guests