[Top][All Lists]

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

[fluid-dev] Sample streaming

From: Peter Hanappe
Subject: [fluid-dev] Sample streaming
Date: Thu, 27 Mar 2003 13:59:18 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1

Hi all,

I gave streaming sample support another thought. I think we can add
this feature in the synthesizer in a simple way:

The sfont loader continues to create the sample structure, as is now,
but allocates a data buffer with a fixed size of 32kB, for example. It
also sets the loop points to the end and beginning of the buffer and
fills the buffer with 32kB of samples.

The sfont loader also defines a number of "alert points" or offsets in
the data buffer. Whenever the voice crosses an alert point, the
sample loader is called back. The sfont loader can then fill the
data buffer with new samples.

The only "tricky" bit is that the 8 samples before the loopstart point
have to be the same as the 8 samples before the loopend point. The
sample loader has to make sure that these samples are copied.

And that's most of it, for the synthesizer at least. This circular
buffer strategy with notification points is also used in DirectSound,
albeit not very well implemented (because not real-time capable).

The sfont loader, however, will have to do some intelligent sample loading and caching, probably using lock-free techniques. Maybe the
synthesizer could offer some API and data structures to help with
the loading/caching.

Wadya think?


reply via email to

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