wavfix icon indicating copy to clipboard operation
wavfix copied to clipboard

[suggestion] ADPCM / IMA ADPCM / VOX ADPCM or other variants support

Open deton24 opened this issue 4 years ago • 4 comments

Hello. Thank you very much for your tool. If you're looking for some challenge, that may be interesting feature to implement.

Sometimes it happens that some files have corrupted headers, but can be played by only limited amount of players (usually MPC-HC and/or VLC Media Player) but not DAWs. I encountered such situation while trying to rip e.g. Call of Duty Black Ops music from game files. There might be more usage scenarios of the tool, not only when recorder suddenly stops and a file becomes corrupted.

Here is a sample: https://yadi.sk/d/olYaOUQZFgmz8A

I had also some VOX ADPCM variant files which couldn't be decode by RAW import option by Audacity neither.

I know that I can convert the file with VLC or probably SOX, but editing just header would be something different.

Regards

deton24 avatar Apr 18 '20 02:04 deton24

Hi,

I made wavfix to work with the most common WAV cases, that is files containing PCM audio streams.

I know that WAV files can embed many other audio types, however i have not encountered any real case yet (does someone really put mpeg audio in a wav ?). However, if any non-PCM audio wav file is widely used and is subject to poor implementations / errors, wavfix should be able to handle it.

I just had a look to your file sample. I was very surprised that my VLC could read it, since the file structure has nothing to do with wav (no RIFF/WAVE first bytes, no "fmt " nor "data" chunk). Then, i ran ffprobe on it, and the truth finally came out. Despite the .wav extension, your file is actually a boa (Black Ops Audio) file format. This is confirmed by a look into the first bytes and the probe function of boa decoder of ffmpeg.

So this file is not a wav that needs to be fixed, it is a boa pretending to be a wav. So it needs to be converted into a real wav file, with a real wav structure. And sadly, wavfix is not a converter.

However if you have any proper ADPCM wav file, i'd be happy to work on its support.

Thank you,

Adrien

agfline avatar Apr 20 '20 13:04 agfline

Thank you very much for your reply.

Here I attach music files from Splinter Cell Pandora Tomorrow PS3. These are SS6 files which can be imported through Audacity so it has to be some sort of WAV. Previously I unconsciously imported these files with dithering enabled by default in Audacity, so I deteriorated quality unnecessarily since it wasn't the case of using it.

Some of these files may be decoded by decubisnd but I'm not sure by now, since software version has changed and at least one file wasn't able to decode properly, if not all.

https://drive.google.com/folderview?id=0B-K2BYRj3-9TaldzSFFZLWp3Nzg

deton24 avatar Apr 21 '20 20:04 deton24

Ok, just had a quick look at one of your SS6 files.

ffprobe and mediainfo did not recognized it.

So i tried with audacity like you said, and the only way i could import SS6 is by choosing import > raw data. This works also with WAV files, but when you import a WAV as raw data you have some digital noise at the beginning. This is actually the WAV file header data being interpreted as PCM audio samples (that's why audacity allows you to apply offset when importing). This was not the case with SS6, since when zooming in you can see the proper audio waveform starting at the very first byte.

So in conclusion, SS6 files seems to be raw PCM 2 channels 16bits (probably 44100Hz) audio stream. You can easily process them with ffmpeg to get proper WAV files, if that is what you're looking for.

Regards,

Adrien

agfline avatar Apr 21 '20 21:04 agfline

Thank you. That was quick. I really hope I don't wasting your time, but your skills at file analysis are remarkable. And I bet would be really helpful on boards such as zenhax, xentax, etc. - specialised in game assets ripping.

I only just tried to share with general idea of implementation of different WAV variants (e.g. ADPCM, IMA-ADPCM, VOX ADPCM).

The last unresolved mistery of WAV decoding I can remind of now, was some custom variant of VOX ADPCM files taken from Dreamcast version of Rayman 2. If I only find them again after those years.

But If you will want some examples of working different WAV formats just for headers, let me know.

Regards

wt., 21 kwi 2020, 23:34 użytkownik Adrien Gesta-Fline < [email protected]> napisał:

Ok, just had a quick look at one of your SS6 files.

ffprobe and mediainfo did not recognized it.

So i tried with audacity like you said, and the only way i could import SS6 is by choosing import > raw data. This works also with WAV files, but when you import a WAV as raw data you have some digital noise at the beginning. This is actually the WAV file header data being interpreted as PCM audio samples (that's why audacity allows you to apply offset when importing). This was not the case with SS6, since when zooming in you can see the proper audio waveform starting at the very first byte.

So in conclusion, SS6 files seems to be raw PCM 2 channels 16bits (probably 44100Hz) audio stream. You can easily process them with ffmpeg to get proper WAV files, if that is what you're looking for.

Regards,

Adrien

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/agfline/wavfix/issues/6#issuecomment-617426418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJ3EHFEMTTJ74IKSSB4AELRNYGOTANCNFSM4MLFFTGQ .

deton24 avatar Apr 21 '20 21:04 deton24