Sample rate of input audio
#4
by
lucainiao
- opened
In your example code you had
'''
librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
audio_sample = librispeech_dummy[0]
model = ClapModel.from_pretrained("laion/larger_clap_music")
processor = ClapProcessor.from_pretrained("laion/larger_clap_music")
inputs = processor(audios=audio_sample["audio"]["array"], return_tensors="pt")
audio_embed = model.get_audio_features(**inputs)
'''
The audio sample is in sample rate 16000Hz. However, CLAP model sample rate is 48000Hz. As the input of processor is only an array without sample rate information, will it be bad doing so? Or I should always resample the input audio to 48000Hz sample rate before passing to processor?