diff --git a/src/simplestretch/__init__.py b/src/simplestretch/__init__.py index e5ac4db..c74f2c7 100644 --- a/src/simplestretch/__init__.py +++ b/src/simplestretch/__init__.py @@ -44,7 +44,10 @@ def stretch_audio( raise ValueError("'factor' must be greater than 0") if isinstance(audio, ndarray) and not isinstance(samplerate, int): - raise TypeError(f"You must provide a valid sample rate when working with raw audio data (Not {type(samplerate)})") + try: + samplerate = int(samplerate) + except: + raise TypeError(f"You must provide a valid sample rate when working with raw audio data (Not {type(samplerate)})") # If a file path is provided, load it as a ndarray using soundfile