-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwavFormatTo16-44.sh
More file actions
executable file
·37 lines (30 loc) · 1.17 KB
/
wavFormatTo16-44.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
source @includes.sh
echo '###################################################'
echo '# Description: Forces format 16/44.1 wav'
echo '# Usage: $ ./wavFormatTo16-44.sh /path/to/audio.aif'
echo '# Param 1: Audio file'
echo '# Requires: ffmpeg'
echo '###################################################'
echoNewline
################################################################################
################################################################################
# check parameters
if [[ $1 == "" ]] ; then
echoError "1st arg must be an audio file"
exit 1
fi
################################################################################
################################################################################
# get filename
filename=$1
extension=$(extension $filename)
outputFile="$filename.16-44.wav"
# do conversion
ffmpeg -i $filename -af aformat=s16:44100 "$outputFile"
rm $filename
mv "$outputFile" $filename
################################################################################
################################################################################
# complete
echoSuccess "Normalized audio to 16/44.1 wav: $outputFile"