06-02-2015, 12:36 PM (This post was last modified: 06-02-2015, 12:39 PM by SuperFlomm.)
The Sims 1 has sound files in XA format. I can convert them with Audacity to wav or mp3. However Audacity refuses to load most of them because they have a broken(?) header. A simple hex edit can fix this but there are over 3000 files and I have only extracted them from the Makin' Magic addon.
Is there a way to fix all the files in one go? I really don't want to edit each file manually.
You could do it from the command line (natively on Mac and Linux, probably also available on Windows in some way or another) with the command "sed" and a regular expression.
Change the directory on the first and second-to-last lines to the one your files are actually in. Make sure it's the absolute path, with the drive letter and everything. Save the file with a .ps1 extension.
To use this you need to run PowerShell in administrator mode. PowerShell comes along with Windows 7 and later, for previous versions you can download it manually.
Navigate to the place your script is in (using the "cd" command) and then run it using "& scriptname.ps1". I don't know how long it'll take but once it's done you'll be able to type stuff into the console again.
Not sure if sed is a better option, if it works and is easier than this then that's good. I found this though and thought it's pretty neat, I didn't even know this was possible before now
06-03-2015, 02:30 PM (This post was last modified: 06-03-2015, 02:33 PM by Petie.)
Very nice! I hadn't even thought about using PowerShell but it's perfectly suited to this task.
As I expected, the files are gibberish when opened directly so sed wouldn't have even worked directly. Apparently, you can do hex replacements in most modern versions of it but it would have been much more complicated than the PS script puggsoy provided.