Trying to replace audio in STR files (Tony Hawk's Pro Skater 1/Skateboarding)

Post a topic about yourself to let others know your skills, hobbies, etc.
Post Reply
User avatar
Immortal_TuF
What is PSXDEV?
What is PSXDEV?
Posts: 2
Joined: May 16th, 2025, 10:42 pm

Trying to replace audio in STR files (Tony Hawk's Pro Skater 1/Skateboarding)

Post by Immortal_TuF » Yesterday, 1:17 am

Hi everyone,

I'm new in the field of PS1 game modding and I'm neither a dev nor am I really experienced in the field (yet). But what I'm normally good at is flailing around until things work (digging myself through Google, forums and YouTube videos, trial and error, etc.) but at this point I think I won't be able to get there without any further help. So I stumbled upon this forum and if someone can help me, then this is probably the best place! So please forgive me for asking probably dumb questions. :)

I'm currently trying to replace songs in Tony Hawk's Skateboarding (PAL) [SLES-02055] and it seems the game stores the audio within the respective music videos (STR files). Probably in case they are displayed during the levels (School, Chicago, Downtown) in certain spots so there's only one file to launch. The image consists of BIN and CUE. The information in the CUE sheet says MODE2/2352:
jPSXdec_THPS1_PAL.PNG
I first started with the following try:
  • Extracted a music video as uncompressed AVI for testing purpose through jPSXdec
  • Edited a song to the exact length of the clip in Vegas Pro and exported it as WAV file (44.100 Hz; 16 bit; Mono; PCM)
  • Used AVIdemux to put the new track into the videoclip without messing with the video codec and specs
  • Converted AVI --> STR through STR Converter
  • Tried to replace the original STR with the modified STR through CDmage and received the error message "Imported file must be RIFF CDXA type"
A Reddit user hinted me the following:
Reddit.PNG
so I tried it and did the following:
  • converting my WAV to XA (with 2352-byte sector) through psxavenc was succesful psxavenc -t xacd 1.wav 1.xa
  • muxing the STR and XA in MC32 seemed succesful at first (I chose "str (MDEC) with 37.8KHz, Mono" and didn't change the setup on the right (15fps, number of channels: 1 (150Sectors/sec), Double CD ROM Speed) but the file size has doubled now.
  • trying to replace the STR file in CDmage first tells me "Import file is longer than file in the image. Import file will be truncuated. Continue?" and after hitting OK, I'll receive the "Imported file must be RIFF CDXA type" error.
  • So I checked the file through PSmplay and it says: "This file Format is unsupported. (CODE = 00000000)"
  • I checked if PSmplay plays my converted XA file and it does flawlessly so I assumed my problem is somewhere within my MC32 settings at first.
  • Then I checked the modded STR file in jPSXdec and it says "File does not contain raw sector headers -- audio may not be detected. See manual for details"
Error messages:
errors.PNG

What did I miss? I'm feeling pretty lost and a little bit dumb atm. I don't even know where to start and what to do now.
Thank you so much in advance!

Best,
TuF
You do not have the required permissions to view the files attached to this post.
Last edited by Immortal_TuF on May 17th, 2025, 8:16 am, edited 2 times in total.

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2713
Joined: December 31st, 2012, 5:37 pm
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » Yesterday, 5:11 am

XA typically uses mode 2 which divides the 2352 bytes into 12 synchronization bytes and 4 header bytes. Hence, 2336 bytes of user data. An easier solution would be to use MKPSXISO from Lameguy64 so you can re-build the disc index correctly and inject your new XA track data.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
Immortal_TuF
What is PSXDEV?
What is PSXDEV?
Posts: 2
Joined: May 16th, 2025, 10:42 pm

Post by Immortal_TuF » Yesterday, 8:46 am

Thank you for your reply. I forgot to mention that the disk image I'm using is a bin/cue image in MODE2/2352. I edited my initial post and added further information. THPS seems to store the music within the music videos themselves in STR files. My goal is it to replace the songs so I thought I just could swap the audio within the STR files as CDmage asked me to cut the file (or add dummy bytes when I tried with another modded file which was smaller in size). But it doesn't seem as easy as I thought.

If I'm going to use MKPSXISO, do I need to convert the bin/cue image into ISO first? I somewhere read that bin/cue wasn't optimal for modding. And then I have to re-build the disc index and replace the STR file afterwards? I thought it was the other way round + perhaps doing some correction to the image checksum or tables afterwards. This is my first deeper step into this topic tbh.

I'm still confused about the error messages. Can you tell me the reason for the missing raw header sectors, the Riff CDXA type error and how I can fix it?

Thank you very much in advance :)

Best,
TuF


EDIT:
OK, I tried a different attempt. I loaded both STR files (original and modded) into the hex editor HxD and compared the headers. Turns out the modded file indeed had no header so I copied the missing bytes over to the modded file through copy&paste. CDmage didn't complain this time but recognized a smaller file size and corrected it with dummy bytes. I saved the bin/cue files and loaded it into RetroArch (PCSX ReARMed core), loaded the school level and skipped songs until the modified file should have played. But there was only silence. So I headed to the section inside the level in which the music video should be displayed. But it stayed black.

THPS1_music_video_blank.PNG

The game neither crashes nor refuses to load. I'm not sure if I really need to re-build the EDC/ECC data or re-build the disc index as long as the file size and the location stilol stay the same. I'm just unable to mix new music into the STR file at the moment. What am I missing?

Thank you for your support. :)

Best,
TuF
You do not have the required permissions to view the files attached to this post.

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2713
Joined: December 31st, 2012, 5:37 pm
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » Yesterday, 2:40 pm

Sounds like you have a bit of learning ahead of you. First, you should test your STR file using some library playback code to make sure your new STR file is actually interleaved correctly. There's example code from Sony to do that in their SDK.

This is how you then convert it viewtopic.php?t=3770

Also, keep in mind that some games used their own formatting to alter the MDEC formatting and didn't stick to the Sony library standards. If this is the case, you'll have to reverse engineer their specifications and make your own conversion tools.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests