This commit is contained in:
CroneKorkN 2025-05-30 19:47:30 +02:00
parent 7a9afd4a0c
commit a02c620fa5
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
2 changed files with 4 additions and 2 deletions

2
create_chunks.py Normal file → Executable file
View file

@ -4,7 +4,7 @@ import subprocess
import datetime import datetime
import pytz import pytz
OUTDIR = "chunks_unprocessed" OUTDIR = "chunks"
DURATION = 10800 # 3 Stunden DURATION = 10800 # 3 Stunden
SOURCE = "pulse" # funktioniert mit PulseAudio SOURCE = "pulse" # funktioniert mit PulseAudio

View file

@ -87,11 +87,13 @@ def process_chunk(filename):
# Datei verschieben # Datei verschieben
output_path = os.path.join(OUTPUT_DIR, filename) output_path = os.path.join(OUTPUT_DIR, filename)
shutil.move(input_path, output_path) #shutil.move(input_path, output_path)
print(f"✅ Verschoben nach {output_path}") print(f"✅ Verschoben nach {output_path}")
def main(): def main():
os.makedirs(OUTPUT_DIR, exist_ok=True)
with concurrent.futures.ProcessPoolExecutor() as executor: with concurrent.futures.ProcessPoolExecutor() as executor:
files = [f for f in os.listdir(INPUT_DIR) if f.endswith(".flac")] files = [f for f in os.listdir(INPUT_DIR) if f.endswith(".flac")]
executor.map(process_chunk, files) executor.map(process_chunk, files)