Tizen Native API  4.0

The Session API provides functions to control a session. (Deprecated)

Required Header

#include <sound_manager.h>

Overview

The Sound Manager Session API allows you to:

  • determine a sound session policy
  • handle the notification of a sound session interruption

The Sound Manager has predefined sound sessions (media, alarm, notification, emergency, voip)

Related Features

APIs for voip sound session and voip stream type are related with the following features:

It is recommended to design feature related codes in your application for reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int sound_manager_set_session_type (sound_session_type_e type) TIZEN_DEPRECATED_API
 Sets the application's sound session type.
int sound_manager_get_session_type (sound_session_type_e *type) TIZEN_DEPRECATED_API
 Gets the application's sound session type.
int sound_manager_set_media_session_option (sound_session_option_for_starting_e s_option, sound_session_option_for_during_play_e d_option) TIZEN_DEPRECATED_API
 Sets the media sound session option.
int sound_manager_get_media_session_option (sound_session_option_for_starting_e *s_option, sound_session_option_for_during_play_e *d_option) TIZEN_DEPRECATED_API
 Gets the media sound session option.
int sound_manager_set_media_session_resumption_option (sound_session_option_for_resumption_e option) TIZEN_DEPRECATED_API
 Sets the media sound session resumption option.
int sound_manager_get_media_session_resumption_option (sound_session_option_for_resumption_e *option) TIZEN_DEPRECATED_API
 Gets the media sound session resumption option.
int sound_manager_set_voip_session_mode (sound_session_voip_mode_e mode) TIZEN_DEPRECATED_API
 Sets the mode of the voip sound session.
int sound_manager_get_voip_session_mode (sound_session_voip_mode_e *mode) TIZEN_DEPRECATED_API
 Gets the mode of the voip sound session.
int sound_manager_set_session_interrupted_cb (sound_session_interrupted_cb callback, void *user_data) TIZEN_DEPRECATED_API
 Registers a callback function to be invoked when the sound session being played was interrupted.
int sound_manager_unset_session_interrupted_cb (void) TIZEN_DEPRECATED_API
 Unregisters the callback function which is called when the sound session being played is interrupted.

Typedefs

typedef void(* sound_session_interrupted_cb )(sound_session_interrupted_code_e code, void *user_data)
 Called when the playing sound session is interrupted.

Typedef Documentation

typedef void(* sound_session_interrupted_cb)(sound_session_interrupted_code_e code, void *user_data)

Called when the playing sound session is interrupted.

Deprecated:
Deprecated since 3.0. Use sound_stream_focus_state_changed_cb instead.
Since :
2.3.1
Parameters:
[in]codeThe interrupted code
[in]user_dataThe user data passed from the callback registration function
Precondition:
You should register this callback using sound_manager_set_session_interrupted_cb().
See also:
sound_manager_set_session_interrupted_cb()
sound_manager_unset_session_interrupted_cb()

Enumeration Type Documentation

Enumeration for sound session interrupted type.

Deprecated:
Deprecated since 3.0. Use sound_stream_focus_state_changed_cb instead.
Since :
2.3.1
Enumerator:
SOUND_SESSION_INTERRUPTED_COMPLETED 

Interrupt completed

SOUND_SESSION_INTERRUPTED_BY_MEDIA 

Interrupted by media application

SOUND_SESSION_INTERRUPTED_BY_CALL 

Interrupted by an incoming call

SOUND_SESSION_INTERRUPTED_BY_EARJACK_UNPLUG 

Interrupted by unplugging headphones

SOUND_SESSION_INTERRUPTED_BY_RESOURCE_CONFLICT 

Interrupted by a resource conflict

SOUND_SESSION_INTERRUPTED_BY_ALARM 

Interrupted by an alarm

SOUND_SESSION_INTERRUPTED_BY_EMERGENCY 

Interrupted by an emergency

SOUND_SESSION_INTERRUPTED_BY_NOTIFICATION 

Interrupted by a notification

Enumeration for session option during play.

Deprecated:
Deprecated since 3.0. In sound_stream_focus_state_changed_cb, you can choose to stop playing or not.
Since :
2.3.1
Enumerator:
SOUND_SESSION_OPTION_INTERRUPTIBLE_DURING_PLAY 

This session will be interrupted by other sessions during play (default)

SOUND_SESSION_OPTION_UNINTERRUPTIBLE_DURING_PLAY 

This session will not be interrupted by other media sessions

Enumeration for session option for resumption.

Deprecated:
Deprecated since 3.0. In sound_stream_focus_state_changed_cb, you can choose to resume playing or not.
Since :
2.3.1
Enumerator:
SOUND_SESSION_OPTION_RESUMPTION_BY_SYSTEM 

This session will be resumed according to system policy (default)

SOUND_SESSION_OPTION_RESUMPTION_BY_SYSTEM_OR_MEDIA_PAUSED 

