On 2012-06-15 01:12, ju...@cy... wrote:
> Hi. I was wondering how hard it would be to add flac import support for
> the sfz engine.
>
> I looked into src/engines/common/SampleFile.cpp. The thing I find most
> confusing there is the non-local interaction with Synthesize::GetSample
> for 24 bit samples (according to a comment there). Can somebody who
> understands this comment on whether or not it is tricky?
>
> Also, would it be simpler to use sf_readf_ only, rather than
> sf_read_raw for wav and sf_readf_ for others? Maybe this
> little code section could be tidied up and we could get
> more import formats along the way?
Raw 24 bit samples are used to save some memory for the disk streaming
buffers. A single sample frame takes three bytes instead of four.
So, support for 16 bit flac files should be very easy to do. 24 bit is a
bit harder, SampleFile::Read has to transform the 32 bit integers to 24
bit in the buffer. Another option is to use 32 bit buffers and add
support for that in Synthesize::GetSample.
/Andreas
|