Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.43.1] - 2025-09-13
Fixed
- Fix a bug introduced in 0.43.0 where the noise added by
AddBackgroundNoisehad wrong offset if the noise was longer than the given signal.
0.43.0 - 2025-09-09
Changed
- Make
LoudnessNormalization400% faster by switching from pyloudnorm to the new and faster alternative loudness - Improve
AddBackgroundNoiseperformance: Only load/decode the part of the noise file that is needed, instead of the entire file. - Bump min Python version to 3.10
- Switch to a more modern type hint style
Deprecated
- Deprecate
"pydub"backend inMp3Compression, because pydub isn't maintained anymore, and depends on audioop, which got removed in Python 3.13. The recommended alternative is"fast-mp3-augment"
Removed
- Remove upper Python version limit to avoid hindering early adopters
- Remove LRU cache in
AddBackgroundNoise
0.42.0 - 2025-07-04
Added
- Add support for Python 3.13
- Add support for librosa 0.11.0
Changed
- Make
Mp3Compression25-300% faster (depending on hardware, audio properties like duration and number of channels and various params, like bitrate) with the newbackend="fast-mp3-augment"(now default). The extra dependency for this is fast-mp3-augment , which pulls a few useful tricks for faster execution. - Make
Limiter30% faster and easier to install (extra dependency is now numpy-audio-limiter instead of cylimiter ). TheLimiterbehavior has not changed, although there are minor numerical differences.
Fixed
- Handle non-contiguous audio ndarray input to
PitchShiftandTimeStretchproperly
0.41.0 - 2025-05-05
Added
- Add support for NumPy 2.x
- Add
weightsparameter toOneOf. This lets you guide the probability of each transform being chosen.
Changed
- Improve type hints
The TimeMask transform has been changed significantly:
- Breaking change: Remove
fadeparameter.fade_duration=0.0now denotes disabled fading. - Enable fading by default
- Apply a smooth fade curve instead of a linear one
- Add
mask_locationparameter - Change the default value of
min_band_partfrom 0.0 to 0.01 - Change the default value of
max_band_partfrom 0.5 to 0.2 - ~50% faster
The following examples show how you can adapt your code when upgrading from <=v0.40.0 to >=v0.41.0:
| <= 0.40.0 | >= 0.41.0 |
|---|---|
TimeMask(min_band_part=0.1, max_band_part=0.15, fade=True) |
TimeMask(min_band_part=0.1, max_band_part=0.15, fade_duration=0.01) |
TimeMask() |
TimeMask(min_band_part=0.0, max_band_part=0.5, fade_duration=0.0) |
Removed
SpecCompose,SpecChannelShuffleandSpecFrequencyMaskhave been removed. You can read more about this here: #391
0.40.0 - 2025-03-20
Added
- Add support for scipy>=1.13
Changed
- Lay the groundwork for NumPy 2.x support (version constraint update coming in the next release)
- Speed up
LoudnessNormalizationby ~20% - Improve test coverage and documentation
- Bump min
python-stretchversion and remove the limitation on the number of channels inPitchShift - Bump min numpy version to 1.22
- Bump min pyroomacoustics version to 0.7.4
Fixed
- Fix a bug where
TimeMaskcould raise an exception if the fade length became 0 - Disallow
min_cutoff_freq<= 0 inHighPassFilter - Make
AdjustDurationpicklable (useful for multiprocessing)
Removed
- Remove support for Python 3.8
0.39.0 - 2025-02-12
Changed
- Place an upper distance limit of 2500 meters in
AirAbsorptionin order to avoid numerical issues - Expand the allowed shift range in
PitchShiftfrom [-12, 12] to [-24, 24] - Switch to a higher quality method,
"signalsmith_stretch", inPitchShiftandTimeStretch. It sounds significantly better (e.g. less smearing) and is 50-100% faster than"librosa_phase_vocoder"
If you want to keep using the old method, "librosa_phase_vocoder", it can be done like this:
PitchShift(method="librosa_phase_vocoder")
TimeStretch(method="librosa_phase_vocoder")
Fixed
- Fix a bug where
AddShortNoises(include_silence_in_noise_rms_estimation=False)sometimes raised aValueErrordue to digital silence in a portion of a short noise. This bug was introduced in v0.36.1.
0.38.0 - 2024-12-06
Added
- Add/improve parameter validation in
AddGaussianSNR,GainTransition,LoudnessNormalizationandAddShortNoises - Add/update type hints for consistency
- Add human-readable string representation of audiomentations class instances
Changed
- Improve documentation with respect to consistency, clarity and grammar
- Adjust Python version compatibility range, so all patches of Python 3.12 are supported
Removed
- Remove deprecated *_in_db args in Gain, AddBackgroundNoise, AddGaussianSNR, GainTransition, LoudnessNormalization and AddShortNoises. Those args were deprecated since v0.31.0, and now they are gone. For details, check the documentation page of each transform.
For example:
| Old (deprecated since v0.31.0) | New |
|---|---|
Gain(min_gain_in_db=-12.0) |
Gain(min_gain_db=-12.0) |
Fixed
- Fix a bug where
AirAbsorptionoften chose the wrong humidity bucket - Fix wrong logic in validation check of relation between
crossfade_durationandmin_part_durationinRepeatPart - Fix default value of
max_absolute_rms_dbinAddBackgroundNoises. It was incorrectly set to -45.0, but is now -15.0. This bug was introduced in v0.31.0. - Fix various errors in the documentation of
AddShortNoisesandAirAbsorption - Fix a bug where
AddShortNoisessometimes raised aValueErrorbecause of an empty array. This bug was introduced in v0.36.1.
0.37.0 - 2024-09-03
Changed
- Leverage the SIMD-accelerated numpy-minmax package for speed
improvements. These transforms are faster now:
Limiter,Mp3CompressionandNormalize. Unfortunately, this change removes support for macOS running on Intel. Intel Mac users have the following options: A) use audiomentations 0.36.1, B) Create a fork of audiomentations, C) submit a patch to numpy-minmax, D) run Linux or Windows. - Limit numpy dependency to >=1.21,<2 for now, since numpy v2 is not officially supported yet.
0.36.1 - 2024-08-20
Changed
- Leverage the SIMD-accelerated numpy-rms package for significant speed
improvements. These transforms are faster now:
AddBackgroundNoise,AddColorNoise,AddGaussianSNR,AddShortNoises,Mp3CompressionandTanhDistortion. Unfortunately, this change removes support for Windows running on ARM.
0.36.0 - 2024-06-10
Added
- Add support for multichannel impulse responses in
ApplyImpulseResponse
Changed
Limiterno longer introduces delay. This is a backwards-incompatible change.- Make
RoomSimulatorfaster by avoiding unneeded calculations when the transform is not going to be applied (p<1) - Limit scipy dependency to <1.13 because 1.13 is not compatible for now.
0.35.0 - 2024-03-15
Added
- Add new transforms:
AddColorNoise,AliasingandBitCrush
0.34.1 - 2023-11-24
Changed
- Bump min numpy version from 1.18 to 1.21
- Use numpy.typing in type hints
- Optimize max abs calculations in terms of memory and speed. This makes
Normalize,Mp3CompressionandLimiterslightly faster.
0.33.0 - 2023-08-30
Changed
- Bump min numpy version from 1.16 to 1.18
- Bump min scipy version from 1.3 to 1.4
- Bump min python version from 3.7 to 3.8, because 3.7 is beyond end-of-life already
- Change some
AssertionErrorexceptions toValueError
The Shift transform has been changed:
- Removed
fadeparameter.fade_duration=0.0now denotes disabled fading. - Rename
min_fractiontomin_shiftandmax_fractiontomax_shift - Add
shift_unitparameter - Fading is enabled by default
- Smoother fade curve
These are breaking changes. The following examples show how you can adapt your code when upgrading from <=v0.32.0 to >=v0.33.0:
| <= 0.32.0 | >= 0.33.0 |
|---|---|
Shift(min_fraction=-0.5, max_fraction=0.5, fade=True, fade_duration=0.01) |
Shift(min_shift=-0.5, max_shift=0.5, shift_unit="fraction", fade_duration=0.01) |
Shift() |
Shift(fade_duration=0.0) |
Fixed
- Correct some wrong type hints
0.32.0 - 2023-08-15
Added
- Add new
RepeatParttransform
Changed
- Bump min version of numpy dependency from 1.13 to 1.16
- If a transform is in "frozen parameters" mode, but has no parameters yet, the transform will randomize/set parameters when it gets called for the first time
- Increase the threshold for raising
WrongMultichannelAudioShape. This allows some rare use cases where the number of channels slightly exceeds the number of samples.
Fixed
- Fix some type hints that were
np.arrayinstead ofnp.ndarray
0.31.0 - 2023-06-21
Changed
- Raise exception instead of warning when the given multichannel ndarray has wrong shape
- Add support for the latest librosa 0.10 version
- Switch to a faster default resampler internally in
PitchShift, leading to much faster execution. This requiressoxr. - Bump min
scipyrequirement from 1.0 to 1.3 - Rename "_in_db" to "_db" in args and parameters. Passing args with the old names still works, but is deprecated and will stop working in a future version.
0.30.0 - 2023-05-02
Added
- Add new
AdjustDurationtransform
Fixed
- Fix a bug where too loud inputs got wrap distortion when running them through
Mp3Compression
0.29.0 - 2023-03-15
Added
- Add
apply_toparameter that can be set to"only_too_loud_sounds"inNormalize
Changed
- Change default value of
noise_rmsfrom"relative"to"relative_to_whole_input"inAddShortNoises - Change default values of
min_snr_in_db(from0.0to-6.0),max_snr_in_db(from24.0to18.0),min_time_between_sounds(from4.0to2.0) andmax_time_between_sounds(from16.0to8.0) inAddShortNoises
Fixed
- Fix a bug where
Limiterraised an exception when it got digital silence as input
0.28.0 - 2023-01-12
Added
- Add/improve type hints
- Add/improve documentation
Fixed
- Fix a bug in
RoomSimulatorwhere the value ofmax_orderwas not respected
Removed
- Remove
FrequencyMaskthat had been deprecated since version 0.22.0.BandStopFilteris a good alternative.
0.27.0 - 2022-09-13
Changed
- Speed up
Limiterby ~8x - Fix/improve some docstrings and type hints
- Change default values in
TrimandApplyImpulseResponseaccording to the warnings that were added in v0.23.0 - Emit a FutureWarning when
noise_rmsinAddShortNoisesis not specified - the default value will change from "relative" to "relative_to_whole_input" in a future version.
0.26.0 - 2022-08-19
Added
- Add new transform
Lambda. Thanks to Thanatoz-1. - Add new transform
Limiter. Thanks to pzelasko.
Fixed
- Fix incorrect type hints in
RoomSimulator - Make
Shiftrobust to different sample rate inputs when parameters are frozen
0.25.1 - 2022-06-15
Fixed
- Fix a bug where
RoomSimulatorwould treat an x value as if it was y, and vice versa
0.25.0 - 2022-05-30
Added
- Add
AirAbsorptiontransform - Add mp4 to the list of recognized audio filename extensions
Changed
- Guard against invalid params in
TimeMask - Emit
FutureWarninginstead ofUserWarninginTrimandApplyImpulseResponse - Allow specifying a file path, a folder path, a list of files or a list of folders to
ApplyImpulseResponse,AddBackgroundNoiseandAddShortNoises. Previously only a path to a folder was allowed.
Fixed
- Fix a bug with
noise_transforminAddBackgroundNoisewhere some SNR calculations were done before thenoise_transformwas applied. This has sometimes led to incorrect SNR in the output. This changes the behavior ofAddBackgroundNoise(when noise_transform is used).
Removed
- Remove support for Python 3.6, as it is past its end of life already. RIP.
0.24.0 - 2022-03-18
Added
- Add
SevenBandParametricEQtransform - Add optional
noise_transforminAddShortNoises - Add .aac and .aif to the list of recognized audio filename endings
Changed
- Show warning if
top_dband/orpinTrimare not specified because their default values will change in a future version
Fixed
- Fix filter instability bug related to center freq above Nyquist freq in
LowShelfFilterandHighShelfFilter
0.23.0 - 2022-03-07
Added
- Add
Paddingtransform - Add
RoomSimulatortransform for simulating shoebox rooms usingpyroomacoustics - Add parameter
signal_gain_in_db_during_noiseinAddShortNoises
Changed
- Not specifying a value for
leave_length_unchangedinAddImpulseResponsenow emits a warning, as the default value will change fromFalsetoTruein a future version.
Removed
- Remove the deprecated
AddImpulseResponsealias. UseApplyImpulseResponseinstead. - Remove support for the legacy parameters
min_SNRandmax_SNRinAddGaussianSNR - Remove useless default path value in
AddBackgroundNoise,AddShortNoisesandApplyImpulseResponse
0.22.0 - 2022-02-18
Added
- Implement
GainTransition - Add support for librosa 0.9
- Add support for stereo audio in
Mp3Compression,ResampleandTrim - Add
"relative_to_whole_input"option fornoise_rmsparameter inAddShortNoises - Add optional
noise_transforminAddBackgroundNoise
Changed
- Improve speed of
PitchShiftby 6-18% when the input audio is stereo
Deprecated
- Deprecate
FrequencyMaskin favor ofBandStopFilter
Removed
- Remove support for librosa<=0.7.2
0.21.0 - 2022-02-10
Added
- Add support for multichannel audio in
ApplyImpulseResponse,BandPassFilter,HighPassFilterandLowPassFilter - Add
BandStopFilter(similar to FrequencyMask, but with overhauled defaults and parameter randomization behavior),PeakingFilter,LowShelfFilterandHighShelfFilter - Add parameter
add_all_noises_with_same_levelinAddShortNoises
Changed
- Change
BandPassFilter,LowPassFilter,HighPassFilter, to use scipy's butterworth filters instead of pydub. Now they have parametrized roll-off. Filters are now steeper than before by default - setmin_rolloff=6, max_rolloff=6to get the old behavior. They also support zero-phase filtering now. And they're at least ~25x times faster than before!
Removed
- Remove optional
waviodependency for audio loading
0.20.0 - 2021-11-18
Added
- Implement
OneOfandSomeOffor applying one of or some of many transforms. Transforms are randomly chosen every call. Inspired by augly. Thanks to Cangonin and iver56. - Add a new argument
apply_to_children(bool) inrandomize_parameters,freeze_parametersandunfreeze_parametersinComposeandSpecCompose.
Changed
- Insert three new parameters in
AddBackgroundNoise:noise_rms(defaults to "relative", which is the old behavior),min_absolute_rms_in_dbandmax_absolute_rms_in_db. This may be a breaking change if you usedAddBackgroundNoisewith positional arguments in earlier versions of audiomentations! Please use keyword arguments to be on the safe side - it should be backwards compatible then.
Fixed
- Remove global
pydubimport which was accidentally introduced in v0.18.0.pydubis considered an optional dependency and is imported only on demand now.
0.19.0 - 2021-10-18
Added
- Implement
TanhDistortion. Thanks to atamazian and iver56. - Add a
noise_rmsparameter toAddShortNoises. It defaults torelative, which is the old behavior.absoluteallows for adding loud noises to parts that are relatively silent in the input.
0.18.0 - 2021-08-05
Added
- Implement
BandPassFilter,HighPassFilter,LowPassFilterandReverse. Thanks to atamazian.
0.17.0 - 2021-06-25
Added
- Add a
fadeoption inShiftfor eliminating unwanted clicks - Add support for 32-bit int wav loading with scipy>=1.6
- Add support for float64 wav files. However, the use of this format is discouraged, since float32 is more than enough for audio in most cases.
- Implement
Clip. Thanks to atamazian. - Add some parameter sanity checks in
AddGaussianNoise - Officially support librosa 0.8.1
Changed
- Rename
AddImpulseResponsetoApplyImpulseResponse. The former will still work for now, but give a warning. - When looking for audio files in
AddImpulseResponse,AddBackgroundNoiseandAddShortNoises, follow symlinks by default. - When using the new parameters
min_snr_in_dbandmax_snr_in_dbinAddGaussianSNR, SNRs will be picked uniformly in the Decibel scale instead of in the linear amplitude ratio scale. The new behavior aligns more with human hearing, which is not linear.
Fixed
- Avoid division by zero in
AddImpulseResponsewhen input is digital silence (all zeros) - Fix inverse SNR characteristics in
AddGaussianSNR. It will continue working as before unless you switch to the new parametersmin_snr_in_dbandmax_snr_in_db. If you use the old parameters, you'll get a warning.
0.16.0 - 2021-02-11
Added
- Implement
SpecComposefor applying a pipeline of spectrogram transforms. Thanks to omerferhatt.
Fixed
- Fix a bug in
SpecChannelShufflewhere it did not support more than 3 audio channels. Thanks to omerferhatt. - Limit scipy version range to >=1.0,<1.6 to avoid issues with loading 24-bit wav files. Support for scipy>=1.6 will be added later.
0.15.0 - 2020-12-10
Added
- Add an option
leave_length_unchangedtoAddImpulseResponse
Fixed
- Fix picklability of instances of
AddImpulseResponse,AddBackgroundNoiseandAddShortNoises
0.14.0 - 2020-12-06
Added
- Implement
LoudnessNormalization - Implement
randomize_parametersinCompose. Thanks to SolomidHero. - Add multichannel support to
AddGaussianNoise,AddGaussianSNR,ClippingDistortion,FrequencyMask,PitchShift,Shift,TimeMaskandTimeStretch
0.13.0 - 2020-11-10
Added
- Lay the foundation for spectrogram transforms. Implement
SpecChannelShuffleandSpecFrequencyMask. - Configurable LRU cache for transforms that use external sound files. Thanks to alumae.
- Officially add multichannel support to
Normalize
Changed
- Show a warning if a waveform had to be resampled after loading it. This is because resampling is slow. Ideally, files on disk should already have the desired sample rate.
Fixed
- Correctly find audio files with upper case filename extensions.
- Fix a bug where AddBackgroundNoise crashed when trying to add digital silence to an input. Thanks to juheeuu.
0.12.1 - 2020-09-28
Changed
- Speed up
AddBackgroundNoise,AddShortNoisesandAddImpulseResponseby loading wav files with scipy or wavio instead of librosa.
0.12.0 - 2020-09-23
Added
- Implement
Mp3Compression - Officially support multichannel audio in
GainandPolarityInversion - Add m4a and opus to the list of recognized audio filename extensions
Changed
- Expand range of supported
librosaversions
Removed
- Python <= 3.5 is no longer officially supported, since Python 3.5 has reached end-of-life
- Breaking change: Internal util functions are no longer exposed directly. If you were doing
e.g.
from audiomentations import calculate_rms, now you have to dofrom audiomentations.core.utils import calculate_rms
0.11.0 - 2020-08-27
Added
- Implement
GainandPolarityInversion. Thanks to Spijkervet for the inspiration.
0.10.1 - 2020-07-27
Changed
- Improve the performance of
AddBackgroundNoiseandAddShortNoisesby optimizing the implementation ofcalculate_rms.
Fixed
- Improve compatibility of output files written by the demo script. Thanks to xwJohn.
- Fix division by zero bug in
Normalize. Thanks to ZFTurbo.
0.10.0 - 2020-05-05
Added
AddImpulseResponse,AddBackgroundNoiseandAddShortNoisesnow support aiff files in addition to flac, mp3, ogg and wav
Changed
- Breaking change:
AddImpulseResponse,AddBackgroundNoiseandAddShortNoisesnow include subfolders when searching for files. This is useful when your sound files are organized in subfolders.
Fixed
- Fix filter instability bug in
FrequencyMask. Thanks to kvilouras.
0.9.0 - 2020-02-20
Added
- Remember randomized/chosen effect parameters. This allows for freezing the parameters and applying the same effect to multiple sounds. Use transform.freeze_parameters() and transform.unfreeze_parameters() for this.
- Implement transform.serialize_parameters(). Useful for when you want to store metadata on how a sound was perturbed.
- Add a rollover parameter to
Shift. This allows for introducing silence instead of a wrapped part of the sound. - Add support for flac in
AddImpulseResponse - Implement
AddBackgroundNoisetransform. Useful for when you want to add background noise to all of your sound. You need to give it a folder of background noises to choose from. - Implement
AddShortNoises. Useful for when you want to add (bursts of) short noise sounds to your input audio.
Changed
- Disregard non-audio files when looking for impulse response files
- Switch to a faster convolve implementation. This makes
AddImpulseResponsesignificantly faster. - Expand supported range of librosa versions
Fixed
- Fix a bug in
ClippingDistortionwhere the min_percentile_threshold was not respected as expected. - Improve handling of empty input
0.8.0 - 2020-01-28
Added
- Add shuffle parameter in
Composer - Add
Resampletransformation - Add
ClippingDistortiontransformation - Add
fadeparameter toTimeMask
Thanks to askskro
0.7.0 - 2020-01-14
Added
AddGaussianSNRAddImpulseResponseFrequencyMaskTimeMaskTrim
Thanks to karpnv
0.6.0 - 2019-05-27
Added
- Implement peak normalization
0.5.0 - 2019-02-23
Added
- Implement
Shifttransform
Changed
- Ensure p is within bounds
0.4.0 - 2019-02-19
Added
- Implement
PitchShifttransform
Fixed
- Fix output dtype of
AddGaussianNoise
0.3.0 - 2019-02-19
Added
- Implement
leave_length_unchangedinTimeStretch
0.2.0 - 2019-02-18
Added
- Add
TimeStretchtransform - Parametrize
AddGaussianNoise
0.1.0 - 2019-02-15
Added
- Initial release. Includes only one transform:
AddGaussianNoise