core/tests: Write a script to generate empty albums
gen_tracks.sh will read a specially configured file and create a directory containing empty tracks to use for testing. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
92806c5201
commit
18311afcfe
|
@ -1,3 +1,4 @@
|
|||
*-core
|
||||
*-lib
|
||||
sanity
|
||||
*.ogg
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
Koji Kondo
|
||||
1998 Hyrule Symphony
|
||||
Game
|
||||
243 Title Theme
|
||||
130 Kokiri Forest
|
||||
227 Hyrule Field
|
||||
130 Hyrule Castle
|
||||
206 Lon Lon Ranch
|
||||
186 Kakariko Village
|
||||
178 Death Mountain
|
||||
221 Zora's Domain
|
||||
273 Gerudo Valley
|
||||
66 Ganondorf
|
||||
185 Princess Zelda
|
||||
232 Ocarina Medley
|
||||
288 The Legend of Zelda Medley
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
import subprocess
|
||||
|
||||
albums = [ "Hyrule_Symphony.album" ]
|
||||
|
||||
for album in albums:
|
||||
subprocess.call(["sh", "gen_tracks.sh", album])
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
TRACK=1
|
||||
FFMPEG="ffmpeg -hide_banner -nostdin -f s16le -i /dev/zero -codec libvorbis -loglevel warning"
|
||||
|
||||
while read -r line; do
|
||||
if [ -z "$ARTIST" ]; then
|
||||
ARTIST="$line"
|
||||
elif [ -z "$ALBUM" ]; then
|
||||
YEAR=$(echo "$line" | cut -f 1 -d ' ')
|
||||
ALBUM=$(echo "$line" | cut -f 1 -d ' ' --complement)
|
||||
mkdir -p "$ALBUM"
|
||||
elif [ -z "$GENRE" ]; then
|
||||
GENRE="$line"
|
||||
else
|
||||
LENGTH=$(echo "$line" | cut -f 1 -d ' ')
|
||||
TITLE=$(echo "$line" | cut -f -1 -d ' ' --complement)
|
||||
NUMBER=$(printf "%02d" $TRACK)
|
||||
FILE="$ALBUM/$NUMBER - $TITLE.ogg"
|
||||
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo "$FILE"
|
||||
$FFMPEG -t "$LENGTH" "$FILE"
|
||||
vorbiscomment -w "$FILE" -t "TITLE=$TITLE" \
|
||||
-t "ARTIST=$ARTIST" \
|
||||
-t "ALBUM=$ALBUM" \
|
||||
-t "GENRE=$GENRE" \
|
||||
-t "DATE=$YEAR" \
|
||||
-t "TRACKNUMBER=$NUMBER"
|
||||
fi
|
||||
|
||||
let TRACK=$TRACK+1
|
||||
fi
|
||||
done < $1
|
|
@ -26,6 +26,9 @@ def UnitTest(test, sources):
|
|||
return run
|
||||
Export("UnitTest")
|
||||
|
||||
#Generate empty audio files
|
||||
SConscript("Music/Sconscript")
|
||||
|
||||
res = SConscript("core/Sconscript")
|
||||
if check_sanity == True:
|
||||
res = [ UnitTest("sanity", [ "sanity.c" ]) ] + res
|
||||
|
|
Loading…
Reference in New Issue