On 30/03/2012 22:01, Aleš Keprt wrote:
> So you use your own MRLE encoder instead of Microsoft's codec? How does
> it work?

Yes, the MRLE encoder is fairly simple, and probably under 100 lines of
code.  The audio data is exactly what's written to the sound card
buffer, so that didn't need encoding.

The AVI file is just a structured RIFF file, which I write directly.
Ironically, I spent more time getting the RIFF headers correct than
actually implementing the video encoder!  Sources disagreed on some
values, and most players were very forgiving, so it wasn't easy to tell
when something was wrong.


> AFAIK lossless audio codecs aren't technically possible in ACM.

I'm not sure if I've seen an ACM codec for FLAC that supports encoding,
which might be the main problem.  I've never used the ACM API myself so
I'm not sure if there are any other issues.

FLAC works well for lossless audio, but the data might still be 1/3 to
1/2 of the original PCM audio size.  A quality lossy codec would do a
better job, but would be more demanding for encoding during emulation.


> IMO the best option for audio would be to save the SAA register values.
> I mean the best i.e. the smallest file size. That would make very short
> files, but nobody would replay those files outside our custom player.

In theory you could write an ACM decoder to support the new audio
format, which generates 1 frame worth of PCM from the SAA registers!
Probably not worthwhile, and you'd still miss out on the DAC outputs.

Si

Reply via email to