31
Multimedia / Re: MMIO high storage utilization !
« on: January 06, 2024, 01:15:33 am »
It all depends on how the IOProc is written.
You can load the whole FLAC file and convert into a WAV file and hold the result in memory. That makes it easy to implement seeks,reads and writes on the converted file (which is necessary as the MMOS2 can really only play/record WAV files). But it comes at a high cost in memory as WAV needs a lot of memory.
The alternative is to work blockwise, if the source format (FLAC in this case) is organized in this way because then, only a block of input data has to be converted but not the whole file. This is more memory friendly but also more difficult to implement (think about a seek half way into the WAV converted file: what would that location match in the FLAC source file?)
I suspect that the FLAC IOProc makes use of a library that is meant to convert a complete FLAC file into a WAV file and therefore that would match the first approach.
You can load the whole FLAC file and convert into a WAV file and hold the result in memory. That makes it easy to implement seeks,reads and writes on the converted file (which is necessary as the MMOS2 can really only play/record WAV files). But it comes at a high cost in memory as WAV needs a lot of memory.
The alternative is to work blockwise, if the source format (FLAC in this case) is organized in this way because then, only a block of input data has to be converted but not the whole file. This is more memory friendly but also more difficult to implement (think about a seek half way into the WAV converted file: what would that location match in the FLAC source file?)
I suspect that the FLAC IOProc makes use of a library that is meant to convert a complete FLAC file into a WAV file and therefore that would match the first approach.