| 
    Tizen Native API
    4.0
    
   
   | 
  
  
  
 
The Volume API provides functions to check and control volumes.
#include <sound_manager.h>
The Sound Manager Volume API allows you to:
The Sound Manager has predefined types of sounds.(system, notification, alarm, ringtone, media, call, voip, voice).
Current volume level of each type can be checked with sound_manager_get_volume(). To get the maximum supported volume level of each type, call sound_manager_get_max_volume(). The volume level of each type can be adjusted with sound_manager_set_volume().
The type of currently playing sound may be obtained by calling sound_manager_get_current_sound_type(). To set the type of the currently playing sound forcibly, call sound_manager_set_current_sound_type().
Functions | |
| int | sound_manager_get_max_volume (sound_type_e type, int *max) | 
| Gets the maximum volume level supported for a particular sound type.   | |
| int | sound_manager_set_volume (sound_type_e type, int volume) | 
| Sets the volume level specified for a particular sound type.   | |
| int | sound_manager_get_volume (sound_type_e type, int *volume) | 
| Gets the volume level specified for a particular sound type.   | |
| int | sound_manager_set_current_sound_type (sound_type_e type) TIZEN_DEPRECATED_API | 
| Sets the type of the sound being currently played.   | |
| int | sound_manager_get_current_sound_type (sound_type_e *type) | 
| Gets the type of the sound being currently played.   | |
| int | sound_manager_unset_current_sound_type (void) TIZEN_DEPRECATED_API | 
| Unsets the type of the sound being currently played.   | |
| int | sound_manager_set_volume_changed_cb (sound_manager_volume_changed_cb callback, void *user_data) TIZEN_DEPRECATED_API | 
| Registers a callback function to be invoked when the volume level is changed.   | |
| int | sound_manager_unset_volume_changed_cb (void) TIZEN_DEPRECATED_API | 
| Unregisters the volume change callback.   | |
| int | sound_manager_add_volume_changed_cb (sound_manager_volume_changed_cb callback, void *user_data, int *id) | 
| Adds a callback function to be invoked when the volume level is changed.   | |
| int | sound_manager_remove_volume_changed_cb (int id) | 
| Removes the volume change callback.   | |
Typedefs | |
| typedef void(* | sound_manager_volume_changed_cb )(sound_type_e type, unsigned int volume, void *user_data) | 
| Called when the system volume has changed.   | |
| typedef void(* sound_manager_volume_changed_cb)(sound_type_e type, unsigned int volume, void *user_data) | 
Called when the system volume has changed.
| [in] | type | The sound type of the changed volume | 
| [in] | volume | The new volume value | 
| [in] | user_data | The user data passed from the callback registration function | 
| enum sound_type_e | 
Enumeration for sound type.
| int sound_manager_add_volume_changed_cb | ( | sound_manager_volume_changed_cb | callback, | 
| void * | user_data, | ||
| int * | id | ||
| ) | 
Adds a callback function to be invoked when the volume level is changed.
| [in] | callback | Callback function to indicate change in volume | 
| [in] | user_data | The user data to be passed to the callback function | 
| [out] | id | The callback id | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_get_current_sound_type | ( | sound_type_e * | type | ) | 
Gets the type of the sound being currently played.
| [out] | type | The current sound type | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_NO_PLAYING_SOUND | No playing sound | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_get_max_volume | ( | sound_type_e | type, | 
| int * | max | ||
| ) | 
Gets the maximum volume level supported for a particular sound type.
| [in] | type | The sound type | 
| [out] | max | The maximum volume level | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| int sound_manager_get_volume | ( | sound_type_e | type, | 
| int * | volume | ||
| ) | 
Gets the volume level specified for a particular sound type.
| [in] | type | The sound type | 
| [out] | volume | The current volume level | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_remove_volume_changed_cb | ( | int | id | ) | 
Removes the volume change callback.
| [in] | id | The id of the callback to remove | 
| SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_set_current_sound_type | ( | sound_type_e | type | ) | 
Sets the type of the sound being currently played.
| [in] | type | The sound type to set | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_set_volume | ( | sound_type_e | type, | 
| int | volume | ||
| ) | 
Sets the volume level specified for a particular sound type.
| [in] | type | The sound type | 
| [in] | volume | The volume level to be set | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_PERMISSION_DENIED | Permission denied | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_set_volume_changed_cb | ( | sound_manager_volume_changed_cb | callback, | 
| void * | user_data | ||
| ) | 
Registers a callback function to be invoked when the volume level is changed.
| [in] | callback | Callback function to indicate change in volume | 
| [in] | user_data | The user data to be passed to the callback function | 
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_unset_current_sound_type | ( | void | ) | 
Unsets the type of the sound being currently played.
0 on success, otherwise a negative error value | SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system | 
| int sound_manager_unset_volume_changed_cb | ( | void | ) | 
Unregisters the volume change callback.
| SOUND_MANAGER_ERROR_NONE | Success | 
| SOUND_MANAGER_ERROR_INTERNAL | Internal error inside the sound system |