Mod The Sims
Page 2 of 2

Mod The Sims (https://modthesims.info/index.php)
-   Modding Discussion (https://modthesims.info/forumdisplay.php?f=547)
-   -   How to decode sims 3 audio (https://modthesims.info/showthread.php?t=418050)

FeathervsFlower 24th Feb 2017 9:07 AM

Quote: Originally posted by Wojtek
Is it like you want to replace music in the Sims 3 with a custom track? Isn't it better just to put some MP3s into the CustomMusic folder and play this station?


i can't stand having so many genres playing on a single radio station

Metal dragon 1st May 2017 9:45 AM

Quote: Originally posted by FeathervsFlower
i can't stand having so many genres playing on a single radio station


I gotta agree, not just for keeping genres together but also for community lots. If you have a lot that plays a specific station, and you want it to play your custom music, it would be nice to just shove your tunes in the respective station and be on your way. And sometimes, you just want to listen to one particular type of music anyway, and having them, all in the right station just makes it easier to listen to that band, or that album or whatever.

Having more options to do anything can be a good thing, despite if half the users have no reason for it, the other half do.

texter241 11th Jul 2017 12:06 AM

Does anyone know how to decode .audtun files?

texter241 27th Jul 2017 6:44 PM

@Wojtek Do they not? Based on the name of the files, some of them should have voice audio in them.

texter241 30th Jul 2017 7:10 PM

I did read through the whole thread a few times before.
But there are some AUDTUN files that follow the same naming pattern as SNS and SNR files that contain voice audio. For instance, one of the SNS files I've converted to .wav is named this: S3_01A527DB_001407EC_00C5929C3C4C71E1_vo_bed_talk_listenaA_fa22%%+_AUD. The two letters and numbers before the percent indicate that it is a voice file, and which voice it is. b=baby, p=toddler, c=child, m=male voices teen--elder, f=female voices teen--elder. a--c is voices a, b, or c.
Knowing this allowed me to know which SNR and SNS files I needed to convert to .wav files. But there are AUDTUN files that follow the same naming pattern, so it really seems like there should be voice audio in there. For instance, one of the files is named: S3_8070223D_001407EC_82D1F5AB32CAE95A_vo_btrap_toilet_trc_cb%%+AUDT. So it should have a Child Voice B file in there.

texter241 30th Jul 2017 8:44 PM

Oh, okay. Thank you very much for the information.
Sorry for being so stubborn!

owenqi 29th Aug 2017 4:19 AM

1 Attachment(s)
Quote: Originally posted by Infernus Animositas
Here are the two loop tracks FFMPEG can't decode completely. Anyone got any ideas?

http://www.mediafire.com/?i2cz1ey1fuzay1b


I know it is an old topic, here's what I found, once you export the file, use a Hex Editor to modify the first 2 digits to be "00" and save it.
And this worked for me.

AGuyCalledPi 11th Jan 2020 10:47 PM

Ooooh my god I hate HEX editing so much. Why, why, why. Thanks for the very complete tutorial by the way.

gamefreak130 25th Jan 2020 5:10 AM

After doing some testing, it appears the issue with switching to the next track is solved by simply encoding the entire MP3 as a single SNR file using "--single-block". The AUDTUNs and XMLs still need to be created, but only the SNR file needs to be encoded and no further hex editing should be necessary.

SuperTN33 2nd May 2020 4:11 PM

Problems with using ealayer3 -E NAMEOFYOURMP3FILE.mp3 -o NAMEOFYOURMP3FILE.sn
 
Quote: Originally posted by jje1000
@tizerist:

As originally posted by Wojtek here: http://modthesims.info/showthread.p...d=1#post5020035






















































Whenever I use ealayer3 -E NAMEOFYOURMP3FILE.mp3 -o NAMEOFYOURMP3FILE.sn "the EALayer3 Parser could not be initialized (The bitstream format is not readable)" shows up and nothing happens. I followed all the instructions but I've hit a dead end. Is the EA Layer 3 broken or is Audacity saving unreadable MP3 files? I need help to fix this problem.

transu 16th Jun 2020 6:42 PM

1 Attachment(s)
EALayer3 0.7.0 was unable to process some loop files (University load/enroll loop, into the future loop...), so I updated it. Here is the new file with the source code I changed
edit: https://bitbucket.org/Translu/ealayer3b/downloads/

gamefreak130 16th Jun 2020 11:56 PM

Quote: Originally posted by transu
EALayer3 0.7.0 was unable to process some loop files (University load/enroll loop, into the future loop...), so I updated it. Here is the new file with the source code I changed


Your FIRST post on this site is a solution to a gripe I've had with EALayer3 for years. No fanfare or anything, either, just "Here's a thing, have fun."

@transu If we can now use this to decode looping SNRs, might it be possible to modify EALayer3 0.6.3 to encode loops?

transu 13th Oct 2020 2:07 AM

Quote: Originally posted by gamefreak130
@transu If we can now use this to decode looping SNRs, might it be possible to modify EALayer3 0.6.3 to encode loops?


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.

r_deNoube 31st Oct 2020 12:30 AM

First, my gratitude to you all for the considerable progress that's taken place since I was last on this thread many years back. "Helpful" isn't even a good enough button; some of this work should be tagged "Sheer Genius."

My question concerns decoding .SNR files by ffmpeg. My goal is to create a corpus of Sim speech. In processing the .SNR files, I find that most of them are type 05 and ealayer3 works fine, but I am still left wanting to decode some voice .SNR of the kind that need ffmpeg.
Quote: Originally posted by Wojtek
@Goodywood, many .SNR files are coded in a way that it's simply impossible to decode them using ffmpeg. They can, however, be replaced with custom .SNR files.

I'm trying to read some with a type byte of 04, for which ffmpeg is (or formerly was) the recommended tool.

My problem is that the command:
Code:
ffmpeg -f ea_cdata -i <snr_filename> <wav_filename>

fails due to
"[NULL @ 000001ae6dc6dc00] Requested output format 'ea_cdata' is not a suitable output format"

... which is very plausible because I don't have the plugin which, if I understand rightly, was used by ffmpeg to allow it to read that kind of SNR file. Does anyone know whether or from where the appropriate special sauce for ffmpeg is available any more? EDIT: Or even any information about the ea_cdata compression format?

mypantsfelldown 8th Jan 2021 4: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!!!

iiiiiiiii 15th May 2021 5: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.

mypantsfelldown 15th May 2021 8: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.

iiiiiiiii 15th May 2021 10: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.

mypantsfelldown 15th May 2021 11: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!

iiiiiiiii 16th May 2021 12:04 AM

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?

iiiiiiiii 16th May 2021 1: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.

iiiiiiiii 17th May 2021 11:27 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!

mypantsfelldown 18th May 2021 6: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.

iiiiiiiii 20th May 2021 4: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.

mypantsfelldown 20th May 2021 6: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.

iiiiiiiii 20th May 2021 6: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?

mypantsfelldown 20th May 2021 7: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.

iiiiiiiii 20th May 2021 7: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?

mypantsfelldown 20th May 2021 7: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.

jje1000 3rd Dec 2021 11:03 PM

Quick question, does anyone know where I can find the latest tutorial on replacing TS3's soundtrack?

transu 12th Sep 2024 12:42 AM

If anyone is still interested in an encoder for the XAS format (.SNR starting with 04), there's one here: https://github.com/lgdel/eaxas/releases

CardinalSims 13th Sep 2024 4:35 AM

Quote: Originally posted by transu
If anyone is still interested in an encoder for the XAS format (.SNR starting with 04), there's one here: https://github.com/lgdel/eaxas/releases

This download is immediately flagged as containing a trojan virus.
Likely a false positive, but I would err on the side of caution given that this Github only appeared and uploaded this a few days ago. May need some time to be reviewed and have it marked as safe- if someone has a Github account it would help to report it so it gets checked.


All times are GMT +1. The time now is 7:44 PM.
Page 2 of 2

Powered by: vBulletin Version 3.0.14 · Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.