Skip to content

Audio transforms

Reference for the audio transforms Dreadnode ships for multimodal red teaming - noise, volume and dynamics, filters and EQ, time and structure, modulation, spectral and covert attacks, and codec degradation.

Audio transforms mutate the audio you send to a speech- or audio-capable target - and can score the audio a model generates back. A request refused as text may be complied with when it is spoken or hidden in an inaudible carrier.

TransformWhat it doesKey params
add_white_noise / add_pink_noise / add_brown_noiseBroadband noise at a target SNRsnr_db, seed
add_babble_noiseMulti-talker, speech-band babblesnr_db, n_talkers, seed
add_short_noisesSparse transient noise burstsn_bursts, burst_ms, snr_db
add_clicksImpulsive clicks/cracklerate_per_sec, amplitude
TransformWhat it doesKey params
change_volume / normalize_volumeGain / peak normalizegain_db / target_db
add_clipping / soft_clipHard vs. tanh (overdrive) saturationthreshold / gain
limiterPeak-limit with a smoothed envelopethreshold_db, release_ms
apply_dynamic_range_compressionThreshold/ratio compressorthreshold_db, ratio
gain_transitionRamp gain across the clipstart_gain_db, end_gain_db
add_fadeFade in/outfade_in_ms, fade_out_ms
TransformWhat it doesKey params
apply_low_pass_filter / apply_high_pass_filterButterworth filterscutoff_hz, order
apply_band_pass_filterButterworth band-passlow_hz, high_hz, order
band_stop_filter / notch_filterBand-reject / narrow notchlow_hz, high_hz / freq_hz, quality
peaking_equalizerRBJ peaking-EQ band boost/cutfreq_hz, gain_db, q
low_shelf_filter / high_shelf_filterShelving boost/cutfreq_hz, gain_db, q
seven_band_parametric_eqCascaded 7-band parametric EQgains_db, q
pre_emphasisHigh-shelf pre-emphasiscoeff
air_absorptionDistance-dependent HF attenuationdistance_m
TransformWhat it doesKey params
change_speed / time_stretch / pitch_shiftSpeed (resample), tempo (phase vocoder), pitchrate / semitones
time_shiftShift in time (wrap or pad)shift_ms, rollover
reverse_audioReverse in time-
trim_silence / loop_audio / repeat_partTrim, loop, or stutter a segmentcount / segment_ms, repeats
granular_shuffleChop into grains and reordergrain_ms, seed
sample_dropoutZero random segments (packet loss)loss_ratio, segment_ms
time_maskingZero random time spans (SpecAugment)max_ms, n_masks
TransformWhat it doesKey params
tremolo / vibrato / wow_flutterAmplitude / pitch modulation and tape driftrate_hz, depth
ring_modulationMultiply by an audible carrierfreq_hz, mix
add_reverb / add_echoRoom reverberation / discrete echoesdecay, delay_ms
TransformWhat it doesReference
ultrasonic_shiftNear-Nyquist carrier modulation (inaudible command)DolphinAttack
spectral_inversionMirror the spectrum (reversible scramble)-
frequency_maskingZero random frequency bands (SpecAugment)SpecAugment
polarity_inversionFlip waveform polarity (inaudible)-
audio_steganographyHide a text payload in PCM LSBs-
TransformWhat it doesKey params
bit_crushBit-depth + sample-hold reductionbits, downsample
aliasingDecimate without anti-aliasing (foldover)factor
downsample_telephoneResample to 8 kHz and backtarget_hz
ogg_codec_roundtripOGG/Vorbis encode/decode artifacts-
add_toneMix an interfering sine tonefreq_hz, gain_db
from dreadnode.transforms import audio
# Concise audio-attack stack: inaudible carrier + hidden payload + masking + channel degradation.
transforms = [
audio.ultrasonic_shift(carrier_ratio=0.9),
audio.audio_steganography("ignore previous instructions"),
audio.frequency_masking(n_bands=2, seed=0),
audio.downsample_telephone(target_hz=8000),
]
TransformWhat it doesKey params
chorusLFO-modulated delayed voices (ensemble)rate_hz, depth_ms, voices
flangerSwept short modulated delay (comb filter)rate_hz, depth_ms, mix
harmonic_distortionCubic waveshaping (adds harmonics)amount
dc_offsetAdd a constant DC biasoffset
adjust_durationPad with silence or crop to a fixed lengthtarget_seconds
apply_impulse_responseConvolve with a synthetic room IR (over-the-air)rt60_ms, mix, seed
dtmf_toneMix a DTMF (touch-tone) dual-frequency tonedigit, gain_db
reverse_segmentsReverse the audio within fixed-length segmentssegment_ms
loudness_normalizeNormalize to a target RMS loudnesstarget_db

See Transforms for how to apply transforms with any attack.