Audio Processing Quick Start
This tutorial walks through the shortest useful Gollek audio path:
- choose Speech-to-Text or Text-to-Speech first
- run one Java framework example
- verify one concrete output
- decide whether the broader framework page or the specialized runtime page is the next stop
See also:
- Audio Processing Docs
- Audio Processing
- Audio Processing Glossary
- Audio Processing Examples
- MOSS TTS ONNX
Path A: Speech-to-Text First
Use the Java framework path when you want transcription, timestamps, language detection, or streaming work in the SDK layer:
@Inject
ImprovedWhisperEngine whisperEngine;
public void transcribeAudio() {
Path audioPath = Paths.get("meeting.wav");
Path modelPath = Paths.get("/models/whisper-base");
AudioConfig config = AudioConfig.builder()
.task(AudioConfig.Task.TRANSCRIBE)
.language("en")
.autoLanguage(true)
.wordTimestamps(true)
.build();
AudioResult result = whisperEngine.transcribe(audioPath, modelPath, config)
.await().indefinitely();
System.out.println(result.getText());
}
The first useful verification step is simple:
- the call returns a non-empty transcription
- the detected language or segments look reasonable for the source audio
Path B: Text-to-Speech First
Use the Java framework path when you want preset voices, generated WAV output, or later expansion into custom speaker embeddings:
@Inject
ImprovedSpeechT5Engine ttsEngine;
public void synthesizeSpeech() throws Exception {
String text = "Hello from Gollek audio processing.";
String voice = "alloy";
Path modelPath = Paths.get("/models/speecht5-tts");
AudioConfig config = AudioConfig.builder()
.voice(voice)
.temperature(1.0f)
.build();
byte[] wavAudio = ttsEngine.synthesize(text, voice, modelPath, config)
.await().indefinitely();
Files.write(Paths.get("output.wav"), wavAudio);
}
The first useful verification step is:
output.wavis written successfully- the generated speech matches the expected voice and text
When To Use The Specialized Runtime Page
Use MOSS TTS ONNX when:
- the local ONNX runtime path is the actual deployment target
- the operational runtime details matter more than the broader framework API
- you are not starting from the general Java STT/TTS module view
Use the framework Audio Processing page when:
- you want the broader Java SDK story
- you need STT, TTS, VAD, streaming, or format handling in one place
Fast Decision Rule
- choose framework audio: when Java SDK integration is the main goal
- choose MOSS TTS ONNX: when the specialized local ONNX TTS runtime is the real target