Modifying/Generating streaming Sound Data

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
kefka
Prole
Posts: 9
Joined: Thu Feb 17, 2011 3:34 am

Modifying/Generating streaming Sound Data

Post by kefka »

So i've been playing around with audio synthesis in love/lua. I'm very pleased with how its turning out.

I'm able to compose various functions to create a 'synth definition' with a main function f(t). I can then sample f(t) for N seconds using love.sound.newSoundData(), and then play back the created sample using love.audio.newSource(data).

This works wonderfully for creating small samples, combining them into an instrument, and allowing you to play them back. I'm happy with the performance.

What I want to do now is steadily stream samples out from the synthesizer function. One way of doing this would be to create new audio sources regularly and chain them back to back, but of course this will have horrible issues with synchronization and wont be a smooth signal. I notice there is a decoder object, which sends chunks of samples gradually to the audio system, but there doesn't seem to be any way of getting at its internal sound data.

I suppose my question is this: Is there any way to essentially 'fake' a streaming source, by generating my own buffered queue of sound data, that the love audio engine can play from?
kefka
Prole
Posts: 9
Joined: Thu Feb 17, 2011 3:34 am

Re: Modifying/Generating streaming Sound Data

Post by kefka »

shameless bump, my last attempt!
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Modifying/Generating streaming Sound Data

Post by thelinx »

As far as I know, this isn't possible with the current audio architecture.
User avatar
NÖÖB
Prole
Posts: 41
Joined: Thu Jul 31, 2008 10:57 pm
Location: Norway

Re: Modifying/Generating streaming Sound Data

Post by NÖÖB »

This is the closest I've come to achieving a sound buffer (last post):
http://love2d.org/forums/viewtopic.php? ... 583#p36426

Not very usable, but the sine wave file could be replaced by user generated sound data, then queued to fill the buffer.. I guess?
Post Reply

Who is online

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