Initial commit
This commit is contained in:
21
mp3/045/convert.py
Executable file
21
mp3/045/convert.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/python3
|
||||
# coding=utf-8
|
||||
from pydub import AudioSegment
|
||||
import sys,os
|
||||
|
||||
def convert(wav):
|
||||
# Lade die WAV-Datei
|
||||
audio = AudioSegment.from_wav(wav)
|
||||
|
||||
print(wav)
|
||||
|
||||
output = os.path.splitext(wav)[0]
|
||||
outputname = output+".mp3"
|
||||
# print(outputname)
|
||||
|
||||
# Speichere sie als MP3 (z.B. mit einer Bitrate von 192 kbps)
|
||||
audio.export(outputname, format="mp3", bitrate="192k")
|
||||
|
||||
print("Konvertierung abgeschlossen!")
|
||||
|
||||
convert(sys.argv[1])
|
||||
Reference in New Issue
Block a user