Hacking Audio Files

Any information you would like to share or ask in regards to the hacking of Legend of Legaia
User avatar
Redhollowlives999
Level Awesome.
Posts: 12139
Joined: Sun Jun 05, 2011 9:39 pm
Location: Yes
Contact:

Hacking Audio Files

Post by Redhollowlives999 » Tue Nov 25, 2014 5:06 pm

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?
it really do be like that tho

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by meth962 » Fri Nov 28, 2014 10:29 am

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.
まさかつあがつ

User avatar
K73SK
Level 89
Posts: 3953
Joined: Tue Feb 01, 2011 7:00 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by K73SK » Sat Nov 29, 2014 5:10 pm

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.
Donate to legendoflegaia.net if you are one who wants to keep it alive! http://www.legendoflegaia.net/donate.html

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by meth962 » Sun Nov 30, 2014 2:48 pm

Only problem is the game is coded to read certain tracks and lengths out of those XA files
まさかつあがつ

User avatar
K73SK
Level 89
Posts: 3953
Joined: Tue Feb 01, 2011 7:00 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by K73SK » Sun Nov 30, 2014 6:36 pm

If you can provide that code too, it might make reading the headers a lot easier :p
Donate to legendoflegaia.net if you are one who wants to keep it alive! http://www.legendoflegaia.net/donate.html

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by meth962 » Wed Dec 10, 2014 5:29 pm

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.
まさかつあがつ

User avatar
K73SK
Level 89
Posts: 3953
Joined: Tue Feb 01, 2011 7:00 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by K73SK » Wed Dec 10, 2014 8:59 pm

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
Donate to legendoflegaia.net if you are one who wants to keep it alive! http://www.legendoflegaia.net/donate.html

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by meth962 » Thu Dec 11, 2014 9:39 am

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.
まさかつあがつ

User avatar
meth962
Level 23
Posts: 266
Joined: Tue Apr 03, 2012 8:37 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by meth962 » Fri Dec 12, 2014 1:29 pm

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);
まさかつあがつ

User avatar
K73SK
Level 89
Posts: 3953
Joined: Tue Feb 01, 2011 7:00 am
Location: USA
Contact:

Re: Hacking Audio Files

Post by K73SK » Fri Dec 12, 2014 4:22 pm

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?
Donate to legendoflegaia.net if you are one who wants to keep it alive! http://www.legendoflegaia.net/donate.html

Post Reply