You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for this crate, it's been super helpful!
Currently, when recording from a device, if that device gets disconnected (e.g. a USB microphone gets unplugged), the recording loop crashes at the next call to audio_client.get_next_nbr_frames() or audio_client.read_from_device(). The recommended fix seems to be to listen to device change notifications to synchronously detect when the device disappears and to retry recording with a different device.
The crate already supports registering audio session notifications, so I feel it would be reasonable to also support registering device change notifications. Looking over the Win32 documentation, this seems to require:
Implementing the IMMNotificationClient interface (just like IAudioSessionEvents for audio session change notifications);
Hi Henrik,
Thanks a lot for this crate, it's been super helpful!
Currently, when recording from a device, if that device gets disconnected (e.g. a USB microphone gets unplugged), the recording loop crashes at the next call to
audio_client.get_next_nbr_frames()
oraudio_client.read_from_device()
. The recommended fix seems to be to listen to device change notifications to synchronously detect when the device disappears and to retry recording with a different device.The crate already supports registering audio session notifications, so I feel it would be reasonable to also support registering device change notifications. Looking over the Win32 documentation, this seems to require:
IMMNotificationClient
interface (just likeIAudioSessionEvents
for audio session change notifications);IMMDeviceEnumerator::RegisterEndpointNotificationCallback
(just likeIAudioSessionControl::RegisterAudioSessionNotification
for audio session change notifications);Also, it seems like
AudioSessionControl
doesn't support unregistering session notifications. Is that intentional?The text was updated successfully, but these errors were encountered: