|
|
Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis. |
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).
|
|
Thread Tools |
Wark! |
Sega Saturn And .P16 (CPK/PCM?) Audio Files
Greetings, all. First of all I want to say that I have done a bunch of searching over the last few days regarding this matter and after my exhaustive search I happened across this thread:
http://www.gamingforce.org/forums/be...ame-music.html Rather than resurrect that thread out of the depths of forum hell, I thought I'd start fresh. If you don't want to sit through my nostalgic story, skip the quote.
So with some google-fu I found out that the .p16 extension belongs to an audio tool known as ProTracker Studio 16. Many are aware that this is an Amiga program used for creating 16-track audio files not dissimilar to midis. Games like Jazz Jackrabbit use it (though I believe the extension is different, perhaps .mod was used). But I digress. Immediately, I got myself an Amiga emulator, and loaded up ProTracker Studio 16. Alas, it was to no avail. It may just be the fact that I have no idea how to use ProTracker Studio 16, or it may just not be functional - eithe rway I couldn't get the .P16 to load. One file was rather large, ~40MB - and ProTrackerStudio 16 didn't have enough memory to load it. I tried a smaller one and it didn't complain about loading it - but from what I could tell there was no information loaded. Again, maybe I just don't know how to use it properly. Out of desperation I changed the file extention and tried playing the audio through a variety of MOD players (WinAmp, JavaMOD Player, VLC Media Player). VLC was a surprise, it was able to load track length data - but not much else (although I did hear 1 sound effect used in the game during the playback of the large 40MB file - 1 split second surrounded by 2 minutes of silence). Still, I don't think the track length data that VLC was able to load was truely the length of the track. None the less, the sound effect I heard gave me hope. Early on into my search, I found this site: kingshriek's SSF/DSF page Using some tools from that site, or tools that they mentioned - I tried converting the .p16 files into .s3m files. The new .s3ms were garbage - nothing but static. So it seems I've got to try another approach. I've always liked using Cool Edit 2 Pro, but ever since Adobe bought the company out I've been using Audition and as of late Soundbooth. Upon trying to import unrecognized pcm audio, these programs have asked for the sample rate and the number of bits. It seems, this is no longer a part of the import process as I was not presented with this prompt when I imported the audio. So I used Audacity. Audacity couldn't play anything back either (but not for lack of trying) - it was all static. So it seems that now I'm back at square one. If there are any audiophiles out there that might be able to help me understand about this .P16 format, please don't hesitate to reply or send me a PM. I'd really rather not have to resport to the spindown method that Ultrace used. EDIT: Alrighty, so using the "Import RAW Data" feature of audacity I was able to select the following settings Signed 16 bit PCM Big-endian 2 Channel Stereo Start Offset 0 bytes Amount to import 100% Sample Rate 22050 hz To my surprise (and joy) it worked. Almost. I ran into the exact same issue Ultrace had in that there's a strange waver in the audio playback. If I change the sample rate to 44100 hz and move it down to a 1 channel mono - it comes up with almost the same results. So, being that I believe it to be 16 channels - I'm playing around with importing it this way. I've put the file up here: Download STAGECLR.P16 from Sendspace.com - send big files the easy way Feel free to download and give it a go yourself. How ya doing, buddy? |
The SSF tools are for synth audio, so you can ignore those (well, you can rip sound effects and Pause jingles with those). Also, ignore file extensions on console games, they can be very often game specific and have nothing to do with any other application.
I don't think I can add anything that you haven't found out by yourself. If I had to make a wild guess, I'd say that the pcm data is stored in the same way as in the Sega FILM format (used in the CPK videos - big-endian, and stereo data is in non-interleaved chunks). There's nowhere I can't reach. |
Wark! |
Good call, evilboris. I owe you a beer or something.
I researched the Sega FILM format and came across: Sega FILM - MultimediaWiki
Code:
L R | L R | L R | L R | L R | L R | L R | L R ... Now, onto a solution... I did a search for cpk2wav and came up with a hit on a japanese website. Loosely translated, I'm in the "Video Game Audio Conversion" area of the site. The utility "CPK2WAV" has the following description:
Just to be sure, I ran the program from the command line without any parameters to see if the programmer left a friendly welcome: Code:
C:\Users\Administrator\Music\Astal>CPK2WAV.EXE ébéoéjéQévé`éuüDédéwéd V0.64 usage: cpk2wav (input file) [(output file)] input file : Cinepak for SEGA file (.cpk) output file : MS-Windows wave file (.wav) Code:
C:\Users\Administrator\Music\Astal>CPK2WAV.EXE STAGECLR.cpk STAGECLR.wav STAGECLR.cpk -> STAGECLR.wav é▒é╠âtâ@âCâïé╔é═ñë╣É║âXâgâèü[âÇé¬éáéΦé▄é╣é±. If I had to venture a guess, it's complaining that there's no video data in the file. And so, I am left hanging knowing the problem, but not having the solution. evilboris or anyone else, I need help interleaving the audio in the file... Got any suggestions? EDIT: So I found some more useful tools for CPK files. Specifically what was useful was ACPK2AVI. According to the usage tagline... Code:
Another convertor from CPK to AVI. ver. 1.06 Copyright (C) 1997, GANA, Nishi SEGA Saturn Cinepak (*.cpk) / ADPCM (*.adp) -> MS Windows AVI (*.avi) usage: acpk2avi [-msadpcm] [+|-DELAY] <INPUT.cpk> [INPUT.adp|wav] <OUTPUT.avi> acpk2avi <INPUT.adp> <OUTPUT.wav> Code:
C:\Users\Administrator\Music\Astal>ACPK2AVI.EXE STAGECLR.adp STAGECLR.wav Another convertor from CPK to AVI. ver. 1.06 Copyright (C) 1997, GANA, Nishi SEGA Saturn Cinepak (*.cpk) / ADPCM (*.adp) -> MS Windows AVI (*.avi) STAGECLR.ADP: acpk2avi: FILM not found: this is not Cinepak. This thing is sticky, and I don't like it. I don't appreciate it.
~TigerC10~
|
At this point the only thing you could do was writing your own custom pcm parser.
I am a dolphin, do you want me on your body? |
Wark! |
Yeah, I had considered doing that. I read somewhere that FFmpeg had some saturn cpk support... Can't find anywhere that really demonstrates how though.
But you're probably right, with as much effort as I've put into looking for stuff it'd probably be easier to just write one myself. Found a nice description of the stucture of the format. Code:
bytes 0-3 'FILM' signature bytes 4-7 length of FILM header (including signature and length fields) Once I get in there I can reorganize the PCM data as much as I want, however it'll still require me to import the raw PCM data into something like audacity to export as a WAV... That's going to make my process for converting these files a long longer for each file. Oh well, cest la vie? No? I was speaking idiomatically.
~TigerC10~
|
The p16 files are raw audio. No header, no nothing.
Perhaps you could make a dummy FILM container that holds audio only, I haven't tried that. If converters work properly and not just by bruteforcing the video, then it could work. Even if converters suck and don't work properly with stereo 16bit audio inside cpk files, you can still use mencoder, since mplayer supports FILM properly. (I've never once encountered a saturn game with that high audio quality under FMVs inside a CPK file, and it would be highly impractical since CPK does not use audio compression - stereo 16bit would only allow very low sampling rates. This is of course not counting Burning Rangers ADX and Nights into Dreams ADPCM.) FFMpeg probably just supports Cvid, the compression used in CPK files. I've seen a directshow splitter that allowed windows to open CPK files directly, but I haven't used it in ages, and you can just open them in mplayer anyway. What kind of toxic man-thing is happening now? |
Wark! |
Oh. Well if has no header in it that makes my job easier.
Although, I've never tried making a dummy container for anything - it's worth a try. However, every time I try to get MPlayer or Mencoder to work, it fails miserably. I've tried on both Windows and Mac and it just doesn't like me. I don't know what I'm doing wrong with it but I don't know if I trust it. FELIPE NO
~TigerC10~
|