Author Topic: Detect lost comunication with audio device?  (Read 84 times)

Ballinger

  • Posts: 45
Is it possible to use BASS to detect a lost contact with an audio device (most likely external USB etc). I would like to notify my user or refresh the device if an external interface is lost for example through losing power?

Ian @ un4seen

  • Administrator
  • Posts: 24797
Re: Detect lost comunication with audio device?
« Reply #1 on: 10 Jan '23 - 12:38 »
It is possible to get notified when a device fails (eg. is disconnected) via a BASS_SYNC_DEV_FAIL sync set on a channel on the device. The channel doesn't need to be playing for the sync to be triggered, but BASS does need to be playing something on the device or BASS_CONFIG_DEV_NONSTOP enabled.

Another option is to use the BASSWASAPI add-on's BASS_WASAPI_SetNotify function to request notification of when devices are enabled or disabled. You can still use normal BASS output then, ie. you could use BASSWASAPI just for the device notifications.

Ballinger

  • Posts: 45
Re: Detect lost comunication with audio device?
« Reply #2 on: 10 Jan '23 - 15:52 »
Ah that sounds really promising... I'll have a play. Thanks Ian.