PS1 Help replacing sound files (VAG) in PSX image

superruzafa

Forum Noob
Hello.

I'm trying to replace some VAG files on a PSX disc image.

I used jpsxdec to extract the big file containing the VAGs, then I encoded the new ones and replaced them in that file. Finally I copied the big file back to the disc image.

When plaing, almost all VAGs work fine but there are some that start to play but then suddenly stop.

I've tried every encoder (WAV to VAG) I found on the internet, but none of them seem to work.

I'm struggling to figure out what the problem is and how I should encode the WAV so that when I convert it to VAG it can play correctly.

Any idea about what could be happening?

Thank you.
 
Did You fixed ECC after data injection in disc image?

Did You test just unpack and repack original files to prove that method is valid (if VFS repacking is correct) before started replacing VAG files by custom one?
 
Thanks for the quick reply.

Did You fixed ECC after data injection in disc image?

I developed a tool to quickly put back the file into the disc without fixing EDC/ECC as it seems that emulators don't check it. I do it in this way because the only tool I found for this (PSX-MODE2) runs in Windows and I'm working on Linux. Anyway I grabbed a Windows machine and put the file back to the disc using that tool, hence fixing ECC, but the problem still continues.

Did You test just unpack and repack original files to prove that method is valid (if VFS repacking is correct) before started replacing VAG files by custom one?

I unpacked -> decode to WAV -> encode back to VAG -> repack the conflicting files and the sound stops in the middle of the playback.

After some tests I realized the the problem is related with the sample's 2nd byte (VAG flags). Some VAGs from the game have a weird sequence in the 2nd byte, in this case 0x02 0x02..... 0x02 0x00 0x00... 0x00 0x01 0x05


Code:
-------------+
             V

02B2E000  19 02 2D 02 E4 C1 3F 5E  1B 1F 21 FF E2 E3 5B D4  ..-...?^..!...[.
02B2E010  08 02 1E 00 11 0F 10 ED  C6 13 1E FF 14 00 1E 32  ...............2
02B2E020  07 02 01 00 00 10 11 F0  1F EF 02 00 20 F1 E2 04  ............ ...
...
02B469F0  32 02 11 1E 01 C5 5E 10  F2 2F 20 E1 11 0F 11 0F  2.....^../ .....
02B46A00  14 02 E0 11 11 01 11 1F  00 F0 00 10 FE 05 EC 3F  ...............?
02B46A10  34 00 D0 00 10 01 1E 3D  E4 0E 21 F1 2E 10 EF 11  4......=..!.....
02B46A20  15 00 EF FD 00 0D FE 1F  ED 10 CF 1F E0 FF BF 24  ...............$
...
02B47C50  29 00 11 2E 31 01 00 EF  32 03 00 0E 00 11 11 01  )...1...2.......
02B47C60  27 00 0F C0 04 00 00 00  00 00 00 00 00 00 00 00  '...............
02B47C70  0C 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
02B47C80  0C 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
02B47C90  0C 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
02B47CA0  0C 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
02B47CB0  0C 05 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................

whereas the VAGs I'm getting from encoders have the 2nd byte mostly as 0x00.

Patching the VAGs with this strange sequence does the trick but I wonder why this work, this is beyond my tech knowledge.
 
VAG is native PSX format so it means it have also official tool in PSY-Q SDK (official sdk).

I have one tool made in PS2 times (because some PS2 titles also using *.vag; included in AIO Project PS2), and last time someone developed another tool for it (forgot name, but it is on github).
 
Back
Top