sankethsj/audio-to-text-to-audio

Flask demo for local meeting audio -> transcription (faster-whisper) → translation (Helsinki Marian) → TTS (NeuTTSAir) with live SSE progress and downloadable output

0

stars

1

commits

Python

primary language

Oct 11, 2025

updated

flask
huggingface-transformers
neuttsair
python
speech-to-text
whisper
Browse cluster: Whisper-based speech recognition

README

Meeting Audio -> Transcribe & TTS (Flask demo)

Web UI screenshot

This demo provides a local web UI to:

  • Upload meeting audio (mp3/wav)
  • Transcribe using Faster Whisper
  • Translate segments (ja<->en) using Helsinki Marian models
  • Synthesize speech using the local NeuTTSAir implementation in lib/neuttsair

This repository includes a small single-page web UI (Flask + SSE) that shows live progress and lets you download the generated audio.

Quick overview

  • Uploads are stored at uploads/<task_uuid>/<original_filename>.
  • Outputs are written to outputs/<task_uuid>/<original_filename>.
  • Models are loaded at process start (see app.py). Progress state is stored in-memory (not durable).

Requirements

  • Python 3.10+ recommended
  • Install top-level requirements:
pip install -r requirements.txt
  • Install lib/neuttsair additional requirements:
pip install -r lib\neuttsair\requirements.txt

Install eSpeak (required for some phonemizers)

Some TTS phonemizers require eSpeak (espeak-ng). Follow the platform instructions in the eSpeak NG guide:

eSpeak NG installation guide

On Windows you may also need to set environment variables (example):

set PHONEMIZER_ESPEAK_LIBRARY=C:\Program Files\eSpeak NG\libespeak-ng.dll
set PHONEMIZER_ESPEAK_PATH=C:\Program Files\eSpeak NG

Configuration (app.py constants)

At the top of app.py you can customize model names and OS-specific phonemizer paths. Defaults included in the file:

WHISPER_MODEL_SIZE = "base"  # smaller model for CPU usage
JA_EN_MODEL_NAME = "Helsinki-NLP/opus-mt-ja-en"
EN_JA_MODEL_NAME = "Helsinki-NLP/opus-mt-en-jap"

WINDOWS_PHONEMIZER_ESPEAK_LIBRARY = "c:\\Program Files\\eSpeak NG\\libespeak-ng.dll"
WINDOWS_PHONEMIZER_ESPEAK_PATH = "c:\\Program Files\\eSpeak NG"

MACOS_PHONEMIZER_ESPEAK_LIBRARY = "/opt/homebrew/Cellar/espeak/1.48.04_1/lib/libespeak.1.1.48.dylib"

Adjust these values if you change install locations or model choices.

Run (Windows cmd.exe)

  1. Create and activate a venv (recommended):
python -m venv .venv
.venv\Scripts\activate
  1. Install requirements (both top-level and lib/neuttsair):
pip install -r requirements.txt
pip install -r lib\neuttsair\requirements.txt
  1. Start the web UI:
python app.py

Open http://127.0.0.1:5000/ in your browser. Drag & drop audio files or pick files to upload. The SPA shows live progress via SSE and provides download links when processing completes.

Notes & caveats

  • The demo loads models on startup and runs on CPU; expect high memory and CPU usage for larger models.
  • lib/neuttsair/neutts.py provides the local NeuTTSAir API. If you modify it, update lib/neuttsair/requirements.txt as needed.
  • Progress state is in-memory (progress_state dict). For production use, switch to a durable store (Redis) and a task queue (RQ/Celery).

Development tips

  • If you get errors about missing library paths for eSpeak, check the PHONEMIZER_ESPEAK_LIBRARY and PHONEMIZER_ESPEAK_PATH variables in app.py and ensure the file exists.
  • To reduce memory usage, consider loading smaller Whisper models or using an external model server.

Contributors

sankethsj

1 commits

sankethsj/audio-to-text-to-audio

