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

Author Topic: Sega CD: can you swap audio between EU/US and JP version?  (Read 1620 times)

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Sega CD: can you swap audio between EU/US and JP version?
« on: December 04, 2020, 04:34:48 pm »
Hey there,

I'm new here and looking for a way to make an "undubbed" version of some sega cd games (like popful mail). I searched for a while but didn't find anything helpful yet.

So my question is basically if you can rip two copies of the same Sega CD game from different regions and swap their audio, like voiced dialogues?

Any help appreciated.

Cheers.

FAST6191

  • Hero Member
  • *****
  • Posts: 3008
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #1 on: December 05, 2020, 02:18:11 pm »
Most things based on a file system will just be a matter of swapping out audio tracks after you found them, maybe a rename if that is a thing. Definitely worth a try as a first pass.

Beyond that then will come down to the game -- most times developers of localisations are there only to translate the text, do any relevant censorship of graphics and go from there. The problems tend to come in Japanese devs being all about hiring in voice actors to do things and the localisation team only being given enough to do the text so they drop the audio. If they silence it then that is one thing, if they remove the calls to it entirely then that is quite another (almost then to the point where people sooner backport the script than make the game play new audio samples).
Even if it is one of those rare games in which they fix a bug or two along the way it should not matter for the purposes of audio.

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #2 on: December 05, 2020, 04:35:08 pm »
Hey, thanks for the answers. I know a few games that have voiced dialogues in both western and Eastern releases. So the calls should exists, I assume. But the part about "finding the tracks" might prove a bit difficult for me. I know Sega cd didn't have any kind of copy protections but how would I go about the actual swapping, for example?

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #3 on: December 06, 2020, 05:26:13 am »
Ok, so I managed to rip both of my popful mail versions and use isobuster / cdmage to extract the respective iso track. But those contain bin files (a lot) which I am not able to open or edit... I assume those are the actual game files containing the voice lines I want to change.
The ones for the animated cutscenes are other tracks beside the iso one.

Any clue?

Code: [Select]
+---popful_mail_jp.iso
|   +---CD
|   |   \---Session 1
|   |           Track 01.iso
|   |           
|   \---Track 01
|           0000.BIN
|           ........ 1234 bin files
|           STX3.BIN
|           STX4.BIN
|           STX5.BIN
|           STXX.BIN
|           TITL.BIN
|           TMP0.BIN
|           ZA00.BIN
|           ZB01.BIN
|           ZC02.BIN
|           ZD03.BIN
|           ZE04.BIN
|           ZEND.BIN
|           ZOPG.BIN
|           
\---popful_mail_us.iso
    \---Session 1
        |   Track 01.iso
        \---Track 01
                0000.BIN
                0001.BIN
                ........ 1293 bin files
                ZA00.BIN
                ZB01.BIN
                ZC02.BIN
                ZD03.BIN
                ZE04.BIN
                ZEND.BIN
                ZOPG.BIN
               

FAST6191

  • Hero Member
  • *****
  • Posts: 3008
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #4 on: December 06, 2020, 09:38:43 am »
Afraid I have not really spent any time properly pondering megacd games beyond sticking one in my first CD writer so many years ago to see what was on the disc.

For later systems I often have nice file names, file types (extensions, magic stamps, headers and whatnot), directory names, file sizes and so forth, as well as elimination methods (if something is clearly graphics then it is not music). For early CD stuff you do occasionally get systems using actual CD audio, though that is usually for music or maybe long form cut scenes and not what I would expect for small voice clips or sayings unless they had some buffer which I doubt they did for a megacd.

As far as those go then that does not appear to have much in the way of enlightening information from names alone.

At this point you can try analysing the files (open with hex editor, see if anything jumps out at you, see if anything described in a more well known game matches), swapping or corrupting files (if you swap files and find the audio changes then you know what one or both of those did, same thing if you corrupt them and the game manages not to crash), you can try comparing them (chances are most level data, graphics data and so forth is very similar, audio almost certainly will not be -- if you want to do a hash of all the files, which can be as simple as extract, zip the lot and view the CRC32 such a thing provides, and line them up between the games then you know what has changed between regions) you might gain something.

After that then yeah you probably get to play with a proper debugger. If it is a vocal sting for a jump or attack or something then it should not be so bad -- find say HP (basic cheat finding) or screen location (should be detailed in any hardware document covering graphics), set a break on write to that, while break will give you what edited the HP or location (or whatever obvious thing you picked) then at a code level a jump will say change the sprite, change the screen location (or maybe camera), whatever else it needs to do and also somewhere in the mix fire off a command to say play this sound effect. Find one sound effect and most of the rest will be nearby or use a similar format type which you can then more easily search for to get something like the super rare battle AI making a sound that is harder to control for and thus search for.
You would also be doing something similar if they removed all the calls for a given sound effect as part of the localisation, though in this case adding one back in, rinse and repeat for the 600 other effects in the game and hence the "I will backport the script instead" approach so often favoured.

ponlork

  • Jr. Member
  • **
  • Posts: 29
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #5 on: December 06, 2020, 11:12:14 am »
Pretty sure you can. If the game has Redbook CD audio then that's pretty easy. Those are the tracks that use the standard 44,100 Hz 16bit stereo CD audio format. looking at Popful Mail it appears to contain 3 redbook audio tracks mainly the Opening and Ending, and the rest uses PCM which is lower quality audio, i think 8bit mono i forgot. That part is very difficult.

