fstark / macflim

MacFlim flim player source code and utilities
MIT License
90 stars 3 forks source link

Feature request: audio anti alias filter off #44

Open nsputnik opened 1 year ago

nsputnik commented 1 year ago

The audio quality is a little too good. Can there be a way to disable the anti alias filter on the encoding of both mp4 and flims so it sounds more like what we know 22khz 8 bit audio to sound like? I have even tried encoding videos where I have used a bit reduction effect but once it is encoded it still sounds too good, there is aa still happening somewhere.

There is an ffmpeg parameter called acrusher. I could not get it applied to movie file or audio file when testing but it goes something like this in ffmpeg: --af 'acrusher=bits=8:samples=22050:aa=0' But since in your docs you say it really is 22khz 8 bit then an aa off option should be good enough to get the desired effect.

fstark commented 1 year ago

(note: I am partially deaf and unable to grasp most of the subtle sound encoding issues)

Let me rephrase and confirm that I understood you right.

When encoding the 'mp4', the ffmpeg encoding machinery "corrects" the 22KHz sound, and makes it better than it should.

However, when the flim file is played on original hardware, the sound is different.

Using something like "aa=0" should disable the behavior.

The creation and configuration of the audio codec is at:

https://github.com/fstark/macflim/blob/main/src/writer.cpp#L268

This code was quite painful to write (and it shows :-))

If you have any idea what to change to get the desired effect, let me know. If not, I'll look at it later, if you confirm that I correctly understood the problem.

fstark commented 1 year ago

Re-reading your original comment, you seem to complain that the flim itself is also too good. Well, that 22KHz 8bits, it sounds exactly like it would have sound at the time, so I am not exactly sure what you’d like me to do there.