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.38.0 - 2024-12-06
Added
- Add/improve parameter validation in
AddGaussianSNR
,GainTransition
,LoudnessNormalization
andAddShortNoises
- 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
AirAbsorption
often chose the wrong humidity bucket - Fix wrong logic in validation check of relation between
crossfade_duration
andmin_part_duration
inRepeatPart
- Fix default value of
max_absolute_rms_db
inAddBackgroundNoises
. 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
AddShortNoises
andAirAbsorption
- Fix a bug where
AddShortNoises
sometimes raised aValueError
because 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
,Mp3Compression
andNormalize
. 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
,Mp3Compression
andTanhDistortion
. 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
-
Limiter
no longer introduces delay. This is a backwards-incompatible change. - Make
RoomSimulator
faster 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
,Aliasing
andBitCrush
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
,Mp3Compression
andLimiter
slightly 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
AssertionError
exceptions toValueError
The Shift
transform has been changed:
- Removed
fade
parameter.fade_duration=0.0
now denotes disabled fading. - Rename
min_fraction
tomin_shift
andmax_fraction
tomax_shift
- Add
shift_unit
parameter - Fading is enabled by default
- Smoother fade curve
These are breaking changes. The following example shows 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
RepeatPart
transform
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.array
instead 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
scipy
requirement 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
AdjustDuration
transform
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_to
parameter that can be set to"only_too_loud_sounds"
inNormalize
Changed
- Change default value of
noise_rms
from"relative"
to"relative_to_whole_input"
inAddShortNoises
- Change default values of
min_snr_in_db
(from0.0
to-6.0
),max_snr_in_db
(from24.0
to18.0
),min_time_between_sounds
(from4.0
to2.0
) andmax_time_between_sounds
(from16.0
to8.0
) inAddShortNoises
Fixed
- Fix a bug where
Limiter
raised 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
RoomSimulator
where the value ofmax_order
was not respected
Removed
- Remove
FrequencyMask
that had been deprecated since version 0.22.0.BandStopFilter
is a good alternative.
0.27.0 - 2022-09-13
Changed
- Speed up
Limiter
by ~8x - Fix/improve some docstrings and type hints
- Change default values in
Trim
andApplyImpulseResponse
according to the warnings that were added in v0.23.0 - Emit a FutureWarning when
noise_rms
inAddShortNoises
is 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
Shift
robust to different sample rate inputs when parameters are frozen
0.25.1 - 2022-06-15
Fixed
- Fix a bug where
RoomSimulator
would treat an x value as if it was y, and vice versa
0.25.0 - 2022-05-30
Added
- Add
AirAbsorption
transform - Add mp4 to the list of recognized audio filename extensions
Changed
- Guard against invalid params in
TimeMask
- Emit
FutureWarning
instead ofUserWarning
inTrim
andApplyImpulseResponse
- Allow specifying a file path, a folder path, a list of files or a list of folders to
ApplyImpulseResponse
,AddBackgroundNoise
andAddShortNoises
. Previously only a path to a folder was allowed.
Fixed
- Fix a bug with
noise_transform
inAddBackgroundNoise
where some SNR calculations were done before thenoise_transform
was 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
SevenBandParametricEQ
transform - Add optional
noise_transform
inAddShortNoises
- Add .aac and .aif to the list of recognized audio filename endings
Changed
- Show warning if
top_db
and/orp
inTrim
are 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
LowShelfFilter
andHighShelfFilter
0.23.0 - 2022-03-07
Added
- Add
Padding
transform - Add
RoomSimulator
transform for simulating shoebox rooms usingpyroomacoustics
- Add parameter
signal_gain_in_db_during_noise
inAddShortNoises
Changed
- Not specifying a value for
leave_length_unchanged
inAddImpulseResponse
now emits a warning, as the default value will change fromFalse
toTrue
in a future version.
Removed
- Remove the deprecated
AddImpulseResponse
alias. UseApplyImpulseResponse
instead. - Remove support for the legacy parameters
min_SNR
andmax_SNR
inAddGaussianSNR
- Remove useless default path value in
AddBackgroundNoise
,AddShortNoises
andApplyImpulseResponse
0.22.0 - 2022-02-18
Added
- Implement
GainTransition
- Add support for librosa 0.9
- Add support for stereo audio in
Mp3Compression
,Resample
andTrim
- Add
"relative_to_whole_input"
option fornoise_rms
parameter inAddShortNoises
- Add optional
noise_transform
inAddBackgroundNoise
Changed
- Improve speed of
PitchShift
by 6-18% when the input audio is stereo
Deprecated
- Deprecate
FrequencyMask
in 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
,HighPassFilter
andLowPassFilter
- Add
BandStopFilter
(similar to FrequencyMask, but with overhauled defaults and parameter randomization behavior),PeakingFilter
,LowShelfFilter
andHighShelfFilter
- Add parameter
add_all_noises_with_same_level
inAddShortNoises
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=6
to get the old behavior. They also support zero-phase filtering now. And they're at least ~25x times faster than before!
Removed
- Remove optional
wavio
dependency for audio loading
0.20.0 - 2021-11-18
Added
- Implement
OneOf
andSomeOf
for 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_parameters
andunfreeze_parameters
inCompose
andSpecCompose
.
Changed
- Insert three new parameters in
AddBackgroundNoise
:noise_rms
(defaults to "relative", which is the old behavior),min_absolute_rms_in_db
andmax_absolute_rms_in_db
. This may be a breaking change if you usedAddBackgroundNoise
with 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
pydub
import which was accidentally introduced in v0.18.0.pydub
is 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_rms
parameter toAddShortNoises
. It defaults torelative
, which is the old behavior.absolute
allows for adding loud noises to parts that are relatively silent in the input.
0.18.0 - 2021-08-05
Added
- Implement
BandPassFilter
,HighPassFilter
,LowPassFilter
andReverse
. Thanks to atamazian.
0.17.0 - 2021-06-25
Added
- Add a
fade
option inShift
for 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
AddImpulseResponse
toApplyImpulseResponse
. The former will still work for now, but give a warning. - When looking for audio files in
AddImpulseResponse
,AddBackgroundNoise
andAddShortNoises
, follow symlinks by default. - When using the new parameters
min_snr_in_db
andmax_snr_in_db
inAddGaussianSNR
, 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
AddImpulseResponse
when 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_db
andmax_snr_in_db
. If you use the old parameters, you'll get a warning.
0.16.0 - 2021-02-11
Added
- Implement
SpecCompose
for applying a pipeline of spectrogram transforms. Thanks to omerferhatt.
Fixed
- Fix a bug in
SpecChannelShuffle
where 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_unchanged
toAddImpulseResponse
Fixed
- Fix picklability of instances of
AddImpulseResponse
,AddBackgroundNoise
andAddShortNoises
0.14.0 - 2020-12-06
Added
- Implement
LoudnessNormalization
- Implement
randomize_parameters
inCompose
. Thanks to SolomidHero. - Add multichannel support to
AddGaussianNoise
,AddGaussianSNR
,ClippingDistortion
,FrequencyMask
,PitchShift
,Shift
,TimeMask
andTimeStretch
0.13.0 - 2020-11-10
Added
- Lay the foundation for spectrogram transforms. Implement
SpecChannelShuffle
andSpecFrequencyMask
. - 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
,AddShortNoises
andAddImpulseResponse
by loading wav files with scipy or wavio instead of librosa.
0.12.0 - 2020-09-23
Added
- Implement
Mp3Compression
- Officially support multichannel audio in
Gain
andPolarityInversion
- Add m4a and opus to the list of recognized audio filename extensions
Changed
- Expand range of supported
librosa
versions
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
Gain
andPolarityInversion
. Thanks to Spijkervet for the inspiration.
0.10.1 - 2020-07-27
Changed
- Improve the performance of
AddBackgroundNoise
andAddShortNoises
by 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
,AddBackgroundNoise
andAddShortNoises
now support aiff files in addition to flac, mp3, ogg and wav
Changed
- Breaking change:
AddImpulseResponse
,AddBackgroundNoise
andAddShortNoises
now 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
AddBackgroundNoise
transform. 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
AddImpulseResponse
significantly faster. - Expand supported range of librosa versions
Fixed
- Fix a bug in
ClippingDistortion
where 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
Resample
transformation - Add
ClippingDistortion
transformation - Add
fade
parameter toTimeMask
Thanks to askskro
0.7.0 - 2020-01-14
Added
AddGaussianSNR
AddImpulseResponse
FrequencyMask
TimeMask
Trim
Thanks to karpnv
0.6.0 - 2019-05-27
Added
- Implement peak normalization
0.5.0 - 2019-02-23
Added
- Implement
Shift
transform
Changed
- Ensure p is within bounds
0.4.0 - 2019-02-19
Added
- Implement
PitchShift
transform
Fixed
- Fix output dtype of
AddGaussianNoise
0.3.0 - 2019-02-19
Added
- Implement
leave_length_unchanged
inTimeStretch
0.2.0 - 2019-02-18
Added
- Add
TimeStretch
transform - Parametrize
AddGaussianNoise
0.1.0 - 2019-02-15
Added
- Initial release. Includes only one transform:
AddGaussianNoise