-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathany2wav
More file actions
17 lines (14 loc) · 670 Bytes
/
any2wav
File metadata and controls
17 lines (14 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
# Tue Jan 7 17:57:16 2014
# Convert any media file with an audio stream to a wav file
# Mon 04 Nov 2019 10:09:46 PM
# mplayer -> ffmpeg; replace file extension instead of appending it - requires bash
for i in "$@"; do
echo -n "Processing '$i' ... "
test -n "`echo "$i" | grep '\.wav$'`" && echo "$i is already a wav file. Skipping" && continue
ext="${i##*.}"
wav="${i%.$ext}.wav"
test "$wav" == "$i" && wav="$i.wav" # In case I screwed up
test -f "$wav" && echo "$wav already exists. Skipping." && continue
ffmpeg -hide_banner -nostats -loglevel warning -i "$i" -map_metadata -1 -fflags +bitexact -vn "$wav" && echo "OK"
done