Posts: 295
|
Post by BeltwayEX on Mar 16, 2017 12:17:17 GMT 10
FInally i managed to use a HEX editor to find how the etc.arc searches for the bgm, since for some reason converting a song to sngw is not enough to make the game recognize it
Now I dont know how to search the part in that file where I can change the lenght and the loop of the song
Does anyone know? I want to change the bgm on mercenaries
|
|
Umbrella's MIA Audio Enthusiast
Posts: 129
|
Post by D on Mar 19, 2017 12:23:21 GMT 10
Here's a reminder that I wrote to myself a year ago when editing RE5 (and 6) STQs.
Hex values are set in such order: Duration - 4 bytes, Unknown - 4 bytes, Loop start - 4 bytes, Loop end - 4 bytes. If the audio does not loop then the values are all "FF". All hex values in the file are reversed. As an example. c_16.sngw (RE5) is 26624 samples long which is 6800 hex or 00006800 when using 4 bytes. In the STQ file the values are flipped as 00680000. Keep that in mind when editing.
To elaborate on the flipping: each byte value is flipped. Better demo: A value of 12 34 56 78 in STQs should be written as 78 56 34 12.
If you'll still have problems I could post my mod so you could reverse engineer it.
|
|
Posts: 295
|
Post by BeltwayEX on Mar 19, 2017 17:16:25 GMT 10
Here's a reminder that I wrote to myself a year ago when editing RE5 (and 6) STQs. Hex values are set in such order: Duration - 4 bytes, Unknown - 4 bytes, Loop start - 4 bytes, Loop end - 4 bytes. If the audio does not loop then the values are all "FF". All hex values in the file are reversed. As an example. c_16.sngw (RE5) is 26624 samples long which is 6800 hex or 00006800 when using 4 bytes. In the STQ file the values are flipped as 00680000. Keep that in mind when editing. To elaborate on the flipping: each byte value is flipped. Better demo: A value of 12 34 56 78 in STQs should be written as 78 56 34 12. If you'll still have problems I could post my mod so you could reverse engineer it. I have problems, cause its the first tie I use HEX values, and dont know how to know the samples of one sound, so, Im completely lost
|
|
Umbrella's MIA Audio Enthusiast
Posts: 129
|
Post by D on Mar 20, 2017 7:43:53 GMT 10
You're in for a treat. You should use free software called Audacity. With it you can open the desired OGG files (SNGWs) and check the sample amount. When you open a file down below you'll see "Selection Start" "End / Length" and "Audio Position". You can switch those values in samples and you'll mostly be interested in Length and Audio Position.
With this software you can get the desired values for hex editing, the duration, loop start and loop end. Now when you get the values you gotta change them from decimal to hex. Most of the online converters will work. Then you'll have to flip the values backwards like I've mentioned before.
The most difficult part is to find the right spot in the STQ. Right in the end of it there's a list of all SNGWs used. So you look up the first SNGW, check its sample size, convert it to hex, flip it and then search in the STQ. That way you'll find the hex offsets you're looking for.
Or you could just forget about this idea and make 1 really long audio track and make it loop a couple of times (like most of the modders here did).
|
|