cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Add method to query latency from `Stream`

Open marcpabst opened this issue 9 months ago • 3 comments

This is initial work to enable getting the current latency in samples from a Stream. The latency() -> Option<u32> method returns None by default, so this will already compile with all backends. So far, an implementation for coreaudio on MacOS is provided.

Addreses #773.

marcpabst avatar Mar 24 '25 20:03 marcpabst

I think this can be reviewed now - so far it only implements latency() for MacOS Core Audio but should be easy enough to support other backends too.

marcpabst avatar Mar 25 '25 21:03 marcpabst

Could I get some feedback on this? I'm considering pouring some work into cpal (including improvments to the WASAPI backend) but I don't really want to maintain by own fork...

Edit: This was not meant to be offsensive at all, but it would be good to see if there's interest in this!

marcpabst avatar Apr 03 '25 10:04 marcpabst

@marcpabst I got added as maintainer and am doing some backlog grooming. Yes there is interest in this. I'd like to ensure that a sensical number of hosts would be supported coming out of the gates. So beyond CoreAudio also Alsa and WASAPI?

roderickvd avatar Jul 29 '25 20:07 roderickvd