cpal icon indicating copy to clipboard operation
cpal copied to clipboard

How to convert a SizedSample to a f32?

Open tuzz opened this issue 3 years ago • 1 comments

I am trying to upgrade my audio_mixer crate to the latest version of cpal. It currently depends on cpal 0.13.4.

I believe I have to change Sample to SizedSample but I can't find a way to convert a SizedSample to a plain f32.

This is the line I'm struggling to get to compile: https://github.com/tuzz/audio_mixer/blob/f47de2157d249d864a35a50fdd4f3fb562c50576/src/audio_recorder.rs#L34

Is there a conversion trait I need to include?

Thanks

tuzz avatar Feb 24 '23 20:02 tuzz

In theory to_sample should work.

est31 avatar Feb 24 '23 20:02 est31