Skip to content

Conversation

@Jersonrn
Copy link

I added a feature to support resampling of audio arrays to a 16 kHz sample rate

@m-bain
Copy link
Owner

m-bain commented Oct 25, 2023

Mm could we instead use torchaudio for the resampling since this will use available backend (soundfile or sox flexibly etc.)

@Jersonrn
Copy link
Author

Mm could we instead use torchaudio for the resampling since this will use available backend (soundfile or sox flexibly etc.)

Yes, I just tested torchaudio, and it works correctly. I am addressing some bugs I found while adding support for 1D and 2D audio and different dtypes.

Resample audio arrays using torchaudio, taking advantage of its availability on the backend.

This function has been tested with arrays from the following libraries: torchaudio, librosa, scipy, and soundfile.

It has been tested with the following files:
- 'mono_int16_44kHz.wav'
- 'mono_int32_44kHz.wav'
- 'mono_float32_44kHz.wav'
- 'mono_float64_44kHz.wav'
- 'stereo_int16_44kHz.wav'
- 'stereo_int32_44kHz.wav'
- 'stereo_float32_44kHz.wav'
- 'stereo_float64_44kHz.wav'
- 'stereo_int16_8kHz.wav'
- 'stereo_int32_8kHz.wav'
- 'stereo_float32_8kHz.wav'
- 'stereo_float64_8kHz.wav'
- 'mono_int16_8kHz.wav'
- 'mono_int32_8kHz.wav'
- 'mono_float32_8kHz.wav'
- 'mono_float64_8kHz.wav'
@Jersonrn
Copy link
Author

Jersonrn commented Oct 28, 2023

@m-bain now works with torchaudio. Has been tested with arrays from torchaudio, librosa, scipy, soundfile and with the files:

  • 'mono_int16_44kHz.wav'
  • 'mono_int32_44kHz.wav'
  • 'mono_float32_44kHz.wav'
  • 'mono_float64_44kHz.wav'
  • 'stereo_int16_44kHz.wav'
  • 'stereo_int32_44kHz.wav'
  • 'stereo_float32_44kHz.wav'
  • 'stereo_float64_44kHz.wav'
  • 'stereo_int16_8kHz.wav'
  • 'stereo_int32_8kHz.wav'
  • 'stereo_float32_8kHz.wav'
  • 'stereo_float64_8kHz.wav'
  • 'mono_int16_8kHz.wav'
  • 'mono_int32_8kHz.wav'
  • 'mono_float32_8kHz.wav'
  • 'mono_float64_8kHz.wav'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants