Skip to main content

Skinetic::Experimental::AudioStreamConfiguration

Experimental component to configure and open an audio stream. Feature is not available on Android.

Inherits from MonoBehaviour

Public Classes

Name
structAudioSettings
Struct containing settings for an audio connection.

Public Types

Name
enum classAudioPreset { E_CUSTOMDEVICE = 0, E_SKINETIC = 1, E_HSDMKI = 2, E_HSDMKII = 3, E_HSD0 = 4}
Preset of audio devices.

Public Functions

Name
string[]GetOutputDevicesNames()
Get names of available audio output devices.
string[]GetOutputDeviceAPIs(string outputName)
Get available APIs for a given output device identified by name.
intGetOutputDeviceInfo(string outputName, string apiName, ref int maxChannels, ref float defaultLowLatency, ref float defaultHighLatency)
Get settings extremum values of the output device identified by name and API.
int[]GetSupportedStandardSampleRates(string outputName, string apiName)
Get all supported standard sample rates of the output device identified by name and API.
intConnectAudio(SkineticDevice device)
Initialize an asynchronous connection to an audio device using the provided settings.

Public Properties

Name
AudioPresetDeviceAudioPreset
Selected preset of audio device.
stringDeviceName
Name of the targeted audio device.
stringAudioAPI
Name of the targeted API.
intSampleRate
Sample rate of the audio stream.
intBufferSize
Size of a chunk of data sent over the audio stream.
intNbStreamChannel
Number of channels to use while streaming to the haptic output.
floatSuggestedLatency
Desired latency in seconds.

Public Types Documentation

enum AudioPreset

EnumeratorValueDescription
E_CUSTOMDEVICE0Audio stream with a custom configuration.
E_SKINETIC1Autoconfiguration of the audioStream for the Skinetic device.
E_HSDMKI2Autoconfiguration of the audioStream for the HSD mk.I device.
E_HSDMKII3Autoconfiguration of the audioStream for the HSD mk.II device.
E_HSD04Autoconfiguration of the audioStream for the HSD 0 device.

Preset of audio devices.

E_CUSTOMDEVICE is to be used for a custom configuration.

Public Functions Documentation

function GetOutputDevicesNames

static string[] GetOutputDevicesNames()

Get names of available audio output devices.

Return: array of device names

If no device is available, the array will contain "noDevice". This allows to select which device to use if initializing the context with eAudioDevice. Not Available on Android.

function GetOutputDeviceAPIs

static string[] GetOutputDeviceAPIs(
string outputName
)

Get available APIs for a given output device identified by name.

Parameters:

  • outputName name of the output

Return: array of api names

If no API is available, the array will contain "noAPI". Not Available on Android.

function GetOutputDeviceInfo

static int GetOutputDeviceInfo(
string outputName,
string apiName,
ref int maxChannels,
ref float defaultLowLatency,
ref float defaultHighLatency
)

Get settings extremum values of the output device identified by name and API.

Parameters:

  • outputName name of the output
  • apiName name of the API
  • maxChannels max number of channel
  • defaultLowLatency minimum latency of the output device
  • defaultHighLatency maximum latency of the output device

Return: 0 if the values have been set successfully, an Error otherwise

Not Available on Android.

function GetSupportedStandardSampleRates

static int[] GetSupportedStandardSampleRates(
string outputName,
string apiName
)

Get all supported standard sample rates of the output device identified by name and API.

Parameters:

  • outputName name of the output
  • apiName name of the API

Return: array of available framerates

If the outputName or the API are not valid, an error is returned and the array is filled with all standard sample rates. Not Available on Android.

function ConnectAudio

int ConnectAudio(
SkineticDevice device
)

Initialize an asynchronous connection to an audio device using the provided settings.

Parameters:

  • device target device to connect through audio.

Return: 0 on success, an error otherwise.

This method substitute the connect() methode of the SkineticDevice component. If audioPreset is set to anything else other than AudioPreset::E_CUSTOMDEVICE, the provided settings are ignored and the ones corresponding to the preset are used instead. Not available for Android.

Public Property Documentation

property DeviceAudioPreset

AudioPreset DeviceAudioPreset;

Selected preset of audio device.

property DeviceName

string DeviceName;

Name of the targeted audio device.

If using a specific audioPreset other than eAudioDevice, the parameter will be ignored.

property AudioAPI

string AudioAPI;

Name of the targeted API.

Default value "any_API" uses any available API which match the configuration, if any.

property SampleRate

int SampleRate;

Sample rate of the audio stream.

If using a specific audioPreset, the parameter will be ignored.

property BufferSize

int BufferSize;

Size of a chunk of data sent over the audio stream.

property NbStreamChannel

int NbStreamChannel;

Number of channels to use while streaming to the haptic output.

If using a specific audio preset, the parameter will be ignored.Setting -1 will use the number of actuator of the layout, or a portion of it.

property SuggestedLatency

float SuggestedLatency;

Desired latency in seconds.

The value is rounded to the closest available latency value from the audio API.


Updated on 2024-01-05 at 15:08:44 +0000