Odd Yamaha AICA by marscat85 at 9:23 AM EST on February 9, 2012
Hey all, I'm having a really hard time with this file. It looks to be Yamaha 4bit ADPCM at 88200hz. You can set it to 8Bit PCM at 44100hz as well and it sounds decent as well. I've been messing with it in genh > vgmstream test but everythings come back pretty weird.
Where did you get this from? It seems to me to be nibble interleaved IMA, though exactly what rounding model is I'm not certain. vgmstream has support for this from a particular PC game, but it isn't generally accessible otherwise. I'll look at adding support for this but I like to note what game it is from.
You can deinterleave the data with denibble (run like denibble in outL outR) and then try messing with GENH with the result. I tried with sox (after cutting off the header) and it seemed to mostly work, but it wandered quite a bit from AC so I figure someone is using the wrong IMA rounding model.
edited 7:52 PM EST February 9, 2012
OK by marscat85 at 7:52 PM EST on February 9, 2012
No, I'm pretty sure the header is 16 bytes (observe that the size/sample count at offset 4 + 16 points exactly at where the nonzero data ends), but it doesn't matter much.
I'm stumped so far, btw. I've tried the three models I know, and I'm getting no improvements. Also the audio just seems very weirdly structured. It may not be IMA at all, just something that looks a lot like it. I tried AICA but with no success.
hmm by marscat85 at 8:56 PM EST on February 9, 2012
odd, the chip the system uses is a YMZ280b
I found mame source here: http://mamedev.org/source/src/emu/sound/ymz280b.c.html
but as I am not super versed in audio programming, I really can't make heads or tails of it. I figured since it's the same as a lot of sega chips it might be similar. Very odd. Thanks for the updated header size, at least I can remove the extraneous stuff. I'll keep messing around too, but I doubt I will find something. Though I will check here for a while in case you guys get one of your famous strokes of genius!
Yeah that MAME code is what we've called AICA but which is really just Yamaha's standard ADPCM. It is possible that they don't actually use hardware to do the decoding, but they instead have some custom IMA-flavored mechanism.
Kinda figured it out by marscat85 at 9:03 AM EST on February 17, 2012
FYI, it looks like this is vox. Check out the very end of this about the reset code.
http://www.mp3-tech.org/programmer/docs/adpcm.pdf
However, it still has some quirks. The audio will play correctly but if you look at the waves, they are all out of whack making it impossible to do any real audio editing with it. Maybe the step table is different? I'm not smart enough to go much further.
Proceedure: Remove 16 byte header. Nibble Deinterleave. Use one stream and vox decode. 44.1khz, 4 bit, mono spec per channel file output.
Ah, yeah, vox makes sense. vgmstream doesn't have any support for it just yet. I see what you mean about it wandering, that's weird. [edit] As expected, it uses a different rounding model. Here's a slow decoder for python 2.6: snipADP
Run like: python snipADP.py snip.bin out.wav
You still didn't tell me what game this is from.
edited 7:00 PM EST February 17, 2012
thanks! by marscat85 at 7:46 PM EST on February 17, 2012
Thanks! It's funny you wrote that in python because this is actually used in viper hardware! My phone accidentally edited out the game name in my edit above. My friend PK and I were looking at the audio from ppp2. He figured out it was vox. But regardless thank you so much! You guys are awesome!
Oh yeah, I knew I had seen the name somewhere, but when I looked back at the post I couldn't find it. Just in case you aren't aware, the decoder I provided doesn't have the accumulating DC offset that a normal Dialogic decoder would, so it should be sufficient for your needs.