Back in 2017 I was trying to figure out a way to fit TurboGrafx CD and Sega CD games on a Snes classic, this was way before I knew anything about rom hacking. Well in doing so i accidently discovered that I can replace the music tracks with my own audio.

Here's the video tutorial i made: https://youtu.be/pKCX8B2t9p4

Looking back it was very noobish. Basically what i did was degrade the CD audio from 16bit to 8bit, then reconvert it back to 16bit so when I recompress it, it'll take into account the discarded data thus reducing the filesize. It's essentially like compressing your CD albums to mp3, then taking the MP3s and uncompressing it back to wav and burn it onto a CD. Obviously it wont sound as good. And that method would probably be better than what i demonstrated in the video. but i was a noob.

But anyway in doing so i learned that we can swap the audio with our own. This works great for games like
Akumajou Dracula X which contains a lot of redbook audio tracks but not so much for games like Lunar or Popful mail which has sega genesis chip sounds too.

Here's a tool called the PCM to wav:
https://www.lunar-net.com/multimedia/utilities.php

It contains a readme for Popful mail that contains a index of where all the dialogue is. On the Popful mail disc you'll see a bunch of bin files, these are the audio samples. This tool can convert it to .wav but I hear that it discards a lot of information making the size smaller. you should get it anyway because it contain some info on popful mail.

I stumbled on this tool called SPCM2WAV which was made for Snatcher:
http://junkerhq.net/Snatcher/PCM2WAV/

Now this tool doesn't actually convert anything, it just does some arithmetic to make the sounds playable on PC. Looking at the size of the wav, it's the same size as the .bin file so it's most likely lossless.

Playing the audio back it seems slowed down. I got some experience with modding Playstation audio where when I extract it, the audio pitch is faster. So like for my NBA Jam mod, first I stretch the audio pitch by -4 so sound normal, then i take my custom audio sound and i make it align perfectly with the original PS1 audio, then i reduce the pitch so it's +4. Then when i inject it into the game it playback normally.


Here's how the audo sample sound in the game: https://youtu.be/oyTAUBHYFEI?t=248

I haven't tried modding Sega CD pcms yet but my theory is you're going to have to figure out the correct pitch of the Popful Mail audio (I use sony vegas), then when you insert your own audio, you're going to have to stretch the pitch of it so it matches the sega cd audio. Sounds confusing but it just takes trial and error.

As for converting the wav back to PCM, i haven't found much info on this. However i did find this link:
https://forum.jo-engine.org/index.php?topic=947.0;wap2

basically you need ffmpeg and use this command:
ffmpeg -i title.wav -f s16be -ar 8000 -ac 1 TITLE.PCM
edit: that's for sega saturn, i'm reading that Sega CD is supposed to be PCM unsigned 8-bit. so here's the ffmpeg command for that:
ffmpeg -i title.wav -f u8 -ar 8000 -ac 1 TITLE.PCM
 
It did convert but i havent tried injecting it into the game yet. I might try it tomorrow to see if it works with popful mail. and dont worry about feeling new. we all gotta start somewhere. i was in the same spot a few months ago. i still feel like a complete noob tbh

December 06, 2020, 03:57:19 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
welp i got good news and bad news. The good news is you can swap audio from different regions, the bad news is i couldnt figure out how to encode my own PCM sounds to work properly. But since you're just swapping audio, the Japanese PCM audio clips are all on the disc so you don't have to encode. You just need to take the audio samples from the JP disc, then insert it into the english disc.

Here's a video sample: https://www.youtube.com/watch?v=6Uio48SwEjA

there's more bad news though, the filenames on the Japanese popful mail disc are named differently than the US version. So it may take some time for you to find the correct audio to swap. It would have been much easier if it had the same file names, u could swap it all entirely in probably an hour.

Anyway I'll try to write a guide later. But basically the main program I use is Cdmage.
With cdmage you can open the japanese Popful mail disc image, then extract all the bin data out the disc, then with CDmage you open the US version of popful mail, right click on one of the bin files to swap, I suggest 0050.bin as that's the audio sample i used in the video, then click "Import file", and select one of the Japanese .bin files to test.

If it gives a error saying the file size dont match it's okay because it'll just cut the portions so it'll fit. If you select a longer audio clip then it'll get trimmed.

I recommend getting a hex editor like HxD. This will let you view the and edit the .bin files.
« Last Edit: December 06, 2020, 03:57:19 pm by ponlork »

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #6 on: December 06, 2020, 03:59:45 pm »
Thanks for the elaborate explanations. I'll be sure to check those tools out. as for now I have absolutely no clue what I'm doing, from getting the files to editing them to getting them back on an iso image. 😅

Please keep me posted about your progress if you find the time.
About the pitching. Isn't the point to keep the tracks thr same length?
Couldn't you just add an empty track at the end instead?

I don't mind doing the legwork of finding and replacing all the audio tracks if I'd know how. (╹◡╹)

Thanks

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #7 on: December 07, 2020, 12:27:32 am »
A guide would be mega awesome. I will try the bin swapping. I opened some files with a hex editor but only saw gibberish (even on the right side of the editor). Am I missing something?
« Last Edit: December 07, 2020, 09:37:06 am by Jdm »

Jdm

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Sega CD: can you swap audio between EU/US and JP version?
« Reply #8 on: December 07, 2020, 01:07:55 am »
I managed to swap the opening using your mentioned cd mage method. Really nice. But like you mentioned, finding the right tracks might be tricky. I assume not all bin files are audio, rights? Where would the rest of the game be then?
« Last Edit: December 07, 2020, 09:36:41 am by Jdm »