Hello everyone :-)
There was almost no time at all, the previous week... Starting from today, I'm back on this, and I'm hoping to understand the problem.
First, here's something interesting I found online:
http://www.bitsavers.org/components/nec/_dataBooks/1989_DSP_and_Speech_Products_Data_Book.pdfNEC used to sell a PC add-on card, called "NV-300 System µPD775X Family Speech Analysis Tool" (or "Speech Analysis System"), that would allow you to digitize the sound, edit it, trim it, filter it, play it, convert it to ADPCM, then back to PCM (for evaluation), and finally "convert the ADPCM data to µPD775X HEX file" for writing to the ROM.
You can search the pdf with "NV-300" to see details, and a photo of the card.
In page 1-35, it shows the chips that NV-300 would create sounds for:
µPD7755C/µPD7755G
µPD7756C/µPD7756G/µPD77P56C/µPD77P56G
µPD7757C/µPD7757G
µPD7759C/µPD7759GC
In page 4-29, 4-30 and 4-31 you can see the product details, including a photo and two diagrams.
In page 4-33 and 4-34, you can see another peripheral, called "EB-7759 µPD775X Demonstration and Evaluation Box", that was used for evaluation of the sounds. It could be used as a stand-alone unit, or be connected to a PC, or "be plugged into the target hardware to emulate the masked ROM parts".
A newer version of NV-300 is NV-301, and there is also a newer model, NV-310.
I found all that very interesting, but not very helpful, with the file :-}
I have some new observations:
1. Using sox, I created 8 different variations of ADPCM sound. If I look at the bytes with a hex editor, I can see that most bytes are the same, but there are differences. I tried them all, and in the game, the sound the same.
2. I found this page:
https://rutube.ru/video/87049aff131218a5d9bc3122fd866cc9/ that has a link to a zip file with voice ROM dumps (that are not for a System 16 game, but a device called "AlliedSignal Mk VII Warning Computer").
In Golden Axe, I could see similar repeating bytes near the beginning and the end of the sound files, like many 11 bytes. I don't know if they are sound data, or if they are some kind of command bytes. I see that they are common in these dumps as well. E.g. the first bytes in a sound are:
00 FF 00 01 53 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 11 11 11 11 11 11 1A 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 31 CB 46 4D EA 24 3A 92 51 CC B2 28 BB 93 43
3. I have tried pasting the new ADPCM data after all these 11s, over the original sound file, but the result sounds the same, always.
4. I have inserted sounds from these dumps I found and they sound perfectly, in the game, whether they have 11s, or not. This means I can use sounds from other games, which is good, just not what I currently want.
5. Maybe the first two bytes (FF 00) are not necessary, as the sounds in that dump doesn't have them! I'm thinking they are a kind of command that maybe initializes something.
6. After some attempts, I have noticed a side-effect. After I play the sound, the sound volume is reduced. If I play it again, it's reduced even more. If I play the next sounds, they are also affected. Sound 04, the fifth one, sounds loud again and restores the volume level for all the sounds.
7. I have found M1 written in C#:
https://www.codeproject.com/Tips/646359/M1-NET-Decrypt-Arcade-Audio, maybe it will help me read the M1 code :-)
8. I have found a thesis with a title "Subjective tests on 32 kbps CVSDM and ADPCM codecs for business satellite communication systems":
https://openresearch.surrey.ac.uk/v...ePid=13140690740002346&download=trueIt has a chapter called ADPCM CODECS SOFTWARE IMPLEMENTATION, with these two parts:
The NEC ADPCM encoder algorithm implementation (page 204, 216 in the pdf)
The NEC ADPCM decoder algorithm implementation (page 219, 231 in the pdf)
9. If I convert a sound to wav and then back to ADPCM (and take care of the 53 bytes), the original and the new ADPCM files have big parts that are the same, and small parts that differ. The same happens with different variations of ADPCM. I'm almost sure that the correct ADPCM variation isn't VOX, or IMA, but NEC ADPCM. Probably Audacity can decode NEC ADPCM and that's the reason it produces a clear wav file.
I believe the only way would be to implement the "NEC ADPCM encoder algorithm", as it's in the previous pdf. All other ADPCM variations will have noise and hissing, because too many bytes are different, even though the voice can be heard because of the common bytes. I will keep searching in the Internet for a possible implementation, but I don't think there is one.