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

Allow to provide `AddShortNoises` with a (list of) file path(s) #262

Closed mmxgn closed 1 year ago

mmxgn commented 1 year ago

Right now it only accepts a directory of audio files, it would be good to also allow for list of audio numpy arrays similar to ApplyImpulseResponse

atamazian commented 1 year ago

The ApplyImpulseResponse function doesn't allow a list of audio numpy arrays to be passed as input argument. Maybe you meant some other function?

mmxgn commented 1 year ago

Hm, sorry, I meant list of files :P

iver56 commented 1 year ago

The current implementation seems to allow a list of files:

class AddShortNoises(BaseWaveformTransform):
    (...)
    def __init__(
        self,
        sounds_path: Union[List[Path], List[str], Path, str],
        (...)
    ):
        """
        :param sounds_path: A path or list of paths to audio file(s) and/or folder(s) with
            audio files. Can be str or Path instance(s). The audio files given here are
            supposed to be (short) noises.

@mmxgn Can you check if your wish is already fulfilled?

mmxgn commented 1 year ago

yes it was