Skip to content

Commit f2f09c8

Browse files
committed
SOUNDS: Fix sounds with stereo samples, add mono sound PR test
1 parent 4709735 commit f2f09c8

6 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Verify WAV Sounds Conform to Standard
2+
on: [pull_request]
3+
jobs:
4+
PCX-Conformity:
5+
name: Verify WAV Sounds Conform to Standard
6+
runs-on: ubuntu-latest
7+
container:
8+
image: ubuntu:24.04
9+
steps:
10+
- name: Install file
11+
run: apt update && apt install file -y
12+
shell: bash
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Wait for GitHub to keep up..
16+
run: sleep 2s
17+
shell: bash
18+
- name: Run Script
19+
run: |
20+
bash testing/wav_validator.sh

common/sounds/misc/talk2.wav

-2.58 KB
Binary file not shown.
-42.8 KB
Binary file not shown.
-91.7 KB
Binary file not shown.
-344 KB
Binary file not shown.

testing/wav_validator.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#
3+
# Nazi Zombies: Portable
4+
# Validate .WAV files are mono.
5+
# ----
6+
# This is intended to be used via a Docker
7+
# container running ubuntu:24.04.
8+
#
9+
set -o errexit
10+
11+
ASSETS_ROOT=$(dirname "${BASH_SOURCE[0]}")/../
12+
cd "${ASSETS_ROOT}"
13+
14+
source "${ASSETS_ROOT}/testing/utils.sh"
15+
16+
#
17+
# main()
18+
# ----
19+
# Test entry point.
20+
#
21+
function main()
22+
{
23+
local total_failures=0
24+
25+
# Iterate through every .wav in our assets..
26+
while read -r wav_file; do
27+
echo "[INFO]: Verifying WAV sound file [${wav_file}].."
28+
local file_output=$(file "${wav_file}")
29+
30+
# Check for indexed keyword
31+
if [[ "${file_output}" != *", mono "* ]]; then
32+
echo " - ERROR: WAV [${wav_file}] is not a mono sample!"
33+
total_failures=$((total_failures + 1))
34+
fi
35+
done < <(find . -type f -name "*.wav")
36+
37+
if [[ "${total_failures}" -ne 0 ]]; then
38+
echo "[ERROR]: FAILED to validate [${total_failures}] WAV sounds!"
39+
exit 1
40+
else
41+
echo "[PASS]: No issues found :)"
42+
exit 0
43+
fi
44+
}
45+
46+
main;

0 commit comments

Comments
 (0)