Home | Forums | What's new | Resources | |
Can you Convert Aif/Wav to .ADP? (Saturn XA Adpcm) |
LackofTrack - Mar 31, 2018 |
LackofTrack | Apr 1, 2018 | |||
The header of an ADP file looks to be a standard AIFF header except it has the tag "APCM". Besides that it seems to be regular XA audio. Here is a page I found about someone adding support for it to FFmpeg. https://patchwork.ffmpeg.org/patch/7100/... I don't think writing a header only will work because when I tryed to copy a header over using a hex editor the song would play but, it would have tons of static over the actual song. Looking over different sites this seems to be a common problem with XA files that don't have any filters within them. For making AIFF files the process was really simple for me. I just used a program called audacity and converted wav files to Aiff. Saturn games that use AIFF files seem to work just fine with them. I don't know about the tone editor though. |
LackofTrack | Apr 1, 2018 | |||
No special options were used. I just set it to export a 16Bit AIFF file but, I'm pretty sure 8Bit will work too. I'll see if tone editor will accept the Aiff file. |
Ms. Tea | Apr 1, 2018 | |||||
That's my patch. |
LackofTrack | Apr 1, 2018 | |||||||
XL2 I think I know why the Sega Tone Editor wasn't accepting your files. I think it has to do with the size of the Aiff file. When I tried to put in a mono 12 second file at 22050hz it wouldn't take the file but, when I put in a mono 1 second file at 16000hz it accepted it just fine. You might have lower the sample rate of your Aiff files and make sure there VERY short. So you did create that patch Ms.Tea! I knew the submitter name seemed familiar As For encoding Xa audio Aiff files I found some more information about different formats of them. Here's a few quotes from the SBL Program Library User's Guide 3.
I think this is the Program Sonic Team (and other developers too perhaps) used to convert Aiff files to XA ADPCM audio but, I can't find any information on the program. |
vbt | Apr 1, 2018 | |||
why don't you use the sega adpcm encoder, i've just tried it and it worked well, aiff size was 1.2mb, the adpcm size is around 300kb |
XL2 | Apr 1, 2018 | |||||
Thanks. I managed to read the files simply by using another Mac emulator. So now I got the tone editor to work, I must figure out how to generate sequences and how to read the files! |
vbt | Apr 2, 2018 | |||||
which one are you using, basilik 2 is working well, i had some bad behavior/trouble before finding the right settings : |
XL2 | Apr 2, 2018 | |||||
Yes, I also switched to Basilisk and it works fine. I just need to figure out how to use the tone banks now. |
vbt | Oct 7, 2018 | |||
(bump) anybody tried to play ADPCM files (best with sbl lib) on saturn ? does it costs some speed on SH2 to decompress file ? |
Ponut | Oct 7, 2018 | |||
In my experiments, I never managed to get SGL or SBL to play the ADPCM files. I could get the stream and sound system to report no errors, but no sound would play. I COULD get it to play the ADPCM files as uncompressed PCM, but doing so obviously produced garbage (it did not decompress it). I know this doesn't help you, but my understanding is that the ADP library that we have available is either broken or in dire need source code to look over and understand. If I had any guess for their usage, you probably need to decipher the ADP_DecMono and/or ADP_DecStereo commands to figure out where they send the decompressed audio (somewhere in sound memory). Then use SND_PCM_ON with that area of memory as the target. You could scroll through sound memory 16 KB at a time to try and find out where it is, if it even works. The object code for the Saturn ADP library is for the SH2s, so those are unquestionably what would handle the decompression. There are ADP decompression/playback libraries for M68K family processors out there, if you understood how to integrate that into the sound driver (assembly), you would probably have an easier time than deciphering the ADP library. |