Pages: 1
Posted on 12-31-15, 11:00 pm (rev. 2 by  skawo on 12-31-15, 11:10 pm)


Karma: 19752
Posts: 226/1100
Since: 04-02-13
Before I begin, I should mention that this process is quite crummy and you'll have to fiddle with the results to get it working quite right. The point of this is to get songs that wouldn't quite fit into the RAM to the point of doing so.

1. Convert the swavs to WAV using either VGMTrans or Kiwi.ds. Keep a copy of the unconverted swavs somewhere, as well.
2. Open the wav corresponding to the swav you want to resize in audacity. Change the "Project rate(Hz)" to something lower than it is. Export the result as an Uncompressed 8-Bit PCM WAV. (Yes, this will lower quality, but that's unfortunately how it'll have to be)
3. Reconvert the WAV to SWAV using wav2swav
4. Open the original, unmodified swav and your newly made one simultaneously in a Hex Editor.
5. Take note at 0x19 in the unmodified swav. If it's 0, skip to step 15. If it's 1, keep going.
6. From the unmodified swav, note down:

2 bytes at 0x8 (Overall filesize)
2 bytes at 0x1e (Loop Point)
2 bytes at 0x20 (Non-Looped Size)

From the newly created swav, note down the 2 bytes at 0x8.

7. Change the order of the bytes in each case (so, if you have "0E56" noted, change it to "560E"
8. Change the hex values you now have to decimals (use, eg. Windows' Calculator's Programmer mode)
9. Calculate what percent the loop point and the non-looped size are of the overall filesize of the unmodified swav (Divide the loop point and the non-looped size by the overall filesize). Note down the results to the fourth number after the dot.
10. Multiply the overall filesize of the newly created swav individually by the values you came to in step 9.
11. Change the results you come to in step 10 to hex.
12. Change the number of bytes of the hex values you arrived to in step 11 (So, if you have "0012", change it to "1200")
13. Insert the byte-order changed hexadecimal you arrived at by multiplying new SWAV's filesize by the percent the original loop point was of the original filesize at 0x1e of the new SWAV.
14. Insert the byte-order changed hexadecimal you arrived at by multiplying new SWAV's filesize by the precent the original non-looped size was of the original filesize at 0x20 of the new SWAV.
15. Save the new SWAV. Rebuild the SWAR using SWAV2SWAR.
16. Test the song. If there's something wrong, and your song has 0x1 at 0x19, subtract 0x10 from the loop point (i.e decrease value at 0x1e) in the new swav and try testing again.
Pages: 1