diff --git a/BuGS.xcodeproj/project.pbxproj b/BuGS.xcodeproj/project.pbxproj index 7c5f32f..f98063b 100644 --- a/BuGS.xcodeproj/project.pbxproj +++ b/BuGS.xcodeproj/project.pbxproj @@ -46,6 +46,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 9D0CF93D25B553430035D329 /* createRaw */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = createRaw; sourceTree = ""; }; + 9D0CF93E25B553CB0035D329 /* segments.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = segments.wav; sourceTree = ""; }; + 9D0CF93F25B553DE0035D329 /* bonus.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = bonus.wav; sourceTree = ""; }; + 9D0CF94025B553FE0035D329 /* death.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = death.wav; sourceTree = ""; }; + 9D0CF94125B554490035D329 /* fire.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = fire.wav; sourceTree = ""; }; + 9D0CF94225B5547B0035D329 /* kill.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = kill.wav; sourceTree = ""; }; + 9D0CF94325B554910035D329 /* spider.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = spider.wav; sourceTree = ""; }; + 9D0CF94425B554A10035D329 /* extralife.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = extralife.wav; sourceTree = ""; }; + 9D0CF94525B554BC0035D329 /* flea_loop_256b.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = flea_loop_256b.wav; sourceTree = ""; }; + 9D0CF94625B554CE0035D329 /* scorpion.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = scorpion.wav; sourceTree = ""; }; 9D0DC8EF258C715E00DE9E87 /* extralife.raw */ = {isa = PBXFileReference; lastKnownFileType = text; path = extralife.raw; sourceTree = ""; }; 9D1553DE257ACA1800657188 /* ACKNOWLEDGEMENTS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ACKNOWLEDGEMENTS.md; sourceTree = ""; }; 9D1553E9257F3E5200657188 /* fire.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = fire.raw; sourceTree = ""; }; @@ -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 = ""; + }; 9D1553E8257F3DC600657188 /* sound */ = { isa = PBXGroup; children = ( + 9D0CF93C25B5531F0035D329 /* sources */, 9D1553EA257F3E5200657188 /* bonus.raw */, 9D6DB0AE2591A67700CDBF05 /* flea.raw */, 9D0DC8EF258C715E00DE9E87 /* extralife.raw */, diff --git a/BuGS/sound/sources/bonus.wav b/BuGS/sound/sources/bonus.wav new file mode 100644 index 0000000..63356c5 Binary files /dev/null and b/BuGS/sound/sources/bonus.wav differ diff --git a/BuGS/sound/sources/createRaw b/BuGS/sound/sources/createRaw new file mode 100755 index 0000000..744f6b7 --- /dev/null +++ b/BuGS/sound/sources/createRaw @@ -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 diff --git a/BuGS/sound/sources/death.wav b/BuGS/sound/sources/death.wav new file mode 100644 index 0000000..2f132d9 Binary files /dev/null and b/BuGS/sound/sources/death.wav differ diff --git a/BuGS/sound/sources/extralife.wav b/BuGS/sound/sources/extralife.wav new file mode 100644 index 0000000..238b8ac Binary files /dev/null and b/BuGS/sound/sources/extralife.wav differ diff --git a/BuGS/sound/sources/fire.wav b/BuGS/sound/sources/fire.wav new file mode 100644 index 0000000..661d746 Binary files /dev/null and b/BuGS/sound/sources/fire.wav differ diff --git a/BuGS/sound/sources/flea_loop_256b.wav b/BuGS/sound/sources/flea_loop_256b.wav new file mode 100644 index 0000000..dfc811f Binary files /dev/null and b/BuGS/sound/sources/flea_loop_256b.wav differ diff --git a/BuGS/sound/sources/kill.wav b/BuGS/sound/sources/kill.wav new file mode 100644 index 0000000..33d9c39 Binary files /dev/null and b/BuGS/sound/sources/kill.wav differ diff --git a/BuGS/sound/sources/scorpion.wav b/BuGS/sound/sources/scorpion.wav new file mode 100644 index 0000000..a1b69ab Binary files /dev/null and b/BuGS/sound/sources/scorpion.wav differ diff --git a/BuGS/sound/sources/segments.wav b/BuGS/sound/sources/segments.wav new file mode 100644 index 0000000..56ac4a7 Binary files /dev/null and b/BuGS/sound/sources/segments.wav differ diff --git a/BuGS/sound/sources/spider.wav b/BuGS/sound/sources/spider.wav new file mode 100644 index 0000000..36e6a40 Binary files /dev/null and b/BuGS/sound/sources/spider.wav differ