Replies: 139 (Who?), Viewed: 139558 times.
Page 6 of 6
Lab Assistant
#126 Old 8th Jan 2021 at 3:30 AM
Quote:
Originally Posted by transu
https://bitbucket.org/Translu/ealayer3b/downloads/
I finally had time to fix encoding and do this 2 new options:
--two-files
create a headerless file (the .SNS) and a header-only file (the .SNR)

--loop
use with --single-block or --two-files, mark the file as a loop

Seems like any file can be marked as loop (even radio songs). A loop has a optional "starting part" which gets played only the first time, at the beginning, currently the encoder leaves it empty.

I can't believe I'm only just seeing your post! THANK YOU SO MUCH FOR THIS. I had pretty wrapped my head around everything with choppy hex editing but your update simplifies everything so much more. And streamed SNS file looping works now, too! Thank you!!!
Test Subject
#127 Old 15th May 2021 at 4:33 AM
Does anyone know how to make an snr file with a loop and an initial part? Roughly speaking, repetitive music with an initial phase that is not repeated. EaLayer3b from Translu does not provide this feature, only a loop without the initial part. I also tried to understand the hex editor, but I do not know what exactly needs to be edited in the bytes responsible for the loop and the beginning of the sample. I will be very grateful for your help.
Lab Assistant
#128 Old 15th May 2021 at 7:12 PM
Quote:
Originally Posted by iiiiiiiii
Does anyone know how to make an snr file with a loop and an initial part? Roughly speaking, repetitive music with an initial phase that is not repeated. EaLayer3b from Translu does not provide this feature, only a loop without the initial part. I also tried to understand the hex editor, but I do not know what exactly needs to be edited in the bytes responsible for the loop and the beginning of the sample. I will be very grateful for your help.

I don't remember ever getting this to work. The only game files with separate intro + loop regions that I could find were vehicle sounds, and they use the two file method, so it's kinda hard to compare the HEX values. After playing around for a bit I kinda assumed I'd come pretty close to cracking the format with my findings below, but no matter what combination I tried, the game would not play my file smoothly.



Again, the information above might be completely incorrect, but I hope I'm able to point you in the right general direction . After realising that SNR files needed a loop start sample AND address I gave up, because I couldn't find a way to pinpoint where a specific sample in the file was.
Test Subject
#129 Old 15th May 2021 at 9:10 PM
Quote:
Originally Posted by mypantsfelldown
The only game files with separate intro + loop regions that I could find were vehicle sounds, and they use the two file method...

I just found out about this when I looked at the properties of music tracks with this cycle: when converting via ealayer3 from snr to mp3, such a track was converted into two files, and vgmstream shows that layout: segmented (2 segments). Files with a simple loop are designated layout: flat.
Quote:
Originally Posted by mypantsfelldown
After playing around for a bit I kinda assumed I'd come pretty close to cracking the format with my findings below, but no matter what combination I tried, the game would not play my file smoothly.

So the game didn't even play the modified files? Or playing, but somehow not so?
Quote:
Originally Posted by mypantsfelldown
Again, the information above might be completely incorrect, but I hope I'm able to point you in the right general direction .

I would like to know how information is encoded in these bytes and what to write there, since for me it is just a set of letters and numbers.
Quote:
Originally Posted by mypantsfelldown
After realising that SNR files needed a loop start sample AND address I gave up, because I couldn't find a way to pinpoint where a specific sample in the file was.

I think if study the source code of the new version of ealayer3, or for example, how vgmstream decodes the format, the situation will become clearer, because vgmstream also shows which sample the loop starts with in the snr file.

Do I understand correctly from the above that there is no way to make an snr with a loop and an initial part yet? If so, it's sad, but thanks anyway for trying to help and answering.
Lab Assistant
#130 Old 15th May 2021 at 10:43 PM
Quote:
Originally Posted by iiiiiiiii
I just found out about this when I looked at the properties of music tracks with this cycle: when converting via ealayer3 from snr to mp3, such a track was converted into two files, and vgmstream shows that layout: segmented (2 segments). Files with a simple loop are designated layout: flat.

Which music tracks are encoded in this way? I remember the ITF loading music was but I don't remember it actually having an intro segment.

Quote:
Originally Posted by iiiiiiiii
So the game didn't even play the modified files? Or playing, but somehow not so?

It varied. My testing was somewhat messy and I was playing with this quite a while ago now so my memory might be a tad muddled. I would test the file in VGM stream first and if it played back at all I would chuck it into the game and try it there. Most of the time the game would crash before playing anything, I don't remember any other outcome.

Quote:
Originally Posted by iiiiiiiii
I would like to know how information is encoded in these bytes and what to write there, since for me it is just a set of letters and numbers.

Most of it is guesswork, it requires experimentation. If the values you're investigating are representative of numbers (like loop start sample/total samples), you can check this by using a hex to decimal converter like this one. Then you can kind of connect the dots.

Quote:
Originally Posted by iiiiiiiii
Do I understand correctly from the above that there is no way to make an snr with a loop and an initial part yet? If so, it's sad, but thanks anyway for trying to help and answering.

