vananasun Posted March 30, 2023 Share Posted March 30, 2023 (edited) Hey so, I fired up the ROM for AvP as raw audio bytes, and found that the audio data looks and sounds like uncompressed 8-bit PCM. I had to flip the bottom part of the wave using the formula `(if sample <= 127: sample = 127 - sample)` to remove most distortion. However, as you can see in the screenshot, our beloved "thonk" sound has a strange distortion to the waveform, it looks a bit too square. Is this a common problem in ripping sounds from Jaguar ROMs? Is it possible that it's some other weird bit depth such as 7-bit, 12-bit? In the attachments I added the raw audio bytes cut from the ROM, aswell as the partially converted wav file. Hope anyone has a clue about this Cheers ~Maxim output.wav dumped_audio_bytes.raw Edited March 30, 2023 by vananasun Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted March 31, 2023 Share Posted March 31, 2023 (edited) The sounds are compressed using Atari's SNDCOMP utility (part of the software synthesis tools provided in the Jaguar SDK). I looked at the DSP assembly source, and the decompression process is equivalent to this: 1) read sample value as a 8-bit unsigned integer 2) convert it to 16-bit signed integer with zero extension (so the value stays unchanged) 3) if the value is less than 128, square it 4) if the value is 128 or more, subtract 128, then square it, then negate the result audio.wav Edited March 31, 2023 by Zerosquare 3 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted March 31, 2023 Share Posted March 31, 2023 Hmm, not really a compression. Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted March 31, 2023 Share Posted March 31, 2023 It's a 16-bit to 8-bit companding scheme, to be precise (pretty similar to A-law/µ-Law, but with a square root instead of a logarithm). The subjective quality is better than 8-bit linear, but not as good as 16-bit linear. 1 Quote Link to comment Share on other sites More sharing options...
vananasun Posted March 31, 2023 Author Share Posted March 31, 2023 8 hours ago, Zerosquare said: The sounds are compressed using Atari's SNDCOMP utility (part of the software synthesis tools provided in the Jaguar SDK). I looked at the DSP assembly source, and the decompression process is equivalent to this: 1) read sample value as a 8-bit unsigned integer 2) convert it to 16-bit signed integer with zero extension (so the value stays unchanged) 3) if the value is less than 128, square it 4) if the value is 128 or more, subtract 128, then square it, then negate the result audio.wav 3.04 MB · 78 downloads I could have never figured this out on my own. Thank you so so so so so much!!!!!!!!!!🤩 For future reference, I created a script that extracts it from a ROM file automatically: https://gist.github.com/vananasun/cc19eb8204d1f716d1303af604a1fd03 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.