iver56 / audiomentations

A Python library for audio data augmentation. Inspired by albumentations. Useful for machine learning.
https://iver56.github.io/audiomentations/
MIT License
1.76k stars 183 forks source link

Update ApplyImpulseResponse to support multichannel IRs and convolution #334

Closed crlandsc closed 2 months ago

crlandsc commented 2 months ago

I discovered that all IRs were only being loaded in as mono IRs. I updated the transform so that it can support both mono and multichannel IRs and channel-wise convolution to retain the correct spatial information.

crlandsc commented 2 months ago

I updated the code with your suggestion for memory efficiency and cleaned it up a little more. I also added a stereo IR to verify compatibility with the unittest (which checks for both mono and stereo convolution). Everything checked out on my end, but let me know if there are other updates that should be made before merging.

iver56 commented 2 months ago

Thanks! I will take a look at it tomorrow

iver56 commented 2 months ago

https://github.com/crlandsc/audiomentations/pull/1

crlandsc commented 2 months ago

Just merged your PR!

crlandsc commented 2 months ago

Great thanks so much!