so I've got a game, and it's got ADPCM audio! Fortunately ffmpeg supports that.

all 52 variants. what the fuck

I hate audio
I hate audio
I hate audio
I hate audio
I hate audio

I gave up on ffmpeg and switched to sox_ng and now I've got it decoding, but is the quality perfect? would a slightly different set of options make it sound better?

I DON'T KNOW! I DON'T KNOW HOW TO KNOW

and the only option I have is listening to them, which I hate, and hurts
Here's an example. Hear the hiss? could that be better? MAYBE!

to make this better, I either need to listen to a bunch of WAVs with different ADPCM decoding options, OR learn the internals of the PS2's audio chip AND MIPS assembly.

To give you an idea of how much I hate audio, I am seriously considering the latter

I also can't compare two audio files! how can I tell which is better?

I listen to file 1, then I listen to file 2, but by the time I listen to file 2 I have forgotten file 1.

I can easily visually diff two images or show them side by side but I can't do that with audio

so using sox_ng with -r 24k -c 1 -t ima -e ima-adpcm seems to be "close enough".

Comparing to playing the game in the emulator, it's seems Very similar in shitiness.

yeah, lining them up in tenacity:
This is the same audio, they just both sound like shit.
@foone mvsep.com has some enhancement and denoise models. works fine with temp-mail.org too
@foone do you have hearing in both ears? You could put one file on each stereo track :)
@foone find a way to play both simultaneously and switch between them when you press a button?
@foone hard-pan left and right if they're mono-ish maybe?
@foone A/B tester. i remember using these when comparing mp3 compression settings.

@foone

I have this problem at the optometrist when they ask me which one is sharper, A or B?

Explaining and attempting to fix up the clipping and dynamic range compression of every RHCP album from *One Hot Minute* to *The Getaway*!

Posted in r/RedHotChiliPeppers by u/TopConcern • 263 points and 115 comments

reddit
@foone Fourier transform both files and look at the graphs to see how much frequency information each recording has. The one with better frequency range is *probably* (not definitely, especially if you're worried about digitization errors — those'll get you spurious high-frequency nonsense iirc) the better one.
@foone Sound engineer here- you just listen to a section, say the first 45 seconds. Then switch tracks. Think about one aspect each time you listen, like tone, dynamics, detail. Pick a or b for each one.
@downbeatdan that makes sense, but there's some problem in my brain which means that can't work. I have basically no auditory memory
@foone @downbeatdan I load into audacity and let both tracks play in parallel. Then switch between them with the solo or mute buttons.
@downbeatdan @foone agreed, a/b listening is the way.
@foone play one into each ear and/or do the DJ slider thing? cue them up to be in sync, then crossfade manually while listening ... ffmpeg will at least let you remux compressed audio without re-encoding, so I'd be reaching for that in this instance ... no idea whether sox can do the same but it probably can?
@foone scratch that - I think audacity or some other audio tool would probably be best in this situation, since you can select individual tracks and combine on playout ...
@foone "Audio DiffMaker" - Signal difference extraction software - DJ Life & Community / General Discussion - DJ TechTools Forum https://share.google/N0rUjUh7zVMnwzKI5
@foone audio memory is very short
@foone Find the average RMS amplitude of both waveforms. The one with the larger RMS is the better one :).
@foone
set up an actual A/B tester with various segments of the audio files. I have found around 10 seconds to be the sweet spot, since that's about as long as I can remember fine details.
https://abxtests.com/
ABX

Listening tests in the browser

@foone maybe diff the spectrograms?
@foone post them to an audiophile forum and claim that one of them (at random) is clearly superior due to your (flips bullshit card) silver-inlaid walrus ivory tone arm counterweight

@foone we have a whole group of people at my job, including myself occasionally, who routinely do this type of testing. There is software designed for don't this type of testing and different methods depending on the goal... E.g. AB vs MUSHRA.

It sounds like you would do well working for Shure. Many of us routinely prefer esoteric assembly languages over audio listening tests I think.

(I'm currently writing error coding in kcpsm3 assembly.)

@foone hm yes I see that is a problem and also possible solutions.

First, concert to a lossless meta format if they are identical audio files in different formats. Now you can diff the waveform from each other per channel.

The second is regular signal analysis f. I. with FFT. Which has more fullbamd scatter/noise?how compare the base band energy signatures. Which file has more bass or more fidelity? More overall spectrum?

Anyhow, audio sure IS a medium to perceive and that is hard to automate 😬

@foone
Would diffing spectral analysis images do it? I can see that showin wierd hisses, clicks and missing frequencies quite well

@foone For comparing the audio by listening, I usually use Foobar2000, load both tracks and right click > Utilities > ABX tracks... Really good for blind comparison, allows you to use Replay Gain and DSP if needed.

There's also Utilities > Bit-comparev tracks... That would do a full decode and bit-bit comparison (but not useful if you're comparing different compressions of the same track obviously)

@foone And visually I use Adobe Audition or Audacity;
in Audition once you load the tracks make sure you enable from the menu View > Show Spectral Frequency Display (or Shift+D), you can fine tune things visually from the additional options when you right click the scale in the right side. (not sure if it shows spectro in multi track mode though)

(sorry for the bad photos 💜)

@foone
In Audacity you can open both files automatically in multitrack, right click the white space to the left and choose "spectrogram", then for better visibility of higher frequencies you can right click the frequency scale and choose "Linear" and "Zoom to Fit" as it usually ignores the 18Khz+ view

As you zoom in you may visibly spot the places where frequency cuts, compression, and a lot of the issues of possible hisses, weird tones, or psychoacoustics gone rogue
could've happened.

@foone hmm isn't there an SDK around that could give a hint about the actual variant?
Also, don't you need initial data from somewhere?
@mmu_man no sdk, this is technically an ADPCM variant designed for the game itself.
@foone bleh…
Can't you record the actual game being payed at some point?
@mmu_man I can, and I am, but that means I'm listening to it after processing, and with background music and sound effects
@foone no support in vgmtrans?
@foone maybe you could do that thing where you write an algorithm that measures the input for compression artifacts so you can process the data without touching it, a-la the prison scene in _Cryptonomicon_
@Unixbigot @foone favourite use of keyboard LEDs ever ...

@foone my personal instinct says the "hiss" might be saturation

don't know if they did the recording wrong or if it's a playback issue, but it's present in loud instants and not present in quiet instants (and it doesn't sound like noise gate falloff which would almost certainly be during recording or encoding)

however, this is not my job

@foone Did you find variant 53? ​
@foone sound is truly the devil's qualia

@foone

I'm choosing to believe your hatred here belies that you actually typed all of this, and it was not cut and paste.

@foone all five eras in one toot?
@foone youll only hate it more when youre forced to make your own audio codec to work on old hardware

@foone we can’t hear you!

(I’m a terrible person)

@foone ADPCM depends on a lookup table for its encoding. The LUT isn't embedded in the file. You just have to Know which one the file uses.
@foone ffmpeg really is the swiss-army chainsaw of the media format world ...
@foone and yet, international phone calls all agree to be alaw PCM
@foone oh yeah I recall having to add one of them… painful.
@foone one for each week in the year