CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriAtomOutputDeviceObserver Class Reference

A component that monitors the connection status of audio output devices. More...

Inherits CriMonoBehaviour.

Public Types

enum  OutputDeviceType { BuiltinSpeaker, WiredDevice, WirelessDevice }
 Type of audio output device More...
 

Public Member Functions

delegate void DeviceConnectionChangeCallback (bool isConnected, OutputDeviceType deviceType)
 Connection state change callback delegate type More...
 

Properties

static DeviceConnectionChangeCallback OnDeviceConnectionChanged
 Connection state change callback delegate More...
 
static bool IsDeviceConnected [get]
 Gets device connection status More...
 
static OutputDeviceType DeviceType [get]
 Gets the output device type More...
 

Detailed Description

A component that monitors the connection status of audio output devices.

Description:
Use it by adding it to any GameObject.
You can monitor the connection status of the audio output device on your smartphone device and acquire the status externally.
By registering a delegate, you can also receive callbacks when the connection status changes.
To use this component, it is necessary to initialize the Atom library first.
Note:
Currently, the functions of this component only work on smartphones (Android / iOS).
Please wait for future updates for support for other platforms.

Member Enumeration Documentation

enum OutputDeviceType
strong

Type of audio output device

Description:
Types of device to which audio is output from the application.
See also
CriAtomOutputDeviceObserver::DeviceType
Enumerator
BuiltinSpeaker 

Internal Speaker

WiredDevice 

Wired device (wired headset, etc.)

WirelessDevice 

Wireless device (Bluetooth headset, etc.)

Member Function Documentation

delegate void DeviceConnectionChangeCallback ( bool  isConnected,
OutputDeviceType  deviceType 
)

Connection state change callback delegate type

Parameters
isConnectedOutput device connection status (false = disconnected, true = connected)
deviceTypeOutput device type
Description:
This is the type of the callback function that is called when the connection status of the audio output device changes.
See also
CriAtomOutputDeviceObserver::OnDeviceConnectionChanged

Property Documentation

DeviceConnectionChangeCallback OnDeviceConnectionChanged
staticaddremove

Connection state change callback delegate

Description:
This is a callback function that is called when the connection status of the audio output device changes.
Called from the application's main thread.
See also
CriAtomExOutputDeviceObserver::DeviceConnectionChangeCallback
bool IsDeviceConnected
staticget

Gets device connection status

Returns
Whether connected (false = disconnected, true = connected)
Description:
Returns whether an audio output device is connected to the machine.
Returns true if the output destination is a device other than the internal speaker.
OutputDeviceType DeviceType
staticget

Gets the output device type

Returns
Output device type
Description:
Gets the type of the current audio output device.

The documentation for this class was generated from the following file: