Files
ki-story/compact.sh

20 lines
285 B
Bash
Executable File

#!/bin/sh
cd "$(dirname "$0")"
CHAPTER="$1"
if test -z "$CHAPTER" || test -f "audio/$CHAPTER.mp3"; then
echo "Usage: $0 <chapter>" >&2
exit 1
fi
sox part* output.wav
ffmpeg -i output.wav audio/$CHAPTER.mp3
if [ $? -eq 0 ]; then
rm output.wav part*.wav
fi
echo "Done"