cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Resampling for not supported rates

Open jingzhaoou opened this issue 2 years ago • 3 comments

I have an application to need to get the audio stream from microphone with a sample rate of 16K, which is not supported on my MacBook. I wonder if there is any way to resample the cpal stream? Can the dasp crate work for such purpose? I appreciate any help or sample code as I am currently stuck.

jingzhaoou avatar Feb 13 '23 22:02 jingzhaoou

I have used rubato for resampling the sound chunks I get in the cpal microphone input callback.

heinzelotto avatar Feb 19 '23 09:02 heinzelotto

Hi @heinzelotto and @jingzhaoou,

I have a similar need. Could you kindly provide an example code using rubato (or anything else) to achieve the same goal?

My specific case is from 48kHz 32-bit to 16kHz 16-bit.

Thanks a lot!

jBernavaPrah avatar Mar 28 '24 22:03 jBernavaPrah