News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: PSone Audio Hack Question  (Read 1973 times)

Razieldemon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
PSone Audio Hack Question
« on: February 03, 2019, 08:40:29 pm »
I've been dabbling in pallettes on GBA for awhile but wanted to tackle a problem that has bugged me for some time and thought it might be a fairly straightforward hack.

Mortal Kombat Trilogy downsampled the original 48khz signal to 44.1khz to fit on the CD Rom image on PSOne, but in so doing they neglected to fix the sample speed of the audio making it noticeably slower. I figured since I have some experience with audacity and other audio programs this might be a relatively straightforward fix especially considering the game uses the older standard of separating the audio files into .bin files on the image.

Any idea where I might begin converting bin to usable audio and back? Anything I need to be aware of other than making sure the channel number is the same and the khz is 44.1?

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
Re: PSone Audio Hack Question
« Reply #1 on: February 03, 2019, 09:42:51 pm »
Well, good job figuring that out, for starters.

It seems to me there's a lot of variables here.  PSX games don't necessarily have to access data by filename, but can instead access sectors on the disc directly.  Then there's the question of whether the incorrect sampling rate is stored in some kind of header next to each audio sample, or if there's some code (or several different segments of code) within the game's program that specifies the incorrect sampling rate.

Do the .bin files on the image look like .WAV data?
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Razieldemon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: PSone Audio Hack Question
« Reply #2 on: February 03, 2019, 11:21:17 pm »
To be honest I am taking a guess here. But based on the size of the individual bin data, the number of tracks available for easy listening on the psone menu for cd playback and my previous knowledge when messing with pc engine rondo of blood it certainly looks like it.

So somehow it sounds like I am going to have to find a way to match the audio beginning and end points in a hex editor correct?

February 04, 2019, 02:13:51 am - (Auto Merged - Double Posts are not allowed before 7 days.)
A quick initial finding is quite promising. I decided to take a rip with all bins and cue and shuffle the naming conventions around. so i swapped every other audio track. At least when I created a single bin and cue using cdmage it would appear that they do indeed get sourced by audio track as the game played out the various stage music individually.

There are a few hurdles that should be handled fairly well because of it. For starters, fixing the sound volume and speeds should be pretty simple. I have wav2bin but nothing to reverse it at this point. I also want to see if its possible to fit in a 48khz audio file. im not sure this was a restriction for capability as it was for space on the disc, I will have to look into it.
« Last Edit: February 04, 2019, 02:13:51 am by Razieldemon »

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
Re: PSone Audio Hack Question
« Reply #3 on: February 05, 2019, 01:05:22 am »
Wait, are you saying the music is stored as separate audio tracks?  That does indeed make it fairly easy – all you need to to is extract the audio tracks, speed them up, and put them back into the .bin image.  (I thought you were referring to individual sound effects.)

There are several ways you could work around this problem, but TurboRip should get you started.  (Yes, it's originally for PC Engine games, but all mixed-mode CDs work the same in the end.)
http://www.ysutopia.net/forums/index.php?topic=69.0

Unfortunately, any kind of patch you make from this is ultimately going to contain the entire soundtrack from the CD.  :-\ I expect it ought to be possible to make a Python script or something to automate the whole extraction, re-sampling, and re-assembling process, but that would definitely take more time than I've got these days.
« Last Edit: February 05, 2019, 01:11:45 am by Jorpho »
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Razieldemon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: PSone Audio Hack Question
« Reply #4 on: February 15, 2019, 11:03:55 am »
Thanks Jorpho!

I forgot I had asked and hadnt been back here in a bit. Im gonna give this a try you suggested but I feel like this edit is probably just for me... because making a python script to make the changes sounds like alot of extra work.

Since alot of games store the music in the method MKT does it might still be worth it for me to pursue later however I suspect the sound stretching experienced in this game is probably quite rare, as I can only see it happen in a situation where a game is ported from a different source and then only if the developers didn't try to fix it themselves during development

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
Re: PSone Audio Hack Question
« Reply #5 on: February 15, 2019, 10:39:34 pm »
I feel like this edit is probably just for me... because making a python script to make the changes sounds like alot of extra work.
Not as much as you might think.  The great thing about Python is all the packages available for it already, and presumably someone has written packages for manipulating CD images and for resampling audio.  It would be just a matter of finding them and putting them together (and working out the bugs, and working out the other bugs, and working out new bugs, and so on).
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Razieldemon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: PSone Audio Hack Question
« Reply #6 on: February 20, 2019, 01:29:22 am »
I think I still have TruRip kicking around from when I finally managed to get Rondo of Blood Hack to work (Lord was that ever a saga just past when EmuParadise went down and iloveroms getting bonked.)

Eventually I found a clean image.

I'll have to give it a shot. Changing the speed isnt a challenge. I managed to pretty easily switch the files from bin to wav and speed them up through audacity but then I ran into issues with sectors when trying to reintroduce the files into the game

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
Re: PSone Audio Hack Question
« Reply #7 on: February 21, 2019, 12:16:03 am »
but then I ran into issues with sectors when trying to reintroduce the files into the game
Well, what are you using for that?

The easiest way would be to rebuild the image.  Use a program that can mount iso+wav+cue on a virtual CD-ROM (I think Daemon Tools and Alcohol 120% can do that), and then image the mounted virtual CD with imgburn or a similar program.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!