Technically it might be, I don't know of anyone other than myself that's attempted this. I did manage to achieve success with the two file method, so I'm not sure if that would be helpful to you. You're welcome for the help though!
Test Subject
#131 Old 15th May 2021 at 11:04 PM
Quote:
Originally Posted by mypantsfelldown
Which music tracks are encoded in this way? I remember the ITF loading music was but I don't remember it actually having an intro segment.

Music tracks for adventures in Spore Galactic Adventures. For this game, I need a loop to make a mod for custom music.
Quote:
Originally Posted by mypantsfelldown
Most of it is guesswork, it requires experimentation. If the values you're investigating are representative of numbers (like loop start sample/total samples), you can check this by using a hex to decimal converter like this one. Then you can kind of connect the dots.

I'll try it.
Quote:
Originally Posted by mypantsfelldown
Technically it might be, I don't know of anyone other than myself that's attempted this. I did manage to achieve success with the two file method, so I'm not sure if that would be helpful to you. You're welcome for the help though!

The two-file method? Can I learn more?
Test Subject
#132 Old 16th May 2021 at 12:38 AM
Quote:
Originally Posted by mypantsfelldown
Most of it is guesswork, it requires experimentation. If the values you're investigating are representative of numbers (like loop start sample/total samples), you can check this by using a hex to decimal converter like this one. Then you can kind of connect the dots.

I tried to use it, and the necessary bytes show the beginning and end in the form of samples. But unfortunately, after studying the flat (normal loop) and segmented (loop with the initial part) tracks, I realized that they are different. The header seems to be the same, but apparently due to the fact that the segmented file has 2 tracks, changing the bytes in the flat track makes it unreadable.
Test Subject
#133 Old 17th May 2021 at 10:27 PM Last edited by iiiiiiiii : 17th May 2021 at 11:23 PM.
OMG! I managed to make a loop with the initial part!

After studying the loop files from Spore again, I figured out how to do everything, and I did it! I used two files converted via ealayer3, combined them in the HEX editor, added/changed the necessary bytes, and voila, everything works. I haven't tested it in the game yet, but vgmstream plays the file correctly, and shows the properties. (UPD. - I checked if my track works in the game, it works)

mypantsfelldown, thank you for the hex to dec converter, thanks to you I learned about it, and was able to do what I needed!
Lab Assistant
#134 Old 18th May 2021 at 5:15 PM
Quote:
Originally Posted by iiiiiiiii
OMG! I managed to make a loop with the initial part!

After studying the loop files from Spore again, I figured out how to do everything, and I did it! I used two files converted via ealayer3, combined them in the HEX editor, added/changed the necessary bytes, and voila, everything works. I haven't tested it in the game yet, but vgmstream plays the file correctly, and shows the properties. (UPD. - I checked if my track works in the game, it works)

mypantsfelldown, thank you for the hex to dec converter, thanks to you I learned about it, and was able to do what I needed!

That's great! When joining the files together, did you remove any of the header from the second file? I'd love to get this working myself.
Test Subject
#135 Old 20th May 2021 at 3:23 PM
Quote:
Originally Posted by mypantsfelldown
That's great! When joining the files together, did you remove any of the header from the second file? I'd love to get this working myself.

If you're talking about the Ealayer3 header, which starts with byte 05, etc., then yes, I'm removing it from the second file.
Lab Assistant
#136 Old 20th May 2021 at 5:47 PM
Quote:
Originally Posted by iiiiiiiii
If you're talking about the Ealayer3 header, which starts with byte 05, etc., then yes, I'm removing it from the second file.

Please could you walk me through how you managed to accomplish this? I've successfully concatenated two files and the whole thing is looping, but every time I try to change the "loop start sample" bytes the file becomes unreadable.
Test Subject
#137 Old 20th May 2021 at 5:53 PM
Quote:
Originally Posted by mypantsfelldown
Please could you walk me through how you managed to accomplish this? I've successfully concatenated two files and the whole thing is looping, but every time I try to change the "loop start sample" bytes the file becomes unreadable.

The file is unreadable in vgmstream and the game? Or only in one of the options?
Lab Assistant
#138 Old 20th May 2021 at 6:05 PM
Quote:
Originally Posted by iiiiiiiii
The file is unreadable in vgmstream and the game? Or only in one of the options?

Unreadable in vgmstream and crashes the game.
Test Subject
#139 Old 20th May 2021 at 6:07 PM
Quote:
Originally Posted by mypantsfelldown
Unreadable in vgmstream and crashes the game.

Can I have an example or a screenshot of the first bytes of the file?
Lab Assistant
#140 Old 20th May 2021 at 6:18 PM
Quote:
Originally Posted by iiiiiiiii
Can I have an example or a screenshot of the first bytes of the file?

Here you go. My file is 44.1kHz stereo, so the bytes at 00 and 02 may differ slightly from yours.



I also uploaded the sound file to Google Drive if you'd like to play around with it.
Page 6 of 6
Back to top