The following commit has been merged in the master branch:
commit 68b500a54bada401f5069513ed7e0c52dff3f044
Author: Martin Erik Werner <[email protected]>
Date:   Thu Jan 19 23:06:07 2012 +0100

    extractsounds script

diff --git a/extractsounds b/extractsounds
new file mode 100755
index 0000000..065b15f
--- /dev/null
+++ b/extractsounds
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+sndfile=LIERO.SND
+sounds=30
+header=2
+entrysize=16
+nameoffset=0
+namesize=8
+offsetoffset=8
+offsetsize=4
+sizeoffset=12
+sizesize=4
+
+# Input file:
+# header
+# NAME|offset|size
+# NAME|offset|size
+# NAME|offset|size
+# Raw PCM DATA (signed 8bit, 22050 Hz, mono)...
+
+# For more info, look at
+# echo "$(dd if=$sndfile ibs=1 skip=2 | xxd -g 4 | head -30)"
+
+# For each entry
+for i in $(seq 0 $(($sounds - 1))); do
+       name="$(dd if=$sndfile ibs=1 \
+               skip=$(($i * $entrysize + $(($header + $nameoffset)))) \
+               count=$namesize 2>/dev/null | tr -d ' ')"
+
+       offset="$((0x$(dd if=$sndfile ibs=1 \
+               skip=$(($i * $entrysize + $(($header + $offsetoffset)))) \
+               count=$offsetsize 2>/dev/null | od -A n -t x4 | tr -d ' ')))"
+
+       size="$((0x$(dd if=$sndfile ibs=1 \
+               skip=$(($i * $entrysize + $(($header + $sizeoffset)))) \
+               count=$sizesize 2>/dev/null | od -A n -t x4 | tr -d ' ')))"
+
+       dd if=$sndfile of=$name.pcm ibs=1 skip=$offset count=$size 2>/dev/null
+done

-- 
Packaging for original LIERO binary data

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to