Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/test-wav-conformity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Verify WAV Sounds Conform to Standard
on: [pull_request]
jobs:
PCX-Conformity:
name: Verify WAV Sounds Conform to Standard
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: Install file
run: apt update && apt install file -y
shell: bash
- name: Checkout
uses: actions/checkout@v2
- name: Wait for GitHub to keep up..
run: sleep 2s
shell: bash
- name: Run Script
run: |
bash testing/wav_validator.sh
Binary file modified common/sounds/misc/talk2.wav
Binary file not shown.
Binary file modified common/sounds/modes/gungame/upgrade.wav
Binary file not shown.
Binary file modified common/sounds/modes/gungame/win.wav
Binary file not shown.
Binary file modified common/sounds/music/gramophone_distorted.wav
Binary file not shown.
46 changes: 46 additions & 0 deletions testing/wav_validator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Nazi Zombies: Portable
# Validate .WAV files are mono.
# ----
# This is intended to be used via a Docker
# container running ubuntu:24.04.
#
set -o errexit

ASSETS_ROOT=$(dirname "${BASH_SOURCE[0]}")/../
cd "${ASSETS_ROOT}"

source "${ASSETS_ROOT}/testing/utils.sh"

#
# main()
# ----
# Test entry point.
#
function main()
{
local total_failures=0

# Iterate through every .wav in our assets..
while read -r wav_file; do
echo "[INFO]: Verifying WAV sound file [${wav_file}].."
local file_output=$(file "${wav_file}")

# Check for indexed keyword
if [[ "${file_output}" != *", mono "* ]]; then
echo " - ERROR: WAV [${wav_file}] is not a mono sample!"
total_failures=$((total_failures + 1))
fi
done < <(find . -type f -name "*.wav")

if [[ "${total_failures}" -ne 0 ]]; then
echo "[ERROR]: FAILED to validate [${total_failures}] WAV sounds!"
exit 1
else
echo "[PASS]: No issues found :)"
exit 0
fi
}

main;