CRI ADX  Last Updated: 2024-07-17 10:48 p
Sound Device Selection
In a PC environment, the Atom library uses the device set as the Default Device when the library is initialized for sound output.
Even if that sound device is disabled, the Atom library will still function, however without performing any sound output.
(The amount of sound data used is calculated based on a timer, and the operation is emulated as closely as possible to when the sound output is enabled.)
Therefore, even in cases where the sound output device cannot be used, your application does not have to avoid making Atom library API calls.
Notes:
You can use the following APIs to check if the sound device was enabled when the Atom library was initialized.
Sound Device Initialization Checking Functions
Sound Output Method API Name
XAudio2 ::criAtom_GetOutputVoice_XAUDIO2
WASAPI criAtom_GetAudioClient_WASAPI
You can use the following APIs to check if the sound device was disabled while the application is running.
Sound Device Disabled Checking Functions
Sound Output Method API Name
XAudio2 ::criAtom_IsCriticalErrorOccurred_XAUDIO2
WASAPI criAtom_IsDeviceInvalidated_WASAPI
注意
Even though you can detect when a device is removed or added during the execution of the application, it is recommended that the user restarts the application.
(This is because problems may arise when implicitly using new devices, for example if several different devices exist.)