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
Chained audio sources
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- The Burrito
- Party member
- Posts: 153
- Joined: Mon Sep 21, 2009 12:14 am
- Contact:
Re: Chained audio sources
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.
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.
Re: Chained audio sources
+1. Excellent idea.
Re: Chained audio sources
thanks Burrito, I was planning to do that in the worst case, but having support for chained sources or callbacks would help here.The Burrito wrote: I'd like to see a callback for playback ended actually, it would make audio management a lot cleaner.
Who is online
Users browsing this forum: Ahrefs [Bot] and 217 guests