Add the source wav files that I used for the sound samples and add a script which I used to convert them to a raw format that can be played on the GS. That should make it easier to modify the sounds if necessary in the future. Converting the sounds from wav to raw is not part of the build. The raw files themselves are committed in the repository although the build could be changed to generate the raw sounds at build time.

This commit is contained in:
Jeremy Rand 2021-01-18 00:34:50 -05:00
parent 1b7d2e240b
commit 3a77ba1367
11 changed files with 82 additions and 0 deletions

View File

@ -46,6 +46,16 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9D0CF93D25B553430035D329 /* createRaw */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = createRaw; sourceTree = "<group>"; };
9D0CF93E25B553CB0035D329 /* segments.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = segments.wav; sourceTree = "<group>"; };
9D0CF93F25B553DE0035D329 /* bonus.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = bonus.wav; sourceTree = "<group>"; };
9D0CF94025B553FE0035D329 /* death.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = death.wav; sourceTree = "<group>"; };
9D0CF94125B554490035D329 /* fire.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = fire.wav; sourceTree = "<group>"; };
9D0CF94225B5547B0035D329 /* kill.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = kill.wav; sourceTree = "<group>"; };
9D0CF94325B554910035D329 /* spider.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = spider.wav; sourceTree = "<group>"; };
9D0CF94425B554A10035D329 /* extralife.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = extralife.wav; sourceTree = "<group>"; };
9D0CF94525B554BC0035D329 /* flea_loop_256b.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = flea_loop_256b.wav; sourceTree = "<group>"; };
9D0CF94625B554CE0035D329 /* scorpion.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = scorpion.wav; sourceTree = "<group>"; };
9D0DC8EF258C715E00DE9E87 /* extralife.raw */ = {isa = PBXFileReference; lastKnownFileType = text; path = extralife.raw; sourceTree = "<group>"; };
9D1553DE257ACA1800657188 /* ACKNOWLEDGEMENTS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ACKNOWLEDGEMENTS.md; sourceTree = "<group>"; };
9D1553E9257F3E5200657188 /* fire.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = fire.raw; sourceTree = "<group>"; };
@ -124,9 +134,27 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9D0CF93C25B5531F0035D329 /* sources */ = {
isa = PBXGroup;
children = (
9D0CF93E25B553CB0035D329 /* segments.wav */,
9D0CF93F25B553DE0035D329 /* bonus.wav */,
9D0CF94025B553FE0035D329 /* death.wav */,
9D0CF94125B554490035D329 /* fire.wav */,
9D0CF94225B5547B0035D329 /* kill.wav */,
9D0CF94325B554910035D329 /* spider.wav */,
9D0CF94425B554A10035D329 /* extralife.wav */,
9D0CF94525B554BC0035D329 /* flea_loop_256b.wav */,
9D0CF94625B554CE0035D329 /* scorpion.wav */,
9D0CF93D25B553430035D329 /* createRaw */,
);
path = sources;
sourceTree = "<group>";
};
9D1553E8257F3DC600657188 /* sound */ = {
isa = PBXGroup;
children = (
9D0CF93C25B5531F0035D329 /* sources */,
9D1553EA257F3E5200657188 /* bonus.raw */,
9D6DB0AE2591A67700CDBF05 /* flea.raw */,
9D0DC8EF258C715E00DE9E87 /* extralife.raw */,

Binary file not shown.

54
BuGS/sound/sources/createRaw Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
function processSound
{
INFILE="$1"
OUTFILE="$2"
VOL="$3"
FREQ=""
if [ ! -z "$4" ]
then
FREQ="-r $4"
fi
TARGETSIZE="$5"
echo
echo "Creating sound file $OUTFILE"
sox -v "$VOL" "$INFILE" -c 1 $FREQ --bits 8 --encoding unsigned "$OUTFILE"
tr '\0' '\1' < "$OUTFILE" > "$OUTFILE.tmp"
mv "$OUTFILE.tmp" "$OUTFILE"
if [ ! -z "$TARGETSIZE" ]
then
CURRSIZE=`stat -f '%z' "$OUTFILE"`
if [ $CURRSIZE -lt $TARGETSIZE ]
then
BYTESTOADD=`expr $TARGETSIZE - $CURRSIZE`
dd if=/dev/zero bs="$BYTESTOADD" count=1 2> /dev/null | tr '\0' '\177' >> "$OUTFILE"
fi
if [ $CURRSIZE -gt $TARGETSIZE ]
then
dd if="$OUTFILE" bs="$TARGETSIZE" count=1 of="$OUTFILE.tmp" 2> /dev/null
mv "$OUTFILE.tmp" "$OUTFILE"
fi
fi
dd if=/dev/zero bs=1 count=1 2> /dev/null | cat >> "$OUTFILE"
}
DEFAULT_FREQ=11025
export LC_CTYPE=C
processSound segments.wav ../segments.raw 1.0 $DEFAULT_FREQ 2940
processSound bonus.wav ../bonus.raw 1.0 $DEFAULT_FREQ
processSound death.wav ../death.raw 1.0 $DEFAULT_FREQ
processSound fire.wav ../fire.raw 1.0 $DEFAULT_FREQ
processSound kill.wav ../kill.raw 1.0 $DEFAULT_FREQ
processSound spider.wav ../spider.raw 1.0 $DEFAULT_FREQ 14700
processSound extralife.wav ../extralife.raw 1.3 5513
processSound flea_loop_256b.wav ../flea.raw 2.2 "" 255
processSound scorpion.wav ../scorpion.raw 4.5 $DEFAULT_FREQ

Binary file not shown.

Binary file not shown.

BIN
BuGS/sound/sources/fire.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
BuGS/sound/sources/kill.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.