Tizen Native API
Audio I/O

The Audio I/O API provides functions for controlling audio devices.

Required Header

#include <audio_io.h>

Overview

The Audio I/O API provides a set of functions to directly manage the system audio devices. It gives easy access to the hardware layer of the sound card with a professional multichannel audio interface. It should be used for activities requiring raw audio data buffers(PCM format).

Programming the interface requires first obtaining a handle to the device, via the audio_in_create() or audio_out_create() function.

The input and output devices both have an available set of queries, to find the suggested buffer size, sampling rate, channel type, and sample type. For output, there is an additional query, to get the sound type (these types are defined in the Sound Manager API).

Reading and writing is done by allocating a buffer and passing the buffer to the input device via audio_in_start_recording(), audio_in_read(), or writing to the buffer and passing it to the output device via audio_out_write().

Typedefs

typedef void(* audio_io_interrupted_cb )(audio_io_interrupted_code_e code, void *user_data)
 Called when audio input or output is interrupted.

Typedef Documentation

typedef void(* audio_io_interrupted_cb)(audio_io_interrupted_code_e code, void *user_data)

Called when audio input or output is interrupted.

Since :
2.3.1
Parameters:
[in]error_codeThe interrupted error code
[in]user_dataThe user data passed from the callback registration function
See also:
audio_in_set_interrupted_cb()
audio_out_set_interrupted_cb()
audio_in_unset_interrupted_cb()
audio_out_unset_interrupted_cb()

Enumeration Type Documentation

Enumeration for audio channel.

Since :
2.3.1
Enumerator:
AUDIO_CHANNEL_MONO 

1 channel, mono

AUDIO_CHANNEL_STEREO 

2 channel, stereo

Enumeration for audio input and output error.

Since :
2.3.1
Enumerator:
AUDIO_IO_ERROR_NONE 

Successful

AUDIO_IO_ERROR_OUT_OF_MEMORY 

Out of memory

AUDIO_IO_ERROR_INVALID_PARAMETER 

Invalid parameter

AUDIO_IO_ERROR_INVALID_OPERATION 

Invalid operation

AUDIO_IO_ERROR_PERMISSION_DENIED 

Device open error by security

AUDIO_IO_ERROR_NOT_SUPPORTED 

Not supported

AUDIO_IO_ERROR_DEVICE_NOT_OPENED 

Device open error

AUDIO_IO_ERROR_DEVICE_NOT_CLOSED 

Device close error

AUDIO_IO_ERROR_INVALID_BUFFER 

Invalid buffer pointer

AUDIO_IO_ERROR_SOUND_POLICY 

Sound policy error

Enumeration for audio IO interrupted messages.

Since :
2.3.1
Enumerator:
AUDIO_IO_INTERRUPTED_COMPLETED 

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

Enumeration for audio sample type with bit depth.

Since :
2.3.1
Enumerator:
AUDIO_SAMPLE_TYPE_U8 

Unsigned 8-bit audio samples

AUDIO_SAMPLE_TYPE_S16_LE 

Signed 16-bit audio samples