This session will be resumed according to system policy and when the media session which interrupted this session is paused

Enumeration for session option for starting.

Deprecated:
Deprecated since 3.0. Use sound_manager_acquire_focus() or not instead.
Since :
2.3.1
Enumerator:
SOUND_SESSION_OPTION_MIX_WITH_OTHERS_WHEN_START 

This session will be mixed with others when starting (default)

SOUND_SESSION_OPTION_PAUSE_OTHERS_WHEN_START 

This session will interrupt other sessions when starting

Enumeration for session type.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() and sound_stream_type_e instead.
Since :
2.3.1
Enumerator:
SOUND_SESSION_TYPE_MEDIA 

Media type

SOUND_SESSION_TYPE_ALARM 

Alarm type

SOUND_SESSION_TYPE_NOTIFICATION 

Notification type

SOUND_SESSION_TYPE_EMERGENCY 

Emergency type

SOUND_SESSION_TYPE_VOIP 

VoIP type

Enumeration for voip session mode.

Deprecated:
Deprecated since 3.0. Use sound_manager_apply_stream_routing() instead.
Since :
2.3.1
Enumerator:
SOUND_SESSION_VOIP_MODE_RINGTONE 

voip mode for ringtone

SOUND_SESSION_VOIP_MODE_VOICE_WITH_BUILTIN_RECEIVER 

voip mode for during call with built-in receiver

SOUND_SESSION_VOIP_MODE_VOICE_WITH_BUILTIN_SPEAKER 

voip mode for during call with built-in speaker

SOUND_SESSION_VOIP_MODE_VOICE_WITH_AUDIO_JACK 

voip mode for during call with audio jack

SOUND_SESSION_VOIP_MODE_VOICE_WITH_BLUETOOTH 

voip mode for during call with bluetooth


Function Documentation

Gets the media sound session option.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[out]s_optionThe session option for starting
[out]d_optionThe session option for during play
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_POLICYNoncompliance with the sound system policy
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_set_media_session_option()
sound_manager_set_media_session_resumption_option()
sound_manager_get_media_session_resumption_option()

Gets the media sound session resumption option.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[out]optionThe session resumption option
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_POLICYNoncompliance with the sound system policy
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_set_media_session_option()
sound_manager_get_media_session_option()
sound_manager_set_media_session_resumption_option()

Gets the mode of the voip sound session.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[out]modeThe voip session mode
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NOT_SUPPORTEDNot supported
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
SOUND_MANAGER_ERROR_POLICYNoncompliance with the sound system policy
Precondition:
Call sound_manager_set_session_type(SOUND_SESSION_TYPE_VOIP) before calling this function.
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_set_voip_session_mode()

Sets the media sound session option.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[in]s_optionThe session option for starting
[in]d_optionThe session option for during play
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_POLICYNoncompliance with the sound system policy
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_get_media_session_option()
sound_manager_set_media_session_resumption_option()
sound_manager_get_media_session_resumption_option()

Sets the media sound session resumption option.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[in]optionThe session resumption option
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_POLICYNoncompliance with the sound system policy
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_set_media_session_option()
sound_manager_get_media_session_option()
sound_manager_get_media_session_resumption_option()

Registers a callback function to be invoked when the sound session being played was interrupted.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[in]callbackThe interrupted callback function
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_POLICYNoncompliance with the sound system policy
Postcondition:
sound_session_interrupted_cb() will be invoked.
See also:
sound_manager_unset_session_interrupted_cb()
sound_session_interrupted_cb()

Sets the application's sound session type.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[in]typeThe session type to set
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NOT_SUPPORTEDNot supported
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
SOUND_MANAGER_ERROR_POLICYNoncompliance with the sound system policy
See also:
sound_manager_get_session_type()
sound_manager_set_media_session_option()
sound_manager_get_media_session_option()
sound_manager_set_media_session_resumption_option()
sound_manager_get_media_session_resumption_option()
sound_manager_set_voip_session_mode()
sound_manager_get_voip_session_mode()

Sets the mode of the voip sound session.

Deprecated:
Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
Since :
2.3.1
Parameters:
[in]modeThe voip session mode
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
SOUND_MANAGER_ERROR_NOT_SUPPORTEDNot supported
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
SOUND_MANAGER_ERROR_POLICYNoncompliance with the sound system policy
Precondition:
Call sound_manager_set_session_type(SOUND_SESSION_TYPE_VOIP) before calling this function.
See also:
sound_manager_set_session_type()
sound_manager_get_session_type()
sound_manager_get_voip_session_mode()

Unregisters the callback function which is called when the sound session being played is interrupted.

Deprecated:
Deprecated since 3.0.
Since :
2.3.1
Returns:
0 on success, otherwise a negative error value
Return values:
SOUND_MANAGER_ERROR_NONESuccess
SOUND_MANAGER_ERROR_INTERNALInternal error inside the sound system
See also:
sound_manager_set_session_interrupted_cb()