Tizen Native API  5.0
Device

The Device API provides functions to query the information of sound devices.

Required Header

#include <sound_manager.h>

Overview

The Sound Manager Device API allows you to:

The list of currently connected sound device can be obtained by calling sound_manager_get_device_list(). To get the handle of each sound device, call sound_manager_get_next_device() and sound_manager_get_prev_device().

Device information, such as "type", "IO direction", "ID", "name", can be obtained by calling corresponding APIs.

Functions

int sound_manager_get_device_list (int device_mask, sound_device_list_h *device_list)
 Gets the list consisting of connected devices.
int sound_manager_free_device_list (sound_device_list_h device_list)
 Frees device list and each item of list.
int sound_manager_get_next_device (sound_device_list_h device_list, sound_device_h *device)
 Gets the next item of the device list.
int sound_manager_get_prev_device (sound_device_list_h device_list, sound_device_h *device)
 Gets the previous item of the device list.
int sound_manager_get_device_type (sound_device_h device, sound_device_type_e *type)
 Gets the type of the device.
int sound_manager_get_device_io_direction (sound_device_h device, sound_device_io_direction_e *io_direction)
 Gets the io direction of the device.
int sound_manager_get_device_id (sound_device_h device, int *id)
 Gets the id of the device.
int sound_manager_get_device_name (sound_device_h device, char **name)
 Gets the name of the device.
int sound_manager_is_device_running (sound_device_h device, bool *is_running)
 Checks if the device is running.
int sound_manager_get_device_state (sound_device_h device, sound_device_state_e *state) TIZEN_DEPRECATED_API
 Gets the state of the device.
int sound_manager_get_supported_sample_formats (sound_device_h device, sound_sample_format_e **formats, unsigned int *num_of_elems)
 Gets the device's supported sample formats.
int sound_manager_set_sample_format (sound_device_h device, sound_sample_format_e format)
 Sets the device's sample format.
int sound_manager_get_sample_format (sound_device_h device, sound_sample_format_e *format)
 Gets the device's sample format.
int sound_manager_get_supported_sample_rates (sound_device_h device, sound_sample_rate_e **rates, unsigned int *num_of_elems)
 Gets the device's supported sample rates.
int sound_manager_set_sample_rate (sound_device_h device, sound_sample_rate_e rate)
 Sets the device's sample rate.
int sound_manager_get_sample_rate (sound_device_h device, sound_sample_rate_e *rate)
 Gets the device's sample rate.
int sound_manager_set_avoid_resampling (sound_device_h device, bool enable)
 Sets the device's 'avoid resampling' property.
int sound_manager_get_avoid_resampling (sound_device_h device, bool *enabled)
 Gets the device's 'avoid resampling' property.
int sound_manager_set_media_stream_only (sound_device_h device, bool enable)
 Sets the restriction of stream type only for media.
int sound_manager_get_media_stream_only (sound_device_h device, bool *enabled)
 Gets the restriction of stream type only for media.
int sound_manager_add_device_connection_changed_cb (int device_mask, sound_device_connection_changed_cb callback, void *user_data, int *id)
 Adds a callback function to be invoked when the connection state of a sound device was changed.
int sound_manager_remove_device_connection_changed_cb (int id)
 Removes a callback function invoked when the connection of a sound device was changed.
int sound_manager_add_device_running_changed_cb (int device_mask, sound_device_running_changed_cb callback, void *user_data, int *id)
 Adds a callback function to be invoked when the state of a sound device was changed.
int sound_manager_remove_device_running_changed_cb (int id)
 Removes a callback function invoked when the state of a sound device was changed.
int sound_manager_add_device_state_changed_cb (int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id) TIZEN_DEPRECATED_API
 Adds a callback function to be invoked when the state of a sound device was changed.
int sound_manager_remove_device_state_changed_cb (int id) TIZEN_DEPRECATED_API
 Removes a callback function invoked when the state of a sound device was changed.

Typedefs

typedef void * sound_device_h
 Sound device handle.
typedef void * sound_device_list_h
 Sound device list handle.
typedef void(* sound_device_connection_changed_cb )(sound_device_h device, bool is_connected, void *user_data)
 Called when the connection state of a sound device was changed.
typedef void(* sound_device_running_changed_cb )(sound_device_h device, bool is_running, void *user_data)
 Called when the state of a sound device was changed.
typedef void(* sound_device_state_changed_cb )(sound_device_h device, sound_device_state_e state, void *user_data)
 Called when the state of a sound device was changed.

Typedef Documentation

typedef void(* sound_device_connection_changed_cb)(sound_device_h device, bool is_connected, void *user_data)

Called when the connection state of a sound device was changed.

Since :
3.0
Remarks:
device is freed by the platform after this callback exits.
Parameters:
[in]deviceThe sound_device
[in]is_connectedThe state of device connection: (true = connected, false = disconnected)
[in]user_dataThe user data passed from the callback registration function
Precondition:
You should add this callback using sound_manager_add_device_connection_changed_cb().
See also:
sound_manager_add_device_connection_changed_cb()
sound_manager_remove_device_connection_changed_cb()
typedef void* sound_device_h

Sound device handle.

Since :
2.3
typedef void* sound_device_list_h

Sound device list handle.

Since :
2.3
typedef void(* sound_device_running_changed_cb)(sound_device_h device, bool is_running, void *user_data)

Called when the state of a sound device was changed.

Since :
5.0
Remarks:
device is freed by the platform after this callback exits.
Parameters:
[in]deviceThe sound_device
[in]is_runningThe state of the device: (true = running, false = not running)
[in]user_dataThe user data passed from the callback registration function
Precondition:
You should add this callback using sound_manager_add_device_running_changed_cb().
See also:
sound_manager_add_device_running_changed_cb()
sound_manager_remove_device_running_changed_cb()
typedef void(* sound_device_state_changed_cb)(sound_device_h device, sound_device_state_e state, void *user_data)

Called when the state of a sound device was changed.

Deprecated:
Deprecated since 4.0. Use sound_device_running_changed_cb() instead.
Since :
3.0
Remarks:
device is freed by the platform after this callback exits.
Parameters:
[in]deviceThe sound_device
[in]stateThe state of the device
[in]user_dataThe user data passed from the callback registration function
Precondition:
You should add this callback using sound_manager_add_device_state_changed_cb().
See also:
sound_manager_add_device_state_changed_cb()
sound_manager_remove_device_state_changed_cb()

Enumeration Type Documentation

Enumeration for sound device direction.

Since :
2.3
Enumerator:
SOUND_DEVICE_IO_DIRECTION_IN 

Input device

SOUND_DEVICE_IO_DIRECTION_OUT 

Output device

SOUND_DEVICE_IO_DIRECTION_BOTH 

Input/output device (both directions are available)

Enumeration for sound device mask.

Since :
2.3
Enumerator:
SOUND_DEVICE_IO_DIRECTION_IN_MASK 

Mask for input devices

SOUND_DEVICE_IO_DIRECTION_OUT_MASK 

Mask for output devices

SOUND_DEVICE_IO_DIRECTION_BOTH_MASK 

Mask for input/output devices (both directions are available)

SOUND_DEVICE_TYPE_INTERNAL_MASK 

Mask for built-in devices

SOUND_DEVICE_TYPE_EXTERNAL_MASK 

Mask for external devices

SOUND_DEVICE_STATE_DEACTIVATED_MASK 

Mask for deactivated devices (Deprecated since 4.0)

SOUND_DEVICE_STATE_ACTIVATED_MASK 

Mask for activated devices (Deprecated since 4.0)

SOUND_DEVICE_ALL_MASK 

Mask for all devices

Enumeration for sound device state.

Deprecated:
Deprecated since 4.0.
Since :
2.3
Enumerator:
SOUND_DEVICE_STATE_DEACTIVATED 

Deactivated state

SOUND_DEVICE_STATE_ACTIVATED 

Activated state

Enumeration for sound device type.

Since :
2.3
Enumerator:
SOUND_DEVICE_BUILTIN_SPEAKER 

Built-in speaker

SOUND_DEVICE_BUILTIN_RECEIVER 

Built-in receiver

SOUND_DEVICE_BUILTIN_MIC 

Built-in mic

SOUND_DEVICE_AUDIO_JACK 

Audio jack that can be connected to wired accessory such as headphone, headset, and so on

SOUND_DEVICE_BLUETOOTH_MEDIA 

Bluetooth device representing media (A2DP) profile (Since 3.0)

SOUND_DEVICE_HDMI 

HDMI

SOUND_DEVICE_FORWARDING 

Device for forwarding (Since 3.0)

SOUND_DEVICE_USB_AUDIO 

USB Audio

SOUND_DEVICE_BLUETOOTH_VOICE 

Bluetooth device representing voice (SCO) profile (Since 3.0)

Enumeration for sound sample format.

Since :
5.0
Enumerator:
SOUND_SAMPLE_FORMAT_U8 

Unsigned 8 bit samples

SOUND_SAMPLE_FORMAT_S16_LE 

Signed 16 bit samples

SOUND_SAMPLE_FORMAT_S24_LE 

Signed 24 bit samples

SOUND_SAMPLE_FORMAT_S24_32_LE 

Signed 24 bit(packed in 32 bit) samples

