SoundQueues

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
raidho36
Party member
Posts: 1700
Joined: Mon Jun 17, 2013 12:00 pm

SoundQueues

Post by raidho36 » Fri Oct 07, 2016 8:51 pm

Any reason love.audio.newSource has to duplicate the buffer into internal storage? It would've been a lot easier to playback procedurally generated samples (especially large ones) if it could play the original soundData modified in place. As it is now I have to continuously call love.audio.newSource every time write buffer accumulates substantial length of samples to play. Having a callback triggered when read header reaches end of buffer requiring more streaming data would also be nice.
Last edited by raidho36 on Fri Oct 07, 2016 8:54 pm, edited 1 time in total.

User avatar
slime
Solid Snayke
Posts: 2814
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by slime » Fri Oct 07, 2016 8:53 pm

It's how OpenAL works.

User avatar
raidho36
Party member
Posts: 1700
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 » Fri Oct 07, 2016 8:58 pm

In OpenAL there are multiple buffers which are played back in a queue sequence, there's nothing preventing feeding it new data continuously.

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by bartbes » Fri Oct 07, 2016 10:34 pm

Which is exactly how Decoders work, though it is fed in a background thread, so just calling a lua callback from that isn't really an option.

User avatar
zorg
Party member
Posts: 2549
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by zorg » Sat Oct 08, 2016 4:36 am

And besides, there's a realtime alternative already.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
raidho36
Party member
Posts: 1700
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 » Sat Oct 08, 2016 3:21 pm

zorg wrote:And besides, there's a realtime alternative already.
Thanks! It's not ideal - I'd really prefer to use LOVE's own implements to do it to injecting into its runtime like this - but it works and it's not an ugly mess of dirty hacks.
bartbes wrote:Which is exactly how Decoders work, though it is fed in a background thread, so just calling a lua callback from that isn't really an option.
I haven't been able to find a way to produce an object that would pass for a decoder, so that I could use it to feed encompassing audio source sound data.

User avatar
zorg
Party member
Posts: 2549
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by zorg » Sat Oct 08, 2016 3:56 pm

raidho36 wrote:
zorg wrote:And besides, there's a realtime alternative already.
Thanks! It's not ideal - I'd really prefer to use LOVE's own implements to do it to injecting into its runtime like this - but it works and it's not an ugly mess of dirty hacks.
bartbes wrote:Which is exactly how Decoders work, though it is fed in a background thread, so just calling a lua callback from that isn't really an option.
I haven't been able to find a way to produce an object that would pass for a decoder, so that I could use it to feed encompassing audio source sound data.
It was talked about before, on irc mostly, but i did mention that i'd be inclined to volunteer to try and think out how löve's audio API could be improved, to include realtime data queueing onto the soundcard through OpenAL; that said, i'd rather finish my example project(s) first to show what's possible.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
raidho36
Party member
Posts: 1700
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 » Sat Oct 08, 2016 5:29 pm

As far as I'm concerned, all you have to do is expose QueueBuffers equivalent for the sound source class. Including underlying library's basic functionality in your wrapper isn't rocket science.

User avatar
slime
Solid Snayke
Posts: 2814
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by slime » Sat Oct 08, 2016 5:43 pm

raidho36 wrote:isn't rocket science.
Pull requests for LÖVE's source are welcome! We do want to have streaming Sources with queue-able data, but no one has implemented it yet.

User avatar
raidho36
Party member
Posts: 1700
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 » Sat Oct 08, 2016 6:58 pm

As I said elsewhere, I have problem navigating the source. Which files would be the relevant ones?

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests