/**
* @brief Unregisters the callback function.
- * @param[in] output The handle to the audio output
+ * @param[in] input The handle to the audio input
* @return 0 on success, otherwise a negative error value.
* @retval #AUDIO_IO_ERROR_NONE Successful
* @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
*/
int audio_in_unset_interrupted_cb(audio_in_h input);
-
+/**
+ * @brief Ignore session for input
+ * @param[in] input The handle to the audio input
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #AUDIO_IO_ERROR_NONE Successful
+ * @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUDIO_IO_ERROR_INVALID_OPERATION Invalid operation
+ * @see
+ */
+int audio_in_ignore_session(audio_in_h input);
//
// AUDIO OUTPUT
/**
* @brief Prepare playing audio out, this must be called before audio_out_write()
- * @param[in] input The handle to the audio output
+ * @param[in] output The handle to the audio output
* @return 0 on success, otherwise a negative error value.
* @retval #AUDIO_IO_ERROR_NONE Successful
* @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
/**
* @brief Unprepare playing audio out.
- * @param[in] input The handle to the audio output
+ * @param[in] output The handle to the audio output
* @return 0 on success, otherwise a negative error value.
* @retval #AUDIO_IO_ERROR_NONE Successful
* @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
*/
int audio_out_unset_interrupted_cb(audio_out_h output);
+/**
+ * @brief Ignore session for output
+ * @param[in] output The handle to the audio output
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #AUDIO_IO_ERROR_NONE Successful
+ * @retval #AUDIO_IO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUDIO_IO_ERROR_INVALID_OPERATION Invalid operation
+ * @see
+ */
+int audio_out_ignore_session(audio_out_h output);
/**
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
-Version: 0.1.1
-Release: 3
+Version: 0.2.0
+Release: 0
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN
Source0: %{name}-%{version}.tar.gz
return AUDIO_IO_ERROR_NONE;
}
+int audio_in_ignore_session(audio_in_h input)
+{
+ AUDIO_IO_NULL_ARG_CHECK(input);
+ audio_in_s * handle = (audio_in_s *) input;
+ int ret = 0;
+
+ ret = mm_sound_pcm_capture_ignore_session(handle->mm_handle);
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char*)__FUNCTION__);
+ }
+
+ LOGI("[%s] mm_sound_pcm_capture_ignore_session() success",__FUNCTION__);
+ return AUDIO_IO_ERROR_NONE;
+}
+
/* Audio Out */
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)
{
LOGI("[%s] current interrupted cb (%p) / data (%p)",__FUNCTION__, handle->user_cb, handle->user_data);
return AUDIO_IO_ERROR_NONE;
}
+
+int audio_out_ignore_session(audio_out_h output)
+{
+ AUDIO_IO_NULL_ARG_CHECK(output);
+ audio_out_s *handle = (audio_out_s *) output;
+ int ret = 0;
+
+ ret = mm_sound_pcm_play_ignore_session(handle->mm_handle);
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char*)__FUNCTION__);
+ }
+ LOGI("[%s] mm_sound_pcm_play_ignore_session() success",__FUNCTION__);
+
+ return AUDIO_IO_ERROR_NONE;
+}
int audio_io_test()
{
+ int ret, size;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE, &input)) == AUDIO_IO_ERROR_NONE) {
+ ret = audio_in_ignore_session(input);
+ if (ret != 0) {
+ printf ("ERROR, set session mix\n");
+ audio_in_destroy(input);
+ return 0;
+ }
+
+ audio_in_prepare(input);
+ if ((ret = audio_in_get_buffer_size(input, &size)) == AUDIO_IO_ERROR_NONE) {
+ size = 500000;
+ char *buffer = alloca(size);
+ if ((ret = audio_in_read(input, (void*)buffer, size)) > AUDIO_IO_ERROR_NONE) {
+ FILE* fp = fopen ("/root/test.raw", "wb+");
+ fwrite (buffer, size, sizeof(char), fp);
+ fclose (fp);
+ printf ("PASS, size=%d, ret=%d\n", size, ret);
+ }
+ else {
+ printf ("FAIL, size=%d, ret=%d\n", size, ret);
+ }
+ }
+ audio_in_destroy(input);
+ }
+
return 1;
}