enum class ESampleType : unsigned int {
SAMPLE_TYPE_U8 = 1, /**< Unsigned 8-bit audio samples */
SAMPLE_TYPE_S16_LE, /**< Signed 16-bit audio samples */
+ SAMPLE_TYPE_S24_LE, /**< Signed 24-bit audio samples */
+ SAMPLE_TYPE_S24_32_LE, /**< Signed 24-bit packed in 32-bit audio samples */
SAMPLE_TYPE_MAX
};
};
const static unsigned int MIN_SYSTEM_SAMPLERATE = 8000;
- const static unsigned int MAX_SYSTEM_SAMPLERATE = 48000;
+ const static unsigned int MAX_SYSTEM_SAMPLERATE = 192000;
/* Constructors */
CAudioInfo();
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_S24_LE, /**< Signed 24-bit audio samples (Since 5.0) */
+ AUDIO_SAMPLE_TYPE_S24_32_LE, /**< Signed 24-bit (packed in 32-bit) audio samples (Since 5.0) */
} audio_sample_type_e;
/**
*
* @remarks @a input must be released using audio_in_destroy().
*
- * @param[in] sample_rate The audio sample rate in 8000[Hz] ~ 48000[Hz]
+ * @param[in] sample_rate The audio sample rate in 8000[Hz] ~ 48000[Hz] (Before 5.0), 8000[Hz] ~ 192000[Hz] (Since 5.0)
* @param[in] channel The audio channel type (mono or stereo)
* @param[in] type The type of audio sample (8- or 16-bit)
* @param[out] input An audio input handle is created on success
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] input The handle to the audio input
- * @param[out] sample_rate The audio sample rate in Hertz (8000 ~ 48000)
+ * @param[out] sample_rate The audio sample rate in Hertz (8000 ~ 48000) (Before 5.0), (8000 ~ 192000) (Since 5.0)
* @return @c 0 on success,
* otherwise a negative error value
* @retval #AUDIO_IO_ERROR_NONE Successful
* @remarks @a output must be released by audio_out_destroy().
* 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] sample_rate The audio sample rate in 8000[Hz] ~ 48000[Hz] (Before 5.0), 8000[Hz] ~ 192000[Hz] (Since 5.0)
* @param[in] channel The audio channel type (mono or stereo)
* @param[in] type The type of audio sample (8-bit or 16-bit)
* @param[out] output An audio output handle is created on success
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] output The handle to the audio output
- * @param[out] sample_rate The audio sample rate in Hertz (8000 ~ 48000)
+ * @param[out] sample_rate The audio sample rate in Hertz (8000 ~ 48000) (Before 5.0), (8000 ~ 192000) (Since 5.0)
* @return @c 0 on success,
* otherwise a negative error value
* @retval #AUDIO_IO_ERROR_NONE Successful
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
-Version: 0.5.8
+Version: 0.5.9
Release: 0
Group: Multimedia/API
License: Apache-2.0
case ESampleType::SAMPLE_TYPE_S16_LE:
bytes_in_sample = 2;
break;
+ case ESampleType::SAMPLE_TYPE_S24_LE:
+ bytes_in_sample = 3;
+ break;
+ case ESampleType::SAMPLE_TYPE_S24_32_LE:
+ bytes_in_sample = 4;
+ break;
default:
AUDIO_IO_LOGW("As unrecognized sample type %d, let's assume S16_LE", static_cast<int>(__mSampleType));
bytes_in_sample = 2;
break;
case CAudioInfo::ESampleType::SAMPLE_TYPE_S16_LE:
+ __mSampleSpec.format = PA_SAMPLE_S16LE;
+ break;
+
+ case CAudioInfo::ESampleType::SAMPLE_TYPE_S24_LE:
+ __mSampleSpec.format = PA_SAMPLE_S24LE;
+ break;
+
+ case CAudioInfo::ESampleType::SAMPLE_TYPE_S24_32_LE:
+ __mSampleSpec.format = PA_SAMPLE_S24_32LE;
+ break;
+
default:
__mSampleSpec.format = PA_SAMPLE_S16LE;
break;
case AUDIO_SAMPLE_TYPE_S16_LE:
dst_type = CAudioInfo::ESampleType::SAMPLE_TYPE_S16_LE;
break;
+ case AUDIO_SAMPLE_TYPE_S24_LE:
+ dst_type = CAudioInfo::ESampleType::SAMPLE_TYPE_S24_LE;
+ break;
+ case AUDIO_SAMPLE_TYPE_S24_32_LE:
+ dst_type = CAudioInfo::ESampleType::SAMPLE_TYPE_S24_32_LE;
+ break;
default:
dst_type = CAudioInfo::ESampleType::SAMPLE_TYPE_U8;
break;
case CAudioInfo::ESampleType::SAMPLE_TYPE_S16_LE:
dst_type = AUDIO_SAMPLE_TYPE_S16_LE;
break;
+ case CAudioInfo::ESampleType::SAMPLE_TYPE_S24_LE:
+ dst_type = AUDIO_SAMPLE_TYPE_S24_LE;
+ break;
+ case CAudioInfo::ESampleType::SAMPLE_TYPE_S24_32_LE:
+ dst_type = AUDIO_SAMPLE_TYPE_S24_32_LE;
+ break;
default:
dst_type = AUDIO_SAMPLE_TYPE_U8;
break;
if (channel != AUDIO_CHANNEL_MONO && channel != AUDIO_CHANNEL_STEREO)
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Invalid channel :%d", channel);
- if (type != AUDIO_SAMPLE_TYPE_U8 && type != AUDIO_SAMPLE_TYPE_S16_LE)
+ if (type != AUDIO_SAMPLE_TYPE_U8 &&
+ type != AUDIO_SAMPLE_TYPE_S16_LE &&
+ type != AUDIO_SAMPLE_TYPE_S24_LE &&
+ type != AUDIO_SAMPLE_TYPE_S24_32_LE)
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Invalid sample type :%d", type);
}
fseek(fp, 0, SEEK_SET);
printf("start to play [%s] of size [%d] with [%d][%d][%d]\n", file, file_size, frequency, ch, type);
- if (type)
- audio_out_create_new(frequency, ch_table[ch], AUDIO_SAMPLE_TYPE_S16_LE, &output);
- else
- audio_out_create_new(frequency, ch_table[ch], AUDIO_SAMPLE_TYPE_U8, &output);
+ audio_out_create_new(frequency, ch_table[ch], AUDIO_SAMPLE_TYPE_U8 + type, &output);
audio_out_prepare(output);
audio_out_get_buffer_size(output, &buffer_size);
printf("2. usage : audio_io_test call-forwarding-in\n");
printf("3. usage : audio_io_test [length to read] [number of iteration] [channels]\n");
printf("4. usage : audio_io_test async [write(1) | read(2)]\n");
- printf("5. Uasge : audio_io_test play [filename] [sample rate] [channels] [type(0:U8)]\n");
+ printf("5. Uasge : audio_io_test play [filename] [sample rate] [channels] [type(0:U8,1:S16LE,2:S24LE,3:S24_32LE)]\n");
}
return 0;
}