NUGU SDK Linux
1.7.6
|
PCM manipulation functions. More...
Typedefs | |
typedef struct _nugu_pcm | NuguPcm |
pcm object | |
Functions | |
NUGU_API int | nugu_pcm_add (NuguPcm *pcm) |
Add pcm object to managed list. More... | |
NUGU_API void | nugu_pcm_clear_buffer (NuguPcm *pcm) |
Clear pcm buffer. More... | |
NUGU_API void | nugu_pcm_emit_event (NuguPcm *pcm, enum nugu_media_event event) |
Emit event to registered callback. More... | |
NUGU_API void | nugu_pcm_emit_status (NuguPcm *pcm, enum nugu_media_status status) |
Emit status to registered callback. More... | |
NUGU_API NuguPcm * | nugu_pcm_find (const char *name) |
Find a pcm object by name in the managed list. More... | |
NUGU_API void | nugu_pcm_free (NuguPcm *pcm) |
Destroy the pcm object. More... | |
NUGU_API int | nugu_pcm_get_audio_attribute (NuguPcm *pcm) |
Get audio attribute. More... | |
NUGU_API const char * | nugu_pcm_get_audio_attribute_str (NuguPcm *pcm) |
Get audio attribute. More... | |
NUGU_API int | nugu_pcm_get_data (NuguPcm *pcm, char *data, size_t size) |
Get all data. More... | |
NUGU_API size_t | nugu_pcm_get_data_size (NuguPcm *pcm) |
Get pcm data size. More... | |
NUGU_API void * | nugu_pcm_get_driver_data (NuguPcm *pcm) |
Get custom data for driver. More... | |
NUGU_API int | nugu_pcm_get_duration (NuguPcm *pcm) |
Get duration information of pcm. More... | |
NUGU_API int | nugu_pcm_get_position (NuguPcm *pcm) |
Get current playback position of pcm. More... | |
NUGU_API enum nugu_media_status | nugu_pcm_get_status (NuguPcm *pcm) |
Get status of pcm. More... | |
NUGU_API int | nugu_pcm_get_volume (NuguPcm *pcm) |
Get volume of pcm. More... | |
NUGU_API NuguPcm * | nugu_pcm_new (const char *name, NuguPcmDriver *driver, NuguAudioProperty property) |
Create new pcm object. More... | |
NUGU_API int | nugu_pcm_pause (NuguPcm *pcm) |
Pause pcm playback. More... | |
NUGU_API int | nugu_pcm_push_data (NuguPcm *pcm, const char *data, size_t size, int is_last) |
Push playback pcm data. More... | |
NUGU_API int | nugu_pcm_push_data_done (NuguPcm *pcm) |
Set flag that push for all data is complete. More... | |
NUGU_API int | nugu_pcm_receive_is_last_data (NuguPcm *pcm) |
Get flag that all data pushes are complete. More... | |
NUGU_API int | nugu_pcm_remove (NuguPcm *pcm) |
Remove pcm object from managed list. More... | |
NUGU_API int | nugu_pcm_resume (NuguPcm *pcm) |
Resume pcm playback. More... | |
NUGU_API int | nugu_pcm_set_audio_attribute (NuguPcm *pcm, NuguAudioAttribute attr) |
Set audio attribute. More... | |
NUGU_API int | nugu_pcm_set_driver_data (NuguPcm *pcm, void *data) |
Set custom data for driver. More... | |
NUGU_API void | nugu_pcm_set_event_callback (NuguPcm *pcm, NuguMediaEventCallback cb, void *userdata) |
Set pcm event callback. More... | |
NUGU_API void | nugu_pcm_set_status_callback (NuguPcm *pcm, NuguMediaStatusCallback cb, void *userdata) |
Set pcm status callback. More... | |
NUGU_API int | nugu_pcm_set_volume (NuguPcm *pcm, int volume) |
Set volume of pcm. More... | |
NUGU_API int | nugu_pcm_start (NuguPcm *pcm) |
Start pcm playback. More... | |
NUGU_API int | nugu_pcm_stop (NuguPcm *pcm) |
Stop pcm playback. More... | |
PCM manipulation functions.
PCM data is managed by pushing it in the nugu buffer.
NUGU_API NuguPcm* nugu_pcm_new | ( | const char * | name, |
NuguPcmDriver * | driver, | ||
NuguAudioProperty | property | ||
) |
Create new pcm object.
[in] | name | pcm name |
[in] | driver | driver object |
[in] | property | audio property |
NUGU_API void nugu_pcm_free | ( | NuguPcm * | pcm | ) |
NUGU_API int nugu_pcm_add | ( | NuguPcm * | pcm | ) |
Add pcm object to managed list.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_remove | ( | NuguPcm * | pcm | ) |
Remove pcm object from managed list.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API NuguPcm* nugu_pcm_find | ( | const char * | name | ) |
Find a pcm object by name in the managed list.
[in] | name | name of pcm object |
NUGU_API int nugu_pcm_set_audio_attribute | ( | NuguPcm * | pcm, |
NuguAudioAttribute | attr | ||
) |
Set audio attribute.
[in] | pcm | pcm object |
[in] | attr | audio attribute |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_get_audio_attribute | ( | NuguPcm * | pcm | ) |
Get audio attribute.
[in] | pcm | pcm object |
-1 | failure |
NUGU_API const char* nugu_pcm_get_audio_attribute_str | ( | NuguPcm * | pcm | ) |
Get audio attribute.
[in] | pcm | pcm object |
NULL | failure |
NUGU_API int nugu_pcm_start | ( | NuguPcm * | pcm | ) |
Start pcm playback.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_stop | ( | NuguPcm * | pcm | ) |
Stop pcm playback.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_pause | ( | NuguPcm * | pcm | ) |
Pause pcm playback.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_resume | ( | NuguPcm * | pcm | ) |
Resume pcm playback.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_set_volume | ( | NuguPcm * | pcm, |
int | volume | ||
) |
Set volume of pcm.
[in] | pcm | pcm object |
[in] | volume | volume |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_get_volume | ( | NuguPcm * | pcm | ) |
Get volume of pcm.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_get_duration | ( | NuguPcm * | pcm | ) |
Get duration information of pcm.
[in] | pcm | pcm object |
>0 | success (duration) |
-1 | failure |
NUGU_API int nugu_pcm_get_position | ( | NuguPcm * | pcm | ) |
Get current playback position of pcm.
[in] | pcm | pcm object |
>0 | success (position) |
-1 | failure |
NUGU_API enum nugu_media_status nugu_pcm_get_status | ( | NuguPcm * | pcm | ) |
Get status of pcm.
[in] | pcm | pcm object |
NUGU_API void nugu_pcm_set_status_callback | ( | NuguPcm * | pcm, |
NuguMediaStatusCallback | cb, | ||
void * | userdata | ||
) |
Set pcm status callback.
[in] | pcm | pcm object |
[in] | cb | callback function |
[in] | userdata | data to pass to the user callback |
NUGU_API void nugu_pcm_emit_status | ( | NuguPcm * | pcm, |
enum nugu_media_status | status | ||
) |
Emit status to registered callback.
[in] | pcm | pcm object |
[in] | status | pcm status |
NUGU_API void nugu_pcm_set_event_callback | ( | NuguPcm * | pcm, |
NuguMediaEventCallback | cb, | ||
void * | userdata | ||
) |
Set pcm event callback.
[in] | pcm | pcm object |
[in] | cb | callback function |
[in] | userdata | data to pass to the user callback |
NUGU_API void nugu_pcm_emit_event | ( | NuguPcm * | pcm, |
enum nugu_media_event | event | ||
) |
Emit event to registered callback.
[in] | pcm | pcm object |
[in] | event | pcm event |
NUGU_API int nugu_pcm_set_driver_data | ( | NuguPcm * | pcm, |
void * | data | ||
) |
Set custom data for driver.
[in] | pcm | pcm object |
[in] | data | custom data managed by driver |
0 | success |
-1 | failure |
NUGU_API void* nugu_pcm_get_driver_data | ( | NuguPcm * | pcm | ) |
Get custom data for driver.
[in] | pcm | pcm object |
NUGU_API void nugu_pcm_clear_buffer | ( | NuguPcm * | pcm | ) |
Clear pcm buffer.
[in] | pcm | pcm object |
NUGU_API int nugu_pcm_push_data | ( | NuguPcm * | pcm, |
const char * | data, | ||
size_t | size, | ||
int | is_last | ||
) |
Push playback pcm data.
[in] | pcm | pcm object |
[in] | data | pcm data |
[in] | size | length of pcm data |
[in] | is_last | last data(is_last=1) or not(is_last=0) |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_push_data_done | ( | NuguPcm * | pcm | ) |
Set flag that push for all data is complete.
[in] | pcm | pcm object |
0 | success |
-1 | failure |
NUGU_API int nugu_pcm_get_data | ( | NuguPcm * | pcm, |
char * | data, | ||
size_t | size | ||
) |
Get all data.
[in] | pcm | pcm object |
[out] | data | buffer to get pcm data |
[in] | size | size of buffer |
0 | success |
-1 | failure |
NUGU_API size_t nugu_pcm_get_data_size | ( | NuguPcm * | pcm | ) |
Get pcm data size.
[in] | pcm | pcm object |
NUGU_API int nugu_pcm_receive_is_last_data | ( | NuguPcm * | pcm | ) |
Get flag that all data pushes are complete.
[in] | pcm | pcm object |
0 | success |
-1 | failure |