`winecoreaudio` currently uses the `AudioDeviceID` as the device string (stored in the registry and used to correlate between Core Audio devices and generated GUIDs passed to Windows applications), but an `AudioDeviceID` may change between boots or even when a device is connected/disconnected.
Use the UID instead, which is persistent across boots and connects/disconnects. These are strings like `BuiltInSpeakerDevice` or `AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-000128469718180E:6,7`.
This only seems to be documented in the header files, from `AudioHardwareBase.h`: "`kAudioDevicePropertyDeviceUID`: A CFString that contains a persistent identifier for the AudioDevice. An AudioDevice's UID is persistent across boots. The content of the UID string is a black box and may contain information that is unique to a particular instance of an AudioDevice's hardware or unique to the CPU. Therefore they are not suitable for passing between CPUs or for identifying similar models of hardware."