-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.sh
62 lines (47 loc) · 4.01 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/sh
DEST=artifacts/$MINGW_CHOST"_test"
rm -rf references
mkdir references
test-materials/ffmpeg.exe -i test-materials/battleThemeA.mp3 references/BattleThemeA.wav > /dev/null 2>&1
echo "Step 1. Generating reference PCM files"
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p2_44_128.aac -f s16le references/battleThemeA_p2_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p5_44_128.aac -f s16le references/battleThemeA_p5_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p23_44_128.aac -f s16le references/battleThemeA_p23_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p29_44_128.aac -f s16le references/battleThemeA_p29_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p39_44_128.aac -f s16le references/battleThemeA_p39_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p2_44_256.aac -f s16le references/battleThemeA_p2_44_256.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p2_44_m1.aac -f s16le references/battleThemeA_p2_44_m1.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i test-materials/BattleThemeA_p2_44_m5.aac -f s16le references/battleThemeA_p2_44_m5.pcm > /dev/null 2>&1
rm -rf $DEST
mkdir $DEST
# Execute using built binary.
echo "Step 2. Generating test AAC files using fdkaac.exe with libfdk-aac-2.dll"
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 2 -b 128 -o $DEST/BattleThemeA_p2_44_128.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 5 -b 128 -o $DEST/BattleThemeA_p5_44_128.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 23 -b 128 -o $DEST/BattleThemeA_p23_44_128.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 29 -b 128 -o $DEST/BattleThemeA_p29_44_128.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 39 -b 128 -o $DEST/BattleThemeA_p39_44_128.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 2 -b 256 -o $DEST/BattleThemeA_p2_44_256.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 2 -m 1 -o $DEST/BattleThemeA_p2_44_m1.aac references/BattleThemeA.wav
artifacts/$MINGW_CHOST/fdkaac.exe -S -p 2 -m 5 -o $DEST/BattleThemeA_p2_44_m5.aac references/BattleThemeA.wav
# Make raw pcm from encoded files.
echo "Step 3. Generating test PCM files"
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p2_44_128.aac -f s16le $DEST/battleThemeA_p2_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p5_44_128.aac -f s16le $DEST/BattleThemeA_p5_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p23_44_128.aac -f s16le $DEST/BattleThemeA_p23_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p29_44_128.aac -f s16le $DEST/BattleThemeA_p29_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p39_44_128.aac -f s16le $DEST/BattleThemeA_p39_44_128.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p2_44_256.aac -f s16le $DEST/BattleThemeA_p2_44_256.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p2_44_m1.aac -f s16le $DEST/BattleThemeA_p2_44_m1.pcm > /dev/null 2>&1
test-materials/ffmpeg.exe -i $DEST/BattleThemeA_p2_44_m5.aac -f s16le $DEST/BattleThemeA_p2_44_m5.pcm > /dev/null 2>&1
# Compare raw pcm files.
echo "Step 4. Comparing PCM files"
cmp references/battleThemeA_p2_44_128.pcm $DEST/battleThemeA_p2_44_128.pcm
cmp references/BattleThemeA_p5_44_128.pcm $DEST/BattleThemeA_p5_44_128.pcm
cmp references/BattleThemeA_p23_44_128.pcm $DEST/BattleThemeA_p23_44_128.pcm
cmp references/BattleThemeA_p29_44_128.pcm $DEST/BattleThemeA_p29_44_128.pcm
cmp references/BattleThemeA_p39_44_128.pcm $DEST/BattleThemeA_p39_44_128.pcm
cmp references/BattleThemeA_p2_44_256.pcm $DEST/BattleThemeA_p2_44_256.pcm
cmp references/BattleThemeA_p2_44_m1.pcm $DEST/BattleThemeA_p2_44_m1.pcm
cmp references/BattleThemeA_p2_44_m5.pcm $DEST/BattleThemeA_p2_44_m5.pcm
echo "====Test finished===="