Skip to main content
For podcast production, run AudioSilenceTrim before AudioNormalize. Removing leading and trailing silence first ensures the normalizer measures only program content, not dead air, which produces a more accurate loudness target.

AudioTrimJob

Extracts a time range from an audio file, producing a shorter clip. Go method: Client.AudioTrim(ctx, job)

Parameters

input
string
required
Path to the source audio file.
output
string
required
Path for the trimmed output file.
start
float64
required
Start time of the clip in seconds.
end
float64
required
End time of the clip in seconds.

Example

result, err := client.AudioTrim(ctx, &dpf.AudioTrimJob{
    Input:  "podcast.mp3",
    Output: "segment.mp3",
    Start:  60.0,   // seconds
    End:    150.0,  // seconds
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

AudioNormalizeJob

Normalizes audio loudness to a target LUFS level using integrated loudness measurement (EBU R128). Go method: Client.AudioNormalize(ctx, job)

Parameters

input
string
required
Path to the source audio file.
output
string
required
Path for the normalized output file.
target_lufs
float64
required
Target integrated loudness in LUFS. Example: -14.0. See the table below for platform recommendations.
threshold_lufs
float64
Loudness gate threshold in LUFS. Segments quieter than this value are excluded from the integrated loudness measurement. Example: -50.0.

LUFS targets by platform

TargetPlatformStandard
-14 LUFSYouTubeYouTube loudness normalization
-16 LUFSSpotifySpotify loudness normalization
-23 LUFSBroadcastEBU R128 broadcast standard

Example

result, err := client.AudioNormalize(ctx, &dpf.AudioNormalizeJob{
    Input:      "audio.mp3",
    Output:     "audio_normalized.mp3",
    TargetLUFS: -14.0,
    Threshold:  func(f float64) *float64 { return &f }(-50.0),
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

AudioSilenceTrimJob

Removes leading and trailing silence from an audio file based on a decibel threshold. Go method: Client.AudioSilenceTrim(ctx, job)

Parameters

input
string
required
Path to the source audio file.
output
string
required
Path for the silence-trimmed output file.
threshold_db
float64
Silence detection threshold in dBFS. Audio below this level is treated as silence. Defaults to -40. Example: -40.0.
min_duration
float64
Minimum duration in seconds that a silent segment must have to be removed. Defaults to 0.5. Use a higher value to avoid cutting short natural pauses.

Example

result, err := client.AudioSilenceTrim(ctx, &dpf.AudioSilenceTrimJob{
    Input:       "audio_with_silence.mp3",
    Output:      "audio_clean.mp3",
    ThresholdDB: func(f float64) *float64 { return &f }(-40.0), // dB
    MinDuration: func(f float64) *float64 { return &f }(0.5),   // seconds
})
if err != nil {
    log.Fatal(err)
}
log.Printf("Success in %dms", result.ElapsedMs)

Build docs developers (and LLMs) love