|Search this Thread|
|27th Aug 2010, 3:49 PM||How to decode sims 3 audio #1|
Join Date: Aug 2010
Sims 3 audio comes in .snr and .sns files.
Go to http://www.cncmods.net/files/sims.zip and download this then you will have some things that can decode these files (depending on which codec the files use).
Also you will need a hex editor to verify which compression type the files use (in case any of them use compression types other than the 2 specific types I have managed to identify)
If you dont have a hex editor, you can download this one
1.Use the resource tools to extract the audio you want.
2.Open the .snr file in a hex editor and look at the first byte. If the first byte is 04, that means its using the EA XAS ADPCM codec. If the first byte is 05, that means its using EALayer3 codec. If its using anything else, that means its an unknown codec.
Put the .snr and .sns files for the sound you want in a folder along with the contents of sims.zip. If the first byte is 04 (XAS ADPCM) you decode it via ffmpeg.exe. Open a command window, navigate to the folder containing the the files and type ffmpeg -f ea_cdata -i <snr file> <wav file>
This will convert the .snr file to a .wav file.
If you have a file of type 05 (EALayer3) you decode it via ealayer3.exe. Open a command window, navigate to the folder containing the the files and type ealayer3 -mc <snr file> and it will decode the .snr file to a .wav file. If there is a .sns file, you pass that instead of the .snr file.
If anyone finds a file with an codec other than 04 and 05 or if they see a file with a codec type of 04 and a matching .sns file (i.e. the .snr file is only 8 bytes), I want to know.
Please post here if you find such files (or any file that fails to convert). Or if there is anything about my instructions that are confusing or hard to follow.
The source code for ffmpeg.exe can be found at www.ffmpeg.org
The source code for ealayer3.exe can be found at http://bitbucket.org/Zenchreal/ealayer3
Both tools seem to be under a fairly liberal license so it should not be hard if someone wanted to re-use the code to add support for the audio to the resource extractor directly.
|27th Aug 2010, 4:57 PM||#2|
Just some extra notes that people may find useful.
In S3PE, both sns and snr resources are listed as _AUD. All(?) audio resources can be found in FullBuild1, and I assume DeltaBuild1 (though I've only checked FB, not DB). sns resources are type _AUD 0x01EEF63A, snr are _AUD 0x01A527DB. The audtun (AUDT) resources don't seem to be needed for this process.
EALayer3 seems to be almost exclusively used for music, although there are a few SFX using it. There are also a load of resources prefixed with "sting"... they seem to relate to cutscene events, like births and birthdays, but there are also a few which aren't cutscenes, such as fulfilling a wish or completing an opportunity. There are also vehicle and rabbithole sounds using this format. Everything else is XAS ADPCM as far as I can see.
What I lack in decorum, I make up for with an absence of tact.
|27th Sep 2010, 3:01 PM||#3|
This worked great! I was able to extract my favorite songs from the game and then convert the .wav to mp3. The only problem I had was that the file in the OP was corrupt, so I gathered some working files myself. Here is a link to them:
Thanks for the helpful info.
|2nd Oct 2010, 10:47 AM||#4|
I was able to use EAlayer3.exe to convert all the game music to mp3 with no problems--except for a few stubborn files, which I have uploaded here:
These four .sns files convert to a much smaller size mp3 (2-3 KB each) and won't play in Winamp. I tried extracting as a wav and mp3 with the same results.
I would be grateful if anyone could help me with these so I can complete my collection.
|3rd Oct 2010, 1:05 AM||#5|
A big THANK YOU for Jonwil, whiterider and lavsm !!! I was trying to find how to do that without any solution and you give me the light i needed looool...
Encore BRAVO et MERCI !!!!
PS: about decoding *.snr or *.sns - file type 05 / EALayer 3 codec - only the biggest file is needed (0x01EEF63A).
|3rd Oct 2010, 2:23 AM||#6|
Another tip that might be helpful...you can just drag the .sns files onto the EAlayer3.exe to convert directly to mp3, instead of opening a command window (figured this out after converting most of the files manually--derp!).
|7th Oct 2010, 10:06 PM||#7|
Join Date: Sep 2009
Very interesting, is it also possible to encode mp3 or wav files into sns/snr to replace or add new sfx in the game?
|17th Oct 2010, 5:21 PM||#8|
Sadly no - we can decode, but not encode.
TS3 can also play MP3s, as demonstrated by the custom music feature, but any attempts to make it do so outside of the custom music channel would be way over my head. It does seem to play the mp3s directly, rather than converting them to EALayer/XAS.
What I lack in decorum, I make up for with an absence of tact.
|15th Nov 2010, 5:32 AM||#9|
[QUOTE=whiterider]Sadly no - we can decode, but not encode.
Then why do they call it a codec?
Hopefully someone can make sense of the above video.
My old eyes couldn't keep up. I think he used a newer
version of ealayer3.exe (0.6.2) than is linked here (0.5.0)
Looks like source only, and I don't have the tools to
build it installed. Nighty-night, all.
|16th Nov 2010, 12:49 PM||#10|
Join Date: Jun 2006
Converting mp3's to sns using the above works for TS3 but it's bitrate needs to be 182kbps or less. If it isn't the game will crash when trying to play it.
|20th Nov 2010, 6:27 PM||#11|
I think you mean 128kbps. That corresponds to 44100hz in audacity.
Since I last posted here, I've created an audio mod package with
replacements for the sims 3 background music sns resources.
programs you will need:
note: there is no pre-compiled mac version, but source code links are
posted on the same page below the windows binaries.
a batch file to convert .mp3 files to .sns
paste this text into the batch file:
"C:\Documents and Settings\no\My Documents\s3mod projects\audio\ealayer3-0.6.2-win32\ealayer3.exe" -E %1 -n -o %1.sns -v >"C:\Documents and Settings\no\My Documents\s3mod projects\audio\dia.txt"
edit the paths in quotes to match the paths on your system.
the %1 is where the batch file substitutes the actual file
name of files dropped on it in windows explorer. The pause
command is so you can see the output before pressing a key
to return to windows from the batch file's command prompt.
the sample command line outputs to file dia.txt which may
be read with any text editor. "skipped empty frame" is the
usual content of dia.txt after a successful conversion on my
Load fullbuild1 in s3pe. Make sure the sort checkbox is checked.
(It's near the lower left corner of the program window)
Click on the [NAME] field to sort by name, then look up the
sims3_* _aud and audt resources.
For each song there is one audt and two _aud resources. Look at the
memsize field and export the _aud resource with the larger memsize.
Or check the type field. sns resources are type _AUD 0x01EEF63A,
snr are _AUD 0x01A527DB. You want the .sns resource.
drop the exported file on ealayer3.exe to create the .mp3
file. Import this into audacity, then import the .mp3 you
want to replace it with.
Click the X in the upper left of the original soundtrack window to
close the first .mp3, this leaves its filename in audacity's title bar.
Now export the second mp3, overwriting the first. The default
value of 44100 for the bitrate will do nicely. Unless you
want it to sound like the chipmunks. In that case you
would change it to 32000.
rename the file you just exported to match the name of the
original that was output from ealayer3.exe in the first part
of step 2. If you dropped the export on the batch file I've
suggested this is just a matter of deleting ".mp3" from the
open a second instance of and import the .sns file into
a new package file, clicking the use resource name checkbox
to put a checkmark in it.
Make sure the imported .sns has the same name, type, group
and instance as the music you are substituting for in the
If any of the fields are different right-click on the sns resource
in the first instance of and select details. Copy the fields
to the details window of the sns in the second instance of until they all match.
Save your new package to the proper mods\packages folder on your
machine naming it, for example, MyMusicMod.package. Your new
music should play in place of the old the next time you start the
|28th Nov 2010, 6:49 PM||#12|
Wow that's awesome! But you've gotten me so confused that it's not even funny... So I made my batch file and I dropped my replaced .MP3 on it and it says "Could not open input file '1'." what did I do wrong? Or maybe I should rephrase as "How do you take your edited .MP3 and put it back into the AUD file?" Your explanation wasn't very clear on that part
Along those same lines I got confused at step 2 and into step 3 isn't "Now export the second mp3, overwriting the first" and "rename the file you just exported to match the name of the original that was output from ealayer3.exe in the first part of step 2" telling you to do the same thing because the first MP3 you imported WAS the original you got from ealayer3.exe?
I tried... I failed
Edit: Wow I'm an idiot! I thought the quotes weren't necessary Problem solved So now I got the new music in game but it sounds like fish gurgles, I think I know how to fix that though (hopefully..)
Edit (Again): So I still have the garbling problem. I thought I knew what it was but I was wrong... The music is in game and I've obviously replaced it except it sounds like you're trying to talk underwater. So my dia.txt says "ID3 Tag size: 16", would that have anything to do with it? Any idea where I went wrong?
Hi I'm Paul!
|30th Nov 2010, 6:17 AM||#13|
Could this same theory be used to make new piano and guitar music?
|30th Nov 2010, 7:49 PM||#14|
Join Date: Jun 2009
Yes, it should work fine. The guitar and piano tunes are AUDT and a couple _AUD resources for each song, just like the tunes lenglel describes replacing.
MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
|30th Nov 2010, 10:45 PM||#15|
I had the same problem with certain tunes. Has to do with the
bitrate. The bitrate in the new resource needs to be a maximum
of 128k. That's where the audacity program comes in.
1. Export original .sns with 2. Convert original to .mp3 with ealayer3
3. Import original into audacity
4. Import replacement into the same instance of audacity
5. Click the close box of the original .mp3 in audacity
6. Click export. The replacement will overwrite the original
.mp3 (the one with the s3* name) the bitrate should be
audacity's default 44,100
7. use the batch file which calls ealayer3 to convert the
new .mp3 to an .sns file which will have the same name
as the file originally exported from EXCEPT there
will be ".mp3" ahead of the .sns extension. Delete the
original and rename the replacement by deleting the ".mp3"
from the filename
8. open and import new .sns from file with "use
resource name" checked so that the replacement has
the same name as the replaced resource
9. save it as a new .package file.
10. put the new .package in the usual mods directory
If that doesn't cure the weirdness, let me know the
bitrate and length of your track, and I'll see if I can
find something similar in my collection to test with.
The tagsize might or might not have something to
do with this. Other people made the parts. I was
just in the right place at the right time to scotch tape
edit: I just happened to think, did you blank the extra
data on export? The artist name, title and all that
stuff should be blank when you export the new file
with audacity. The basic idea with using audacity
instead of just dropping the new .mp3 on the batch
file and renaming is to get the new audio to match
the old audio's settings in the .snr and audt resources
which are largely of unknown format at present.
|30th Nov 2010, 11:59 PM||#16|
That's what I've been doing :/
I've tried with 3 songs (all end up in gurgles)
Harry Potter (44,100 5:09) http://www.youtube.com/watch?v=1Li0SWlwe34
Sims 1 Theme (22,050 2:07) http://www.youtube.com/watch?v=QU2rUU0z72Y
And a song named Hell (44,100 3:09) that I don't have a link to and didn't use for any other reason then I wanted to check that the youtube to MP3 converter wasn't screwing up the files.
Those are the exact videos I got the audio off of so if you use them then you should have the same MP3.
When you say leave the stuff blank does that also mean genre? I couldn't find any way to leave that blank (All the other stuff has been blank though)
Hi I'm Paul!
|4th Dec 2010, 12:23 AM||#17|
I think the problem might be that your mp3 files are encoded with a variable bitrate
when the game needs a fixed bitrate. How do you get mp3 files from youtube?
|4th Dec 2010, 1:04 AM||#18|
I use this site: http://www.listentoyoutube.com/
Hi I'm Paul!
|5th Dec 2010, 4:46 AM||#19|
Thanks for the link. Did you try both standard and high quality versions
to see if it made any difference?
|5th Dec 2010, 4:56 AM||#20|
You agree to receive promotional emails and special offers from trusted 3rd parties including DealSave.net.
Well, Robodl95 now you know why I can't test out the mp3 files you describe on my pc. When I had the
same problem I used winamp 5.04 to check the bitrate. The bitrate needs to be a constant 128 kbps,
even if you get a variable bitrate when playing an mp3 that was extracted from from an .sns
|5th Dec 2010, 2:43 PM||#21|
Piano and guitar music is indeed in _aud format, but it doesn't export to sns, but rather snr format, which doesn't seem to convert or work.
Edit: On the bright side, your directions worked beautifully for regular music replacements. I now have sims 1 neighborhood music in my map view, which is awesome. The only oddity is a brief millisecond of static when switching to it. Very weird but almost completely unnoticeable. It also seems to have issues progressing to the next song. Just something I thought I'd point out. Thank you so much for cracking the music situation with the Sims 3, this is an answer to many upset fans! Custom music folder be damned!
|5th Dec 2010, 11:57 PM||#22|
Gee, I'm glad the guy that wrote the actual codec didn't read this.
About the .snr files, it's the same procedure, but using the ffmpeg
codec instead of ealayer3. I think. Haven't tried it myself yet.
I'm more interested in custom animations, but EA seems to move
the goalposts with every patch.
|10th Dec 2010, 9:11 AM||#23|
Join Date: Oct 2008
So I'm assuming that this also involves animation sounds?
|11th Dec 2010, 12:58 AM||#24|
I believe your assumption is correct, but haven't done any testing as I'm happy with the
animation sounds as they are. What were you thinking of changing?
|22nd Jan 2011, 5:55 PM||#25|
Join Date: Jun 2007
OK I hate to revive an old thread but I'm having an issue and I was wondering if anyone was having this as well. The ealayer3 I've had no problem working with. However the ffmpeg never converts for me. The error I always get is "unable to find a suitable output format for <filename>" has anyone else run into this? The files I'm working with are the .snr files and they start with 04 in the hex editor. Any suggestions?
EDIT: I'm working with windows 7 and I'm not sure what version of windows that command line was written for but I always get the
"this was unexpected blah blah blah" error when I manually direct there and put in the command prompt
New to the forums but a sims fan since '99.