How aigc-audio/audiogpt works
1. Repository shape
This is a multi-project audio AI monorepo, not a single application. Each top-level folder implements a distinct task family, while the main repo ties them together under the AudioGPT umbrella. The architecture is mostly “shared research framework + task-specific subprojects.”
2. Top-level orchestration
audio-chatgpt.py is the visible entry point for the umbrella experience. The repo README positions AudioGPT as a system that can route user requests across speech, audio, music, singing, separation, enhancement, detection, and talking-head-related capabilities, but the code tree shows those capabilities are implemented as separate modules rather than one unified runtime.
3. NeuralSeq: core speech/singing framework
NeuralSeq is the largest reusable subsystem and is organized like a training/inference framework for TTS and singing voice synthesis. It contains:
- configs/ for model and dataset YAMLs
- data_gen/ for preprocessing, text normalization, binarization, and alignment
- egs/ for dataset-specific experiment recipes
- modules/ for model implementations
- tasks/ for training loops and task logic
- inference/ for model-specific inference entrypoints
- vocoders/ and modules/hifigan, modules/parallel_wavegan for waveform generation
4. NeuralSeq data pipeline boundary
The speech pipeline is clearly staged:
raw audio/text enters data_gen/tts and egs/datasets/audio/* preprocessors, passes through text processors and wav processors, then becomes indexed/binarized training data. The binarizer/pre-align scripts indicate the repo depends heavily on offline feature extraction and alignment before training.
5. NeuralSeq model boundary
NeuralSeq/modules holds the actual neural architectures, while NeuralSeq/tasks wraps them for training. Important model families include:
- fastspeech/ and tasks/tts/fs2* for FastSpeech-style TTS
- modules/GenerSpeech and tasks/tts/ps* for style/prosody-driven speech generation
- modules/diff and tasks/svs/diffsinger_task.py for diffusion-based generation
- modules/syntaspeech and tasks/tts/synta.py for syntactic/prosody-aware TTS
This separation means model code is not the same layer as training orchestration.
6. NeuralSeq output generation
Vocoding is a distinct boundary from acoustic modeling. vocoders/, modules/hifigan, and modules/parallel_wavegan convert predicted acoustic features such as mel spectrograms into waveform audio. The repo supports both HiFi-GAN and Parallel WaveGAN variants, so acoustic model output is typically not final audio until it passes through a vocoder.
7. Text-to-audio / Make-An-Audio stack
text_to_audio/Make_An_Audio is a self-contained diffusion-based generation system. Its architecture is split into:
- ldm/ for latent diffusion models, denoising, and conditioning
- ldm/modules/encoders/CLAP and open_clap for audio/text conditioning embeddings
- vocoder/ for waveform synthesis
- wav_evaluation/ for evaluation models and scoring
This subsystem is centered on generative conditioning rather than sequence-to-sequence speech synthesis.
8. Audio classification and detection
audio_detection contains two related detection stacks:
- audio_infer/pytorch/ for training, inference, evaluation, and dataset utilities around sound classification
- target_sound_detection/src/ for target sound localization/detection
The inclusion of metadata, blacklists, and evaluation scripts suggests this subsystem is optimized around dataset-driven supervised detection workflows.
9. Audio captioning / audio-to-text
audio_to_text/captioning is a separate encoder-decoder Transformer stack for generating text from audio. It has:
- model definitions in models/
- vocabulary and embedding tooling in utils/
- word/sentence embedding generation via BERT, FastText, and word2vec helpers
This subsystem is more NLP-oriented than the speech synthesis stacks and uses its own training utilities.
10. Spatial audio and source separation
mono2binaural and sound_extraction address transformation and separation tasks:
- mono2binaural/src/ implements warping and model logic for spatial audio conversion
- sound_extraction/model/ includes LASSNet, ResUNet, and FiLM-based components
- sound_extraction/utils/ handles STFT, mixtures, and WAV I/O
These projects are independent pipelines around audio transformation and extraction rather than generative speech.
11. Shared utilities and conventions
Across the repo, the recurring pattern is: YAML config → dataset preprocessing → task wrapper → model module → inference wrapper → audio output. Shared helpers live in places like NeuralSeq/utils, while each subproject also carries its own local utilities. This makes the repo modular but loosely coupled: each task family can usually be trained and inferred independently, with only high-level consistency shared across them.
12. Practical architecture boundary for diagramming
For an architecture diagram, draw the repo as a hub-and-spoke system:
- a top-level AudioGPT layer
- separate task-specific subsystems for speech synthesis, singing, text-to-audio, detection, captioning, separation, and binauralization
- within each subsystem, a repeated internal split between data preparation, model code, training/task logic, inference, and output/audio rendering
The strongest boundaries are between task families, and the strongest internal dependency is from preprocessing into model training and then into vocoder or evaluator components.
Main entry points: audio-chatgpt.py AudioGPT entry · tasks Task logic · modules Model modules · ldm LDM core
Components 17
AudioGPT
Top-level orchestration and multi-task entrypoint.
- AudioGPT entry · Umbrella script for the multi-task AudioGPT experience.
audio-chatgpt.py
NeuralSeq
Reusable speech and singing synthesis framework.
- NeuralSeq core · Shared research framework for TTS and singing voice synthesis.
NeuralSeq - Configs · Model, dataset, and experiment configuration layer.
NeuralSeq/configs - Data prep · Text normalization, preprocessing, alignment, and binarization.
NeuralSeq/data_gen - Task logic · Training loops and task wrappers for TTS and SVS.
NeuralSeq/tasks - Model modules · Core acoustic, diffusion, and syntactic model implementations.
NeuralSeq/modules - Inference · Speech and singing inference entrypoints.
NeuralSeq/inference - Vocoder · HiFi-GAN and Parallel WaveGAN waveform rendering layer.
NeuralSeq/vocoders
Generative audio
Text-to-audio diffusion and waveform rendering stack.
- Make-An-Audio · Self-contained text-to-audio and related generative audio subsystem.
text_to_audio/Make_An_Audio - LDM core · Latent diffusion models, denoising, and conditioning flow.
text_to_audio/Make_An_Audio/ldm - CLAP encoders · Audio/text embedding encoders used for diffusion conditioning.
text_to_audio/Make_An_Audio/ldm/modules/encoders - Audio vocoder · BigVGAN and HiFi-GAN waveform synthesis for generated audio.
text_to_audio/Make_An_Audio/vocoder - Wave eval · Waveform evaluation models and scoring utilities.
text_to_audio/Make_An_Audio/wav_evaluation
Audio understanding
Detection, captioning, spatial conversion, and separation subsystems.
- Detection stack · Sound classification and target sound detection workflows.
audio_detection - Audio captioning · Transformer-based audio captioning and text generation stack.
audio_to_text/captioning - Mono to binaural · Spatial conversion and warping pipeline for binaural output.
mono2binaural/src - Sound extraction · Source separation and audio extraction models and utilities.
sound_extraction
Connections 21
- AudioGPT entry → NeuralSeq core: routes to · Umbrella experience delegates to speech and singing capabilities.
- AudioGPT entry → Make-An-Audio: routes to · Umbrella experience delegates to generative audio capabilities.
- AudioGPT entry → Detection stack: routes to · Umbrella experience delegates to detection capabilities.
- AudioGPT entry → Audio captioning: routes to · Umbrella experience delegates to audio-to-text capabilities.
- AudioGPT entry → Mono to binaural: routes to · Umbrella experience delegates to spatial audio conversion.
- AudioGPT entry → Sound extraction: routes to · Umbrella experience delegates to separation workflows.
- NeuralSeq core → Configs: organized by · Framework is driven by YAML configuration.
- Configs → Data prep: drives · Configs define preprocessing and dataset preparation behavior.
- Data prep → Task logic: feeds · Prepared datasets are consumed by task wrappers.
- Task logic → Model modules: trains · Task layer orchestrates model optimization and losses.
- Model modules → Inference: served by · Trained models are exposed through inference entrypoints.
- Model modules → Vocoder: requires · Acoustic predictions are rendered to waveform audio.
- Task logic → Vocoder: supports · Vocoder tasks provide training and dataset wiring.
- Make-An-Audio → LDM core: contains · Main generative stack is centered on latent diffusion.
- LDM core → CLAP encoders: conditions on · Diffusion generation is guided by CLAP-style embeddings.
- LDM core → Audio vocoder: renders via · Generated representations are converted to waveform audio.
- Audio vocoder → Wave eval: validated by · Generated audio is scored and evaluated by waveform models.
- Detection stack → Audio captioning: shares audio IO · Both subsystems consume dataset-driven audio representations.
- Mono to binaural → Sound extraction: adjacent pipeline · Both are audio transformation and extraction-oriented subsystems.
- Vocoder → AudioGPT entry: surfaces output to · Speech synthesis output is surfaced through the umbrella experience.
- Audio vocoder → AudioGPT entry: surfaces output to · Generative audio output is surfaced through the umbrella experience.