Your best bet then, for total control (as far as that goes with unknown input)
is probably to use a specific software synth, such as FluidSynth.
If all else fails, you might fast forward the audio stream (ie running the
callbacks full speed, discarding the output) until audio is detected, and then
revert to normal operation. That way, the sequencer/synth won’t even be aware
that anything unusual happened.
But, quality sound consumes quite a bit of CPU power. You can easily have
"studio quality" on a proper PC these days, but Intel Atom or weaker might be
problematic…On Monday 08 August 2011, at 15.03.03, Mason Wheeler wrote:
Only if I have direct control over all music to be played. Which I don’t,
since I’m writing an engine, not the game itself. So it has to accept
whatever’s given to it and play it properly.
From: Beoran
Subject: Re: [SDL] SDL_Mixer: Improved MIDI playback patch
Forest’s idea is not a bad one, but then it should also be implemented for
all other kinds of music on all platforms that SDL_Mixer supports, for
consistency’s sake.
It will probably less work just to edit the input files and get rid of that
leading silence if you don’t want it, though, than to implement such a
feature in SDL_Mixer…
–
//David Olofson - Consultant, Developer, Artist, Open Source Advocate
.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://consulting.olofson.net http://olofsonarcade.com |
’---------------------------------------------------------------------’