tesselode / kira

Library for expressive game audio.
https://crates.io/crates/kira
Apache License 2.0
836 stars 42 forks source link

Add a #cfg to disable the logic that polls for device changes on macOS #46

Closed jakerr closed 1 year ago

jakerr commented 1 year ago

On macOS this polling causes crackling in the audio. This is most likely due to a bug in the cpal implementation. See: https://github.com/tesselode/kira/issues/38.

This is one of two optional solutions. The other is: #45.

I prefer this one as I don't think this needs to be configurable on macOS. Preventing this polling seems to eliminate the crackle and I haven't personally found any negative side effects.

Even when switching the default output device between my laptop speakers and a bluetooth speaker this seems to work flawlessly without this manual following of device configuration.

tesselode commented 1 year ago

Can confirm that the crackling issue exists on Mac OS, that this PR fixes it, and that the polling isn't needed to switch audio devices on Mac OS. Thank you so much for doing the research!

jakerr commented 1 year ago

No problem! Thank you for the quick turn around and for open sourcing this awesome library. I'm really enjoying working with it!