Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

ffmpeg fix

Murtaza Nasird037e8f07bc2
diff --git a/app.py b/app.py
index 1302dedc..172c029f 100644
--- a/app.py
+++ b/app.py
@@ -1134,7 +1134,7 @@ def reprocess_transcription(recording_id):
try:
subprocess.run(
- ['ffmpeg', '-i', filepath, '-acodec', 'pcm_s16le', '-ar', '16000', '-ac', '1', wav_filepath],
+ ['ffmpeg', '-i', filepath, '-y', '-acodec', 'pcm_s16le', '-ar', '16000', '-ac', '1', wav_filepath],
check=True, capture_output=True, text=True
)
app.logger.info(f"Successfully converted {filepath} to {wav_filepath}")
@@ -1952,7 +1952,7 @@ def upload_file():
try:
# Using -acodec pcm_s16le for standard WAV format, 16kHz sample rate, mono
subprocess.run(
- ['ffmpeg', '-i', filepath, '-acodec', 'pcm_s16le', '-ar', '16000', '-ac', '1', wav_filepath],
+ ['ffmpeg', '-i', filepath, '-y', '-acodec', 'pcm_s16le', '-ar', '16000', '-ac', '1', wav_filepath],
check=True, capture_output=True, text=True
)
app.logger.info(f"Successfully converted {filepath} to {wav_filepath}")