Repository navigation
Audio Processing
= edited this page Feb 10, 2026
·
1 revision
By default, transcriber passes the decoded audio straight to whisper without any extra processing. This is fine for most recordings.
For problematic audio (cheap mics, phone recordings, files with long silence padding), there are three optional processing steps you can turn on.
Some recording devices add a constant bias to the signal (the waveform isn't centered on zero). This can confuse whisper. DC offset removal subtracts the mean sample value.
let opts = TranscribeOptions::new()
.audio_processing(
AudioProcessing::new()
.dc_offset_removal(true)
);Scales the audio so the loudest sample hits 1.0. Useful for very quiet recordings where whisper might struggle.
let opts = TranscribeOptions::new()
.audio_processing(
AudioProcessing::new()
.normalize(true)
);Cuts leading and trailing silence. Handy for recordings that start with a long pause or end with minutes of dead air. Keeps a small padding (50ms by default) so speech edges aren't clipped.
let opts = TranscribeOptions::new()
.audio_processing(
AudioProcessing::new()
.trim_silence(true)
.silence_threshold_db(-30.0) // default: -40.0 dB
.silence_pad_ms(100) // default: 50ms
);// Turn everything on with defaults
let processing = AudioProcessing::all();
// Or pick and choose
let processing = AudioProcessing::new()
.dc_offset_removal(true)
.normalize(true)
.trim_silence(true)
.silence_threshold_db(-35.0);
let opts = TranscribeOptions::new()
.audio_processing(processing);| Problem | Fix |
|---|---|
| Whisper hallucinates on quiet audio | normalize(true) |
| Recording has a buzzy baseline | dc_offset_removal(true) |
| 5 minutes of silence at the end | trim_silence(true) |
| Voice recorder from a cheap mic | AudioProcessing::all() |
| Clean studio recording or YouTube | Leave defaults (all off) |