Enumeration for sound sample rate.

Since :
5.0
Enumerator:
SOUND_SAMPLE_RATE_8000 

8000 Hz sample rate

SOUND_SAMPLE_RATE_16000 

16000 Hz sample rate

SOUND_SAMPLE_RATE_22050 

22050 Hz sample rate

SOUND_SAMPLE_RATE_44100 

44100 Hz sample rate

SOUND_SAMPLE_RATE_48000 

48000 Hz sample rate

SOUND_SAMPLE_RATE_88200 

88200 Hz sample rate

SOUND_SAMPLE_RATE_96000 

96000 Hz sample rate

SOUND_SAMPLE_RATE_192000 

192000 Hz sample rate


Function Documentation

int sound_manager_add_device_connection_changed_cb ( int  device_mask,
sound_device_connection_changed_cb  callback,
void *  user_data,
int *  id 
)

Adds a callback function to be invoked when the connection state of a sound device was changed.

Since :
3.0
Parameters:
[in]device_maskDevices for which changes should be tracked, values of sound_device_mask_e combined with bitwise 'or'
[in]callbackThe device connection state changed callback function
[in]user_dataThe user data to be passed to the callback function
[out]idThe callback id
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
Postcondition:
sound_device_connection_changed_cb() will be invoked.
See also:
sound_manager_remove_device_connection_changed_cb()
sound_device_connection_changed_cb()
int sound_manager_add_device_running_changed_cb ( int  device_mask,
sound_device_running_changed_cb  callback,
void *  user_data,
int *  id 
)

Adds a callback function to be invoked when the state of a sound device was changed.

Since :
5.0
Parameters:
[in]device_maskDevices for which changes should be tracked, values of sound_device_mask_e combined with bitwise 'or'
[in]callbackThe device state changed callback function
[in]user_dataThe user data to be passed to the callback function
[out]idThe callback id
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
Postcondition:
sound_device_running_changed_cb() will be invoked.
See also:
sound_manager_remove_device_running_changed_cb()
sound_device_running_changed_cb()
int sound_manager_add_device_state_changed_cb ( int  device_mask,
sound_device_state_changed_cb  callback,
void *  user_data,
int *  id 
)

Adds a callback function to be invoked when the state of a sound device was changed.

Deprecated:
Deprecated since 4.0. Use sound_manager_add_device_running_changed_cb() instead.
Since :
3.0
Parameters:
[in]device_maskDevices for which changes should be tracked, values of sound_device_mask_e combined with bitwise 'or'
[in]callbackThe device state changed callback function
[in]user_dataThe user data to be passed to the callback function
[out]idThe callback id
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
Postcondition:
sound_device_state_changed_cb() will be invoked.
See also:
sound_manager_remove_device_state_changed_cb()
sound_device_state_connected_cb()

Frees device list and each item of list.

Since :
3.0
Remarks:
This function will deallocate not only device list itself but also each item.
Parameters:
[in]device_listThe device list got with sound_manager_get_device_list().
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
int sound_manager_get_avoid_resampling ( sound_device_h  device,
bool *  enabled 
)

Gets the device's 'avoid resampling' property.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
The default value of 'avoid resampling' is false.
Parameters:
[in]deviceThe device item
[in]enabledThe value of 'avoid resampling' property: (true = enabled, false = disabled)
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_set_avoid_resampling()
int sound_manager_get_device_id ( sound_device_h  device,
int *  id 
)

Gets the id of the device.

Since :
2.3
Parameters:
[in]deviceThe device item
[out]idThe id of the device
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()

Gets the io direction of the device.

Since :
2.3
Parameters:
[in]deviceThe device item
[out]io_directionThe io direction of the device
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()
int sound_manager_get_device_list ( int  device_mask,
sound_device_list_h device_list 
)

Gets the list consisting of connected devices.

Since :
3.0
Remarks:
device_list should be freed using sound_manager_free_device_list().
Use sound_manager_get_next_device() to get the first node of the list.
Parameters:
[in]device_maskThe mask values of sound_device_mask_e combined with bitwise 'or'
[out]device_listThe list of connected devices
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NO_DATANo data
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()
int sound_manager_get_device_name ( sound_device_h  device,
char **  name 
)

Gets the name of the device.

Since :
2.3
Parameters:
[in]deviceThe device item
[out]nameThe name of the device
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_is_device_running()
sound_manager_free_device_list()

Gets the state of the device.

Deprecated:
Deprecated since 4.0. Use sound_manager_is_device_running() instead.
Since :
2.3
Parameters:
[in]deviceThe device item
[out]stateThe state of the device
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_free_device_list()

Gets the type of the device.

