#include <sound_manager.h>
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
/**
* @brief Enumeration for audio sample type with bit depth.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
- AUDIO_SAMPLE_TYPE_U8 = 0x70, /**< Unsigned 8-bit audio samples */
- AUDIO_SAMPLE_TYPE_S16_LE, /**< Signed 16-bit audio samples */
+typedef enum {
+ AUDIO_SAMPLE_TYPE_U8 = 0x70, /**< Unsigned 8-bit audio samples */
+ AUDIO_SAMPLE_TYPE_S16_LE, /**< Signed 16-bit audio samples */
} audio_sample_type_e;
/**
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
- AUDIO_CHANNEL_MONO = 0x80, /**< 1 channel, mono */
- AUDIO_CHANNEL_STEREO, /**< 2 channel, stereo */
+ AUDIO_CHANNEL_MONO = 0x80, /**< 1 channel, mono */
+ AUDIO_CHANNEL_STEREO, /**< 2 channel, stereo */
} audio_channel_e;
/**
* @brief Enumeration for audio input and output state.
* @since_tizen 3.0
*/
-typedef enum
-{
- AUDIO_IO_STATE_IDLE, /**< Audio-io handle is created, but not prepared */
- AUDIO_IO_STATE_RUNNING, /**< Audio-io handle is ready and the stream is running */
- AUDIO_IO_STATE_PAUSED, /**< Audio-io handle is ready and the stream is paused */
+typedef enum {
+ AUDIO_IO_STATE_IDLE, /**< Audio-io handle is created, but not prepared */
+ AUDIO_IO_STATE_RUNNING, /**< Audio-io handle is ready and the stream is running */
+ AUDIO_IO_STATE_PAUSED, /**< Audio-io handle is ready and the stream is paused */
} audio_io_state_e;
/**
* @brief Enumeration for audio input and output error.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum{
- AUDIO_IO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- AUDIO_IO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- AUDIO_IO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- AUDIO_IO_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
- AUDIO_IO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Device open error by security */
- AUDIO_IO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
- AUDIO_IO_ERROR_DEVICE_NOT_OPENED = TIZEN_ERROR_AUDIO_IO | 0x01, /**< Device open error */
- AUDIO_IO_ERROR_DEVICE_NOT_CLOSED = TIZEN_ERROR_AUDIO_IO | 0x02, /**< Device close error */
- AUDIO_IO_ERROR_INVALID_BUFFER = TIZEN_ERROR_AUDIO_IO | 0x03, /**< Invalid buffer pointer */
- AUDIO_IO_ERROR_SOUND_POLICY = TIZEN_ERROR_AUDIO_IO | 0x04, /**< Sound policy error */
- AUDIO_IO_ERROR_INVALID_STATE = TIZEN_ERROR_AUDIO_IO | 0x05, /**< Invalid state (Since 3.0) */
- AUDIO_IO_ERROR_NOT_SUPPORTED_TYPE = TIZEN_ERROR_AUDIO_IO | 0x06, /**< Not supported stream type (Since 3.0) */
+typedef enum {
+ AUDIO_IO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ AUDIO_IO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ AUDIO_IO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ AUDIO_IO_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
+ AUDIO_IO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Device open error by security */
+ AUDIO_IO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ AUDIO_IO_ERROR_DEVICE_POLICY_RESTRICTION = TIZEN_ERROR_DEVICE_POLICY_RESTRICTION, /**< Device policy restriction (Since 3.0) */
+ AUDIO_IO_ERROR_DEVICE_NOT_OPENED = TIZEN_ERROR_AUDIO_IO | 0x01, /**< Device open error */
+ AUDIO_IO_ERROR_DEVICE_NOT_CLOSED = TIZEN_ERROR_AUDIO_IO | 0x02, /**< Device close error */
+ AUDIO_IO_ERROR_INVALID_BUFFER = TIZEN_ERROR_AUDIO_IO | 0x03, /**< Invalid buffer pointer */
+ AUDIO_IO_ERROR_SOUND_POLICY = TIZEN_ERROR_AUDIO_IO | 0x04, /**< Sound policy error */
+ AUDIO_IO_ERROR_INVALID_STATE = TIZEN_ERROR_AUDIO_IO | 0x05, /**< Invalid state (Since 3.0) */
+ AUDIO_IO_ERROR_NOT_SUPPORTED_TYPE = TIZEN_ERROR_AUDIO_IO | 0x06, /**< Not supported stream type (Since 3.0) */
} audio_io_error_e;
/**
* @brief Enumeration for audio IO interrupted messages.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
- AUDIO_IO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */
- AUDIO_IO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a media application */
- AUDIO_IO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */
- AUDIO_IO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
- AUDIO_IO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
- AUDIO_IO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */
- AUDIO_IO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */
- AUDIO_IO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */
+typedef enum {
+ AUDIO_IO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */
+ AUDIO_IO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a media application */
+ AUDIO_IO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */
+ AUDIO_IO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
+ AUDIO_IO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
+ AUDIO_IO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */
+ AUDIO_IO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */
+ AUDIO_IO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */
} audio_io_interrupted_code_e;
/**
* @{
*/
-//
-//AUDIO INPUT
-//
-
/**
* @brief Called when audio input data is available in asynchronous(event) mode.
*
* @retval #AUDIO_IO_ERROR_NOT_SUPPORTED Not supported
*
* @post The state will be #AUDIO_IO_STATE_IDLE.\n
- * audio_in_set_stream_info() is recommended to be called after this API.
+ * audio_in_set_sound_stream_info() is recommended to be called after this API.
* @see audio_in_destroy()
*/
int audio_in_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, audio_in_h *input);
*
* @see audio_in_destroy()
*/
-int audio_in_create_loopback(int sample_rate, audio_channel_e channel, audio_sample_type_e type , audio_in_h* input);
+int audio_in_create_loopback(int sample_rate, audio_channel_e channel, audio_sample_type_e type , audio_in_h* input) TIZEN_DEPRECATED_API;
/**
* @brief Releases the audio input handle and all its resources associated with an audio stream.
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
*/
+int audio_in_set_sound_stream_info(audio_in_h input, sound_stream_info_h stream_info);
+
+/* Note : Will be removed after migration to audio_in_set_sound_stream_info */
int audio_in_set_stream_info(audio_in_h input, sound_stream_info_h stream_info);
/**
* @retval #AUDIO_IO_ERROR_NONE Successful
* @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #AUDIO_IO_ERROR_NOT_SUPPORTED Not supported
+ * @retval #AUDIO_IO_ERROR_DEVICE_POLICY_RESTRICTION Device policy restriction
* @retval #AUDIO_IO_ERROR_INVALID_STATE Invalid state
*
* @post The state will be #AUDIO_IO_STATE_RUNNING.
/**
* @brief Flushes and discards buffered audio data from the input stream.
*
- * @since_tizen 2.4
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
* @param[in] input The handle to the audio input
* @return @c 0 on success,
* @see audio_in_unset_interrupted_cb()
* @see audio_io_interrupted_cb()
*/
-int audio_in_set_interrupted_cb(audio_in_h input, audio_io_interrupted_cb callback, void *user_data);
+int audio_in_set_interrupted_cb(audio_in_h input, audio_io_interrupted_cb callback, void *user_data) TIZEN_DEPRECATED_API;
/**
* @deprecated Deprecated since 3.0
*
* @see audio_in_set_interrupted_cb()
*/
-int audio_in_unset_interrupted_cb(audio_in_h input);
+int audio_in_unset_interrupted_cb(audio_in_h input) TIZEN_DEPRECATED_API;
/**
* @deprecated Deprecated since 3.0
* @retval #AUDIO_IO_ERROR_INVALID_OPERATION Invalid operation
* @retval #AUDIO_IO_ERROR_NOT_SUPPORTED Not supported
*/
-int audio_in_ignore_session(audio_in_h input);
+int audio_in_ignore_session(audio_in_h input) TIZEN_DEPRECATED_API;
/**
* @brief Sets an asynchronous(event) callback function to handle recording PCM (pulse-code modulation) data.
* @}
*/
-//
-// AUDIO OUTPUT
-//
-
/**
* @addtogroup CAPI_MEDIA_AUDIO_OUT_MODULE
* @{
*
* @see audio_out_destroy()
*/
-int audio_out_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, sound_type_e sound_type, audio_out_h *output);
+int audio_out_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, sound_type_e sound_type, audio_out_h *output) TIZEN_DEPRECATED_API;
/**
* @brief Creates an audio device instance and returns an output handle to play PCM (pulse-code modulation) data.
* @since_tizen 3.0
*
* @remarks @a output must be released by audio_out_destroy().
- * It is recommended to call audio_out_set_stream_info() after this API.
+ * It is recommended to call audio_out_set_sound_stream_info() after this API.
*
* @param[in] sample_rate The audio sample rate in 8000[Hz] ~ 48000[Hz]
* @param[in] channel The audio channel type (mono or stereo)
* @retval #AUDIO_IO_ERROR_SOUND_POLICY Sound policy error
*
* @post The state will be #AUDIO_IO_STATE_IDLE.\n
- * audio_out_set_stream_info() is recommended to be called after this API.
+ * audio_out_set_sound_stream_info() is recommended to be called after this API.
* @see audio_out_destroy()
*/
int audio_out_create_new(int sample_rate, audio_channel_e channel, audio_sample_type_e type, audio_out_h *output);
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
*/
+int audio_out_set_sound_stream_info(audio_out_h output, sound_stream_info_h stream_info);
+
+/* Note : Will be removed after migration to audio_out_set_sound_stream_info */
int audio_out_set_stream_info(audio_out_h output, sound_stream_info_h stream_info);
/**
*
* @details This function waits until drains stream buffer completely. (e.g end of playback)
*
- * @since_tizen 2.4
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
* @param[in] output The handle to the audio output
* @return @c 0 on success,
/**
* @brief Flushes and discards buffered audio data from the output stream.
*
- * @since_tizen 2.4
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
* @param[in] output The handle to the audio output
* @return @c 0 on success,
* @see audio_out_unset_interrupted_cb()
* @see audio_io_interrupted_cb()
*/
-int audio_out_set_interrupted_cb(audio_out_h output, audio_io_interrupted_cb callback, void *user_data);
+int audio_out_set_interrupted_cb(audio_out_h output, audio_io_interrupted_cb callback, void *user_data) TIZEN_DEPRECATED_API;
/**
* @deprecated Deprecated since 3.0
*
* @see audio_out_set_interrupted_cb()
*/
-int audio_out_unset_interrupted_cb(audio_out_h output);
+int audio_out_unset_interrupted_cb(audio_out_h output) TIZEN_DEPRECATED_API;
/**
* @deprecated Deprecated since 3.0
* @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #AUDIO_IO_ERROR_INVALID_OPERATION Invalid operation
*/
-int audio_out_ignore_session(audio_out_h output);
+int audio_out_ignore_session(audio_out_h output) TIZEN_DEPRECATED_API;
/**
* @brief Sets an asynchronous(event) callback function to handle playing PCM (pulse-code modulation) data.
*
* @details @a callback will be called when you can write a PCM data.
* It might cause dead lock if change the state of audio handle in callback.
- * (ex: audio_in_destroy, audio_in_prepare, audio_in_unprepare)
+ * (ex: audio_out_destroy, audio_out_prepare, audio_out_unprepare)
* Recommend to use as a VOIP only.
* Recommend not to hold callback too long.(it affects latency)
*
* @retval #AUDIO_IO_ERROR_DEVICE_NOT_OPENED Device not opened
* @retval #AUDIO_IO_ERROR_SOUND_POLICY Sound policy error
*
- * @see audio_in_set_stream_cb()
+ * @see audio_out_unset_stream_cb()
*/
int audio_out_set_stream_cb(audio_out_h output, audio_out_stream_cb callback, void* user_data);