Posted October 23, 2014
Hello everyone,
I stumbled across a fix for the annoying static sound popping up all the time. This fix has been tested on OS X using Wine 1.7.27, but it should work anywhere since the cause of the problem is within the game itself.
The problem
The latests official patch for the game, which is often called the "Windows 2000 and XP patch" introduced a bug where occasionally static sound can be heard.
The solution
Since the source of the problem lies within the game code itself I can't fix the source, but the symptoms can be fixed. We will modify the sound files themselves to play nicely in the engine. The solution is from this comment from the Wine bug tracker:
https://bugs.winehq.org/show_bug.cgi?id=30811#c6
We will use a shell script to modify all sound files for us in one go. I don't know batch scripting, so this will only work on Unix, but if someone can port the code for me I'll update the post.
Skills needed
You must be able to write a script and call it from the command-line interface and you should be able to use a package manager or install binaries yourself. Understanding shell scripts is helpful but not required.
Tools needed:
- Terminal/Shell
- SoX (Sound eXchange), can be installed from a package manager (I use MacPorts) or download the binaries from their site
http://sox.sourceforge.net
Save the following as a shell script inside you Alpha Centauri folder. The name doesn't matter, but I used "fix_music.sh"
I stumbled across a fix for the annoying static sound popping up all the time. This fix has been tested on OS X using Wine 1.7.27, but it should work anywhere since the cause of the problem is within the game itself.
The problem
The latests official patch for the game, which is often called the "Windows 2000 and XP patch" introduced a bug where occasionally static sound can be heard.
The solution
Since the source of the problem lies within the game code itself I can't fix the source, but the symptoms can be fixed. We will modify the sound files themselves to play nicely in the engine. The solution is from this comment from the Wine bug tracker:
https://bugs.winehq.org/show_bug.cgi?id=30811#c6
We will use a shell script to modify all sound files for us in one go. I don't know batch scripting, so this will only work on Unix, but if someone can port the code for me I'll update the post.
Skills needed
You must be able to write a script and call it from the command-line interface and you should be able to use a package manager or install binaries yourself. Understanding shell scripts is helpful but not required.
Tools needed:
- Terminal/Shell
- SoX (Sound eXchange), can be installed from a package manager (I use MacPorts) or download the binaries from their site
http://sox.sourceforge.net
Save the following as a shell script inside you Alpha Centauri folder. The name doesn't matter, but I used "fix_music.sh"
#!/bin/sh
DIR0=fx;
DIR1="$DIR0.org";
DIR2="$DIR0.mod";
# If the new directory does not exist rename the existing one
if [ ! -d "$DIR1" ]
then
mv -v "$DIR0" "$DIR1"
fi
# If the modded directory does not exist create it, otherwise delete its contents
if [ ! -d "$DIR2" ]
then
mkdir "$DIR2"
else
rm -v "$DIR2"/*
fi
# Save the modded originals in the mod folder
for FILES in $DIR1/*.wav
do
FILE="`echo $FILES|rev|cut -d '/' -f 1|rev`"
sox "$DIR1/$FILE" --norm=-1 "$DIR2/$FILE" pad 0.1 2.4 rate -v 22050 dither
done
# Copy over any unmodified file
cp -nv "$DIR1"/* "$DIR2"
# Symlink the mod folder to appear as the original folder
if [ ! -L "$DIR0" ]
then
ln -sv "$DIR2" "$DIR0"
fi
Now we need to give execution permissions to this file. In your terminal move to the directory containing the script and type DIR0=fx;
DIR1="$DIR0.org";
DIR2="$DIR0.mod";
# If the new directory does not exist rename the existing one
if [ ! -d "$DIR1" ]
then
mv -v "$DIR0" "$DIR1"
fi
# If the modded directory does not exist create it, otherwise delete its contents
if [ ! -d "$DIR2" ]
then
mkdir "$DIR2"
else
rm -v "$DIR2"/*
fi
# Save the modded originals in the mod folder
for FILES in $DIR1/*.wav
do
FILE="`echo $FILES|rev|cut -d '/' -f 1|rev`"
sox "$DIR1/$FILE" --norm=-1 "$DIR2/$FILE" pad 0.1 2.4 rate -v 22050 dither
done
# Copy over any unmodified file
cp -nv "$DIR1"/* "$DIR2"
# Symlink the mod folder to appear as the original folder
if [ ! -L "$DIR0" ]
then
ln -sv "$DIR2" "$DIR0"
fi
chmod +x fix_sound.sh
Finally run the script using ./fix_sound.sh
You should have two new folders now: fx.org contains the original sound files for backup and fx.mod contains the modded sound files. The fx folder no longer exists, instead there is a symlink to fx.mod in its place.