Skip to content

Commit 2fe0006

Browse files
any2wav: convert any audio/video to wav/PCM
A simple script to convert given files into WAV/PCM using ffmpeg.
1 parent 28d1310 commit 2fe0006

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

any2wav

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#! /bin/bash
2+
3+
# Tue Jan 7 17:57:16 2014
4+
# Convert any media file with an audio stream to a wav file
5+
6+
# Mon 04 Nov 2019 10:09:46 PM
7+
# mplayer -> ffmpeg; replace file extension instead of appending it - requires bash
8+
9+
for i in "$@"; do
10+
echo -n "Processing '$i' ... "
11+
test -n "`echo "$i" | grep '\.wav$'`" && echo "$i is already a wav file. Skipping" && continue
12+
ext="${i##*.}"
13+
wav="${i%.$ext}.wav"
14+
test "$wav" == "$i" && wav="$i.wav" # In case I screwed up
15+
test -f "$wav" && echo "$wav already exists. Skipping." && continue
16+
ffmpeg -hide_banner -nostats -loglevel warning -i "$i" -map_metadata -1 -fflags +bitexact -vn "$wav" && echo "OK"
17+
done

0 commit comments

Comments
 (0)