Neue Files und aufegräumt

This commit is contained in:
Sven Riwoldt
2025-02-09 09:48:21 +01:00
parent dd2c3b4653
commit 61f97c0397
17 changed files with 5327 additions and 606 deletions

21
mp3cut/convert.py Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/python3
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])

View File

@@ -3,7 +3,7 @@ import speech_recognition as sr
import os
# Lade die MP3-Datei und konvertiere sie zu WAV
audio = AudioSegment.from_mp3("bis200.mp3")
audio = AudioSegment.from_mp3("bisEnde.mp3")
audio = audio.set_channels(2).set_frame_rate(48000) # Mono & 16kHz für bessere Erkennung
BUFFER_BEFORE = 300