[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] File output with FluidSynth API
From: |
David Henningsson |
Subject: |
Re: [fluid-dev] File output with FluidSynth API |
Date: |
Thu, 11 Feb 2010 18:56:41 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Felix Krause wrote:
> Hi all,
>
> I'm trying to save FluidSynth's audio output into a file using the API. My
> code basically does this:
>
> - get settings object with new_fluid_settings
> - set audio.driver to "file"
> - set audio.file.* settings (tried different output types - raw, aiff, wav)
> - create synth with new_fluid_synth
> - create audio driver with new_fluid_audio_driver
> - load a SoundFont
>
> And for testing:
> - do some sound output with fluid_synth_noteon / noteoff
> - create a midi player with new_fluid_player, load and play a midi file with
> it
>
> The file specified by audio.file.name is created, but FluidSynth does not
> write anything to it. Did I miss to do something in order to start writing
> the output to the file?
First, if you want output as fast as possible, and then I suggest you
use the new filerenderer API (see fluidsynth.c's fast_render_loop
function for inspiration).
Otherwise I think your version should work, assuming you wait a while
between doing new_fluid_audio_driver and delete_fluid_audio_driver. At
least you should have a file larger than 0 bytes.
// David