News: 11 March 2016 - Forum Rules

Author Topic: Replacing music in PSX game (Castlevania SotN)  (Read 599 times)

kindaway

  • Newbie
  • *
  • Posts: 1
    • View Profile
Replacing music in PSX game (Castlevania SotN)
« on: September 06, 2021, 05:07:46 am »
Hello everyone! It seems like i don't understand one basic thing about romhacking. For example, i have Castlevania SoTN (PSX) rom. I want to change music tracks of some locations and bosses to the tracks from Satrun version of this game (i can find them in .mp3 format). So, i understand that i need to convert my msuic files from .mp3 to .xa, but how do i inject them in .bin file, replacing specific tracks? In terms of pc games it's just replacing one file with another, keeping the name of the first file. Sorry for a noob quiestion   :)

September 07, 2021, 07:06:25 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I also found heavy file named XA_STR1 that probably stores .xa but i have no idea how to get into it cause it has no extension.
« Last Edit: September 07, 2021, 07:06:25 am by kindaway »

Bregalad

  • Hero Member
  • *****
  • Posts: 2763
    • View Profile
Re: Replacing music in PSX game (Castlevania SotN)
« Reply #1 on: September 12, 2021, 05:42:06 am »
Castlevania SotN uses almost exclusively streamed music so you'll have to be very familiar with the XA format, how the games make the disc drive play it and loop it. The music is interleaved so there's data from 4 songs at the same memory location, interleaved with eachother. You will probably not be able to insert a music tune without removing another of at least the same length.

It's a bad idea to convert from MP3 to XA. Both MP3 and XA are lossy compression format, that means they remove some composants in the sound for it to compress as much as possible. XA uses a fixed compression rate of 1:4, so it takes 4 times less data than the CD format, and uses ADPCM compression. MP3 on the other hand has multiple possible compression rates, you can find a MP3 that compress only like XA but it's likely you have one who compress much more, affecting the sound quality more. Taking that garbled data and compressing it again in XA will remove even more quality, and sound badly. It's much better to extract the sound data from the Saturn game by yourself - or even better - directly from the soundtrack disc who might if you're lucky not be compressed at all.

knight0fdragon

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: Replacing music in PSX game (Castlevania SotN)
« Reply #2 on: September 20, 2021, 01:03:29 pm »
The Saturn music is also ADPCM, but it is slightly different than what PSX uses.

VGMStream is capable of decompressing them correctly.

https://github.com/vgmstream/vgmstream

It uses foobar2000, but the source is also there for you to see how it decompresses if you need to.