45 lines
1,022 B
Bash
45 lines
1,022 B
Bash
|
#!/usr/bin/env nix-shell
|
||
|
#!nix-shell -i bash -p bash ffmpeg
|
||
|
#shellcheck shell=bash
|
||
|
set -euo pipefail
|
||
|
|
||
|
if [[ $# -ne 2 ]]; then
|
||
|
echo "usage: $0 /path/to/necrodancer /path/to/output"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# Original songs named zone<zone>_<level>.ogg
|
||
|
# Remixes named zone<zone>_<level>_<remix>.ogg
|
||
|
# I think remix IDs are:
|
||
|
# (none): Danny Baranowsky
|
||
|
# 1: A_Rival
|
||
|
# 2: Jules Conroy
|
||
|
# 3: virt
|
||
|
# 4: Girlfriend Records
|
||
|
# 5: OverClocked
|
||
|
# 6: Masafumi Takada
|
||
|
# chp: Chipzel
|
||
|
|
||
|
music="$1/data/music"
|
||
|
sounds="$1/data/sounds_streaming"
|
||
|
|
||
|
for zone in {1..4}; do
|
||
|
if [[ $zone -eq 3 ]]; then
|
||
|
suffixes=( "c" "h" )
|
||
|
else
|
||
|
suffixes=( "" )
|
||
|
fi
|
||
|
for level in {1..3}; do
|
||
|
for remix in "" _1 _2 _3 _4 _6 _chp; do
|
||
|
for suffix in "${suffixes[@]}"; do
|
||
|
ffmpeg -y \
|
||
|
-i "$music/zone${zone}_${level}${remix}${suffix}.ogg" \
|
||
|
-i "$sounds/zone${zone}_${level}${suffix}_shopkeeper.ogg" \
|
||
|
-filter_complex amix=inputs=2:duration=longest \
|
||
|
-b:a 128k \
|
||
|
"$2/zone${zone}_${level}${remix}${suffix}_complete.opus"
|
||
|
done
|
||
|
done
|
||
|
done
|
||
|
done
|