Flask demo for local meeting audio -> transcription (faster-whisper) → translation (Helsinki Marian) → TTS (NeuTTSAir) with live SSE progress and downloadable output

0

stars

1

commits

Python

primary language

Oct 11, 2025

updated

flask
huggingface-transformers
neuttsair
python
speech-to-text
whisper
Browse cluster: Whisper-based speech recognition

README

Meeting Audio -> Transcribe & TTS (Flask demo)

Web UI screenshot

This demo provides a local web UI to:

  • Upload meeting audio (mp3/wav)
  • Transcribe using Faster Whisper
  • Translate segments (ja<->en) using Helsinki Marian models
  • Synthesize speech using the local NeuTTSAir implementation in lib/neuttsair

This repository includes a small single-page web UI (Flask + SSE) that shows live progress and lets you download the generated audio.

Quick overview

  • Uploads are stored at uploads/<task_uuid>/<original_filename>.
  • Outputs are written to outputs/<task_uuid>/<original_filename>.
  • Models are loaded at process start (see app.py). Progress state is stored in-memory (not durable).

Requirements

  • Python 3.10+ recommended
  • Install top-level requirements:
pip install -r requirements.txt
  • Install lib/neuttsair additional requirements:
pip install -r lib\neuttsair\requirements.txt

Install eSpeak (required for some phonemizers)

Some TTS phonemizers require eSpeak (espeak-ng). Follow the platform instructions in the eSpeak NG guide:

eSpeak NG installation guide

On Windows you may also need to set environment variables (example):

set PHONEMIZER_ESPEAK_LIBRARY=C:\Program Files\eSpeak NG\libespeak-ng.dll
set PHONEMIZER_ESPEAK_PATH=C:\Program Files\eSpeak NG

Configuration (app.py constants)

At the top of app.py you can customize model names and OS-specific phonemizer paths. Defaults included in the file:

WHISPER_MODEL_SIZE = "base"  # smaller model for CPU usage
JA_EN_MODEL_NAME = "Helsinki-NLP/opus-mt-ja-en"
EN_JA_MODEL_NAME = "Helsinki-NLP/opus-mt-en-jap"

WINDOWS_PHONEMIZER_ESPEAK_LIBRARY = "c:\\Program Files\\eSpeak NG\\libespeak-ng.dll"
WINDOWS_PHONEMIZER_ESPEAK_PATH = "c:\\Program Files\\eSpeak NG"

MACOS_PHONEMIZER_ESPEAK_LIBRARY = "/opt/homebrew/Cellar/espeak/1.48.04_1/lib/libespeak.1.1.48.dylib"

Adjust these values if you change install locations or model choices.

Run (Windows cmd.exe)

  1. Create and activate a venv (recommended):
python -m venv .venv
.venv\Scripts\activate
  1. Install requirements (both top-level and lib/neuttsair):
pip install -r requirements.txt
pip install -r lib\neuttsair\requirements.txt
  1. Start the web UI:
python app.py

Open http://127.0.0.1:5000/ in your browser. Drag & drop audio files or pick files to upload. The SPA shows live progress via SSE and provides download links when processing completes.

Notes & caveats

  • The demo loads models on startup and runs on CPU; expect high memory and CPU usage for larger models.
  • lib/neuttsair/neutts.py provides the local NeuTTSAir API. If you modify it, update lib/neuttsair/requirements.txt as needed.
  • Progress state is in-memory (progress_state dict). For production use, switch to a durable store (Redis) and a task queue (RQ/Celery).

Development tips

  • If you get errors about missing library paths for eSpeak, check the PHONEMIZER_ESPEAK_LIBRARY and PHONEMIZER_ESPEAK_PATH variables in app.py and ensure the file exists.
  • To reduce memory usage, consider loading smaller Whisper models or using an external model server.

Contributors

sankethsj

1 commits

Languages

Python

82.3%

HTML

17.7%