How soniqo/speech-swift works
Speech Swift is a local Apple Silicon speech-AI library and command-line product, spanning transcription, alignment, speech generation, language models, and audio understanding and processing. A user can invoke the CLI for audio tasks, while the library also exposes a real-time voice pipeline: microphone audio enters the pipeline, which coordinates recognition, optional language-model response, and speech generation. The README documents additional model families and capabilities beyond the sampled source; those are represented at subsystem level. Connections among most CLI commands and model implementations are not established by the excerpts, so they are not drawn.
Main entry points: VoicePipeline.swift Voice pipeline · PipelineLLM.swift Pipeline LLM · AudioCLI.swift Speech CLI · Qwen3Chat On-device chat
Components 22
Product entry
- Speech CLI
Sources/AudioCLILib/AudioCLI.swift - Audio commands
Sources/AudioCLILib - Audio server
Sources/AudioServer/AudioServer.swift
Speech models
- Speech recognition
Sources/Qwen3ASR - Streaming ASR
Sources/NemotronStreamingASR - Forced alignment
Sources/Qwen3ASR/ForcedAligner.swift - Speech generation
Sources/Qwen3TTS - TTS model families
Sources/CosyVoiceTTS
Language models
- On-device chat
Sources/Qwen3Chat - Tool-call LLM
Sources/FunctionGemma/FunctionGemmaPipelineLLM.swift - Translation models
Sources/HibikiTranslate
Audio understanding
- Voice activity
Sources/SpeechVAD - Speaker diarization
Sources/SpeechVAD/DiarizationPipeline.swift - Language identification
Sources/SpeechLanguageID/SpeechLanguageIdentifier.swift - Enhance and restore
Sources/SpeechEnhancement - Source separation
Sources/SourceSeparation/SourceSeparation.swift - Music generation
Sources/StableAudio3MusicGen/StableAudio3MusicGen.swift
Runtime layers
- Voice pipeline
Sources/SpeechCore/VoicePipeline.swift - Pipeline LLM
Sources/AudioCommon/PipelineLLM.swift - Audio I/O
Sources/AudioCommon/AudioIO.swift - Model loading
Sources/AudioCommon/ModelLoader.swift
Other components
- User
Connections 11
- User → Speech CLI: invokes
- Speech CLI → Audio commands: dispatches
- User → Audio server: requests
- User → Voice pipeline: feeds audio
- Voice pipeline → Speech recognition: recognizes audio
- Voice pipeline → Voice activity: detects speech
- Voice pipeline → Pipeline LLM: requests response
- Voice pipeline → Speech generation: generates speech
- Tool-call LLM → Pipeline LLM: implements
- On-device chat → Pipeline LLM: Qwen bridge
- Voice pipeline → User: emits events