Add wav-to-mp3.sh
This commit is contained in:
1 parent
e0d1cf30b1
commit
3379b3c58b
2 files changed
+16
-1
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ import getopt
|
|||||||
from subprocess import *
|
from subprocess import *
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
bitrate = 128
|
bitrate = 256
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(argv[1:], "b:")
|
opts, args = getopt.getopt(argv[1:], "b:")
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Loop through all .wav files in the current directory
|
||||||
|
for file in *.wav; do
|
||||||
|
# Skip if no .wav files exist (prevents literal "*.wav" execution)
|
||||||
|
[ -e "$file" ] || continue
|
||||||
|
|
||||||
|
# Replace .wav extension with .mp3
|
||||||
|
output="${file%.wav}.mp3"
|
||||||
|
|
||||||
|
echo "Converting: $file -> $output"
|
||||||
|
lame -v -b 256 "$file" "$output"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Conversion complete!"
|
||||||
Reference in new issue
Block a user