fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Multiple audio drivers


From: Element Green
Subject: Re: [fluid-dev] Multiple audio drivers
Date: Fri, 3 Dec 2010 10:45:35 -0800

On Fri, Dec 3, 2010 at 6:28 AM, Felix Krause
<address@hidden> wrote:
> I'd like to have FluidSynth to generate sound output and at the same time 
> write the audio output to a file. So I tried to create a "file" audio driver 
> and a "coreaudio" audio driver with the same synthesizer as parameter. Turns 
> out this doesn't work, both driver outputs are completely screwed up. Now I 
> can imagine that this just isn't the way the API is meant to be used, but is 
> there a way to properly use two audio drivers with one synthesizer?
>
> Thanks,
> Felix

I'd recommend that you implement your own coreaudio and file output
drivers.  The fluid_synth_write_s16, fluid_synth_write_float and
fluid_synth_nwrite_float functions can be used to render synthesized
audio at whatever rate your application calls them.  You could then
pass this audio on to the CoreAudio driver and save it to disk
simultaneously.  The audio will be driven by the CoreAudio callback I
suppose, so you'd want to pass the audio through some sort of lock
free queue to another thread to save it to disk.

The individual drivers built into FluidSynth weren't really meant to
be used simultaneously.

Hope that helps,
Element



reply via email to

[Prev in Thread] Current Thread [Next in Thread]