Welcome to the Speech-to-Text (STT) & Text-to-Speech (TTS) Workshop by InnoWing, HKU.
This repository is developed by CHAMADOL Nutnornont & Ivan Xieyi Fan
Student Research Assistant Interns at Tam Wing Fan Innovation Wing, The University of Hong Kong
Duration: 1.5 hours
Workshop Flow:
- Introduction: Motivation & Live Demo
- Fundamental Concepts & Coding Skills
- Speech Generation (Text-to-Speech, TTS) Technology
- Speech Recognition (Speech-to-Text, STT) Technology
- Handling Unseen Words in Speech Recognition
Start with a live runnable Demo: Voice wake-up (e.g. "Xiao Ai"/ "Jarvis"), voice command (e.g. ask it to translate), voice output (AI speaks the translated result)
Explain the underlying workflow of the entire demo (VAD → ASR → LLM/NLP → TTS)
Briefly introduce the historical development of voice interaction technologies.
- Introduce basic audio concepts (sample rate, bit depth)
[Goal: Help non-technical students understand how audio is stored and captured] - Spectrogram (Explain what is the most important representation in speech processing and why it matters)
- Deep dive into how spectrograms are created (introduce the following concepts):
- Fourier Transform (FFT)
- Mel Scale / Mel Spectrogram
- MFCC and Filterbanks
- What are the mainstream models nowadays, and what are their core ideas? (CTC loss, Transformer/Conformer)
- Show a piece of code in Colab that calls e.g. Hugging Face or OpenAI service (teach participants how to use them)
- Introduce the evolution path of TTS technology (if possible, compare using three audio clips or live demos):
- Early concatenation-based methods
- Mid-period parametric synthesis
- Modern deep learning-based approaches
- TTS implementation pipeline:
- Text frontend (preprocessing)
- Acoustic model
- Vocoder
- Show a piece of code calling a TTS service, demonstrating results with different parameters (emotion, speech rate/length, etc.)
Explain some current limitations of mainstream technology (STT → NLP → TTS pipeline): high latency, information loss
Introduce that current mainstream research is moving toward fully End-to-End models (speech input directly to speech output)
Finally, provide some learning resources:
- Different models on Hugging Face
- Some classic papers
- How to use popular open-source frameworks (with pseudo-code or simple code examples)
For the demo, please run the following
uv sync
uv run main.py
OPENAI_API_KEY=<your_key>
OPENAI_BASE_URL=<base_url>
MODEL_NAME=<name>
FFMPEG_INPUT_DEVICE="default" (specify audio device to use on your device)
SPEAKER_ID=7000 (specify voice id you want to use)
Say marvin to wake the voice assistant, and try talk to her!!!
Say Goodbay or quit to exit voice assistant.