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: 2063
Joined: Mon Jun 17, 2013 12:00 pm

SoundQueues

Post by raidho36 »

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: 3166
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 »

It's how OpenAL works.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

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: 4946
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 »

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: 3468
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 »

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: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

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: 3468
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 »

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: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

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: 3166
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 »

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: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

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: Bing [Bot], Google [Bot] and 4 guests