lovr icon indicating copy to clipboard operation
lovr copied to clipboard

audiostopped callback

Open bjornbytes opened this issue 3 years ago • 1 comments

It's annoying when audio applications don't automatically keep playing when devices are unplugged/changed. LÖVR can't currently detect this, but miniaudio has a ma_device_notification callback for when the device is stopped (unplugged) or rerouted (default device changed). Exposing this as something like a lovr.audiostopped and/or lovr.audiochanged event would let people reconfigure the device with lovr.audio.setDevice.

bjornbytes avatar May 01 '22 14:05 bjornbytes

"stopped" seems like it would get confused with sources/devices stopping, maybe a different verb like "lost" or "dropped" or "disconnected" would be better. The word "device" could also be used to make it more clear that this is related to devices instead of sources. e.g. audiodevicelost or audiodevicedisconnected (kind of long!) and audiodevicechanged

bjornbytes avatar May 06 '22 17:05 bjornbytes

On windows it seems everything is working sensibly now. Audio automatically gets rerouted as devices are connected/disabled/etc. For this case miniaudio fires stopped -> rerouted -> started events whenever something changes. If things are working as expected and doesn't require intervention on the part of the lovr project, maybe this API isn't really necessary. Need to check other platforms.

bjornbytes avatar Nov 16 '22 04:11 bjornbytes

Linux is okay too.

bjornbytes avatar Nov 16 '22 04:11 bjornbytes