Since :
2.3
Parameters:
[in]deviceThe device item
[out]typeThe type of the device
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()
int sound_manager_get_media_stream_only ( sound_device_h  device,
bool *  enabled 
)

Gets the restriction of stream type only for media.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
The property is not enabled as default.
Parameters:
[in]deviceThe device item
[out]enabledThe value of 'media stream only' property: (true = enabled, false = disabled)
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_set_media_stream_only()

Gets the next item of the device list.

Since :
2.3
Parameters:
[in]device_listThe list of connected devices
[out]deviceThe device item
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NO_DATANo data
See also:
sound_manager_get_device_list()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()

Gets the previous item of the device list.

Since :
2.3
Parameters:
[in]device_listThe list of connected devices
[out]deviceThe device item
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NO_DATANo data
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_is_device_running()
sound_manager_free_device_list()

Gets the device's sample format.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
Parameters:
[in]deviceThe device item
[out]formatThe sample format
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_supported_sample_formats()
sound_manager_set_sample_format()

Gets the device's sample rate.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
Parameters:
[in]deviceThe device item
[out]rateThe sample rate
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_supported_sample_rates()
sound_manager_set_sample_rate()
int sound_manager_get_supported_sample_formats ( sound_device_h  device,
sound_sample_format_e **  formats,
unsigned int *  num_of_elems 
)

Gets the device's supported sample formats.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
The formats should be released using free().
Parameters:
[in]deviceThe device item
[out]formatsThe supported sample format list
[out]num_of_elemsThe number of elements in the sample format list
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_set_sample_format()
sound_manager_get_sample_format()
int sound_manager_get_supported_sample_rates ( sound_device_h  device,
sound_sample_rate_e **  rates,
unsigned int *  num_of_elems 
)

Gets the device's supported sample rates.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
The rates should be released using free().
Parameters:
[in]deviceThe device item
[out]ratesThe supported sample rate list
[out]num_of_elemsThe number of elements in the sample rate list
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_set_sample_rate()
sound_manager_get_sample_rate()
int sound_manager_is_device_running ( sound_device_h  device,
bool *  is_running 
)

Checks if the device is running.

Since :
5.0
Parameters:
[in]deviceThe device item
[out]is_runningWhether the device is running or not: (true = running, false = not running)
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sound_manager_get_device_list()
sound_manager_get_next_device()
sound_manager_get_prev_device()
sound_manager_get_device_type()
sound_manager_get_device_io_direction()
sound_manager_get_device_id()
sound_manager_get_device_name()
sound_manager_free_device_list()

Removes a callback function invoked when the connection of a sound device was changed.

Since :
3.0
Parameters:
[in]idThe id of the callback to remove
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_add_device_connection_changed_cb()

Removes a callback function invoked when the state of a sound device was changed.

Since :
5.0
Parameters:
[in]idThe id of the callback to remove
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_add_device_running_changed_cb()

Removes a callback function invoked when the state of a sound device was changed.

Deprecated:
Deprecated since 4.0. Use sound_manager_remove_device_running_changed_cb() instead.
Since :
3.0
Parameters:
[in]idThe id of the callback to remove
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_add_device_state_changed_cb()
int sound_manager_set_avoid_resampling ( sound_device_h  device,
bool  enable 
)

Sets the device's 'avoid resampling' property.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
The 'avoid resampling' property is not enabled as default. With this enabled, device will
use the first stream's original sample format and rate without resampling if supported.
Parameters:
[in]deviceThe device item
[in]enableThe 'avoid resampling' property value to set: (true = enable, false = disable)
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_avoid_resampling()
int sound_manager_set_media_stream_only ( sound_device_h  device,
bool  enable 
)

Sets the restriction of stream type only for media.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device,
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
This property is not enabled as default. With this enabled, no other stream type
is allowed to device to play sound except for SOUND_STREAM_TYPE_MEDIA.
Parameters:
[in]deviceThe device item
[in]enableThe 'media stream only' property value to set: (true = enable, false = disable)
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_media_stream_only()

Sets the device's sample format.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device.
format should be one of the values received from sound_manager_get_supported_sample_formats(),
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
Parameters:
[in]deviceThe device item
[in]formatThe sample format
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_supported_sample_formats()
sound_manager_get_sample_format()

Sets the device's sample rate.

Since :
5.0
Remarks:
device should be SOUND_DEVICE_USB_AUDIO type and an output device.
rate should be one of the values received from sound_manager_get_supported_sample_rates(),
otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.
Use sound_manager_get_device_io_direction() to check if it is an output device or not.
Parameters:
[in]deviceThe device item
[in]rateThe sample rate
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_get_supported_sample_rates()
sound_manager_get_sample_rate()