Page 1 of 3

Hacking Audio Files

Posted: Tue Nov 25, 2014 5:06 pm
by Redhollowlives999
I wanna hack an iso (or if possible, my disc) so I can manually voice some of the sound effects in the game. Like I wanna make ridiculous sounds when the characters get hit, and maybe say stuff like "DIE DIE DIE DIE!" during long combos, like Gala's third Hyper Art, or even Noa's Jurassic Kick.


How could a complete n00b get this done?

Re: Hacking Audio Files

Posted: Fri Nov 28, 2014 10:29 am
by meth962
That would be pretty hard for you to do unless you found an awesome tool out there that let's you create XA files. All the audio is in the XA files of the disc of the game. Unfortunately they're a bunch of tracks so you would to replace one of them with your recorded sound and hope it doesn't break.

Re: Hacking Audio Files

Posted: Sat Nov 29, 2014 5:10 pm
by K73SK
Actually, if you provide those XA files, I bet you I might be able to find a way to convert them. It's a matter of being able to read the headers and how it converts the audio to a listening format for... audio.

Re: Hacking Audio Files

Posted: Sun Nov 30, 2014 2:48 pm
by meth962
Only problem is the game is coded to read certain tracks and lengths out of those XA files

Re: Hacking Audio Files

Posted: Sun Nov 30, 2014 6:36 pm
by K73SK
If you can provide that code too, it might make reading the headers a lot easier :p

Re: Hacking Audio Files

Posted: Wed Dec 10, 2014 5:29 pm
by meth962
I have code to open XA files from the CD and play the sounds. Nothing yet on how to change them. But it might be worth a shot. For instance...opening up \XA\XA1.XA from the Legaia disc, there are....

8 Channels (different sounds)
1: Vahn Spirit
2: Vahn "Kurei!"
3: Vahn "Iku ze!"
4: Vahn "Hissatsu!"
5: Vahn "Moero!"
6: Vahn "Iku ze!" same as #3 I think
7: Vahn "Hissatsu!" same as #4
8: Vahn "Moero!" same as #5

Thinking about this more, maybe it IS possible. If the Playstation and/or game is coded to be smart, it could work. XA files are broken up in CD Sectors. Each sector tells it which file number (we're looking at file 1 here with vahn's audio) and what channel (the 8 channels or different sound files). So it might be smart enough to just go read the CD and read all sectors for File 1 and Channel 3 if you were to go in and record yourself to replace "Iku ze!" for instance.

Hrmmmmmm.......now I'm intrigued.

Re: Hacking Audio Files

Posted: Wed Dec 10, 2014 8:59 pm
by K73SK
Oh, so these XA files are literally just files on the disk that you can see when mounting. I misunderstood you, lol. That makes it even easier XD

Re: Hacking Audio Files

Posted: Thu Dec 11, 2014 9:39 am
by meth962
Yep. Just be aware, they don't always seem to copy off the disc right. You might notice the bytes are different if you're writing an app to read the bytes.

Re: Hacking Audio Files

Posted: Fri Dec 12, 2014 1:29 pm
by meth962
What do you code in K73SK? Do you know C#? Because that is what I wrote my XA Player in.

You would need an app to convert the recorded sound file (WAV) to the Playstation's XA format which is 37.8kHz samplerate and 4bit nibble representation of the samples. Then the app would have to open up the current XA file, remove the channel (sound) that you want to replace, add your new XA sound into the current file and move the rest of the resource bytes (videos, data, etc) as well as change the header length. Then it might be possible. Given if your recorded example is not the exact same length, the file will be reorganized completely.

I was looking at some C code for the playstation and noticed it has this...

Code: Select all

// Set up the XA filter
	XAfilter.file = 1;
	XAfilter.chan = ChannelNum;
	CdControlF(CdlSetfilter, (u_char*)&XAfilter);

        // Set starting position on the CD
	CdIntToPos(XAFILE[FileNum].StartPos, &XAloc);

        // Begin playback
	CdControlF(CdlReadS, (u_char*)&XAloc);
	
	// Set volume to max
	SsSetSerialVol(SS_SERIAL_A, ss_cdvol, ss_cdvol);

Re: Hacking Audio Files

Posted: Fri Dec 12, 2014 4:22 pm
by K73SK
I do C# yes, but I know C as well. I actually teach students at my university C# ( www.csharpgroup.org ). Unfortunately, that C code could mean anything lol. Good thing for the comments. It's unfortunate that they did "XAfilter.file = 1;" because that doesn't mean 質 to me...

Where'd you find that C code?