NUGU SDK Linux  1.7.6
Voice recorder

Voice recorder functions. More...

+ Collaboration diagram for Voice recorder:

Typedefs

typedef struct _nugu_recorder NuguRecorder
 recorder object
 

Functions

NUGU_API int nugu_recorder_add (NuguRecorder *rec)
 Add recorder object to managed list. More...
 
NUGU_API int nugu_recorder_clear (NuguRecorder *rec)
 Clear recording data. More...
 
NUGU_API NuguRecordernugu_recorder_find (const char *name)
 Find a recorder object by name in the managed list. More...
 
NUGU_API void nugu_recorder_free (NuguRecorder *rec)
 Destroy the recorder object. More...
 
NUGU_API void * nugu_recorder_get_driver_data (NuguRecorder *rec)
 Get custom data for driver. More...
 
NUGU_API int nugu_recorder_get_frame (NuguRecorder *rec, char *data, int *size)
 Get recorded data. More...
 
NUGU_API int nugu_recorder_get_frame_count (NuguRecorder *rec)
 Get frame count. More...
 
NUGU_API int nugu_recorder_get_frame_size (NuguRecorder *rec, int *size, int *max)
 Get frame size. More...
 
NUGU_API int nugu_recorder_get_frame_timeout (NuguRecorder *rec, char *data, int *size, int timeout)
 Get recorded data with timeout. More...
 
NUGU_API int nugu_recorder_is_recording (NuguRecorder *rec)
 Get the status of recording. More...
 
NUGU_API NuguRecordernugu_recorder_new (const char *name, NuguRecorderDriver *driver)
 Create new recorder object. More...
 
NUGU_API int nugu_recorder_push_frame (NuguRecorder *rec, const char *data, int size)
 Push recorded data. More...
 
NUGU_API int nugu_recorder_remove (NuguRecorder *rec)
 Remove recorder object from managed list. More...
 
NUGU_API int nugu_recorder_set_driver_data (NuguRecorder *rec, void *data)
 Set custom data for driver. More...
 
NUGU_API int nugu_recorder_set_frame_size (NuguRecorder *rec, int size, int max)
 Set frame size. More...
 
NUGU_API int nugu_recorder_set_property (NuguRecorder *rec, NuguAudioProperty property)
 Set property to recorder object. More...
 
NUGU_API int nugu_recorder_start (NuguRecorder *rec)
 Start recording. More...
 
NUGU_API int nugu_recorder_stop (NuguRecorder *rec)
 Stop recording. More...
 

Detailed Description

Voice recorder functions.

The recorder manages the recorded audio data by pushing it to the ringbuffer.

Function Documentation

◆ nugu_recorder_new()

NUGU_API NuguRecorder* nugu_recorder_new ( const char *  name,
NuguRecorderDriver driver 
)

Create new recorder object.

Parameters
[in]namerecorder name
[in]driverrecorder driver object
Returns
recorder object
See also
nugu_recorder_free()

◆ nugu_recorder_free()

NUGU_API void nugu_recorder_free ( NuguRecorder rec)

Destroy the recorder object.

Parameters
[in]recrecorder object
See also
nugu_recorder_new()

◆ nugu_recorder_add()

NUGU_API int nugu_recorder_add ( NuguRecorder rec)

Add recorder object to managed list.

Parameters
[in]recrecorder object
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_remove()
nugu_recorder_find()

◆ nugu_recorder_remove()

NUGU_API int nugu_recorder_remove ( NuguRecorder rec)

Remove recorder object from managed list.

Parameters
[in]recrecorder object
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_find()

NUGU_API NuguRecorder* nugu_recorder_find ( const char *  name)

Find a recorder object by name in the managed list.

Parameters
[in]namename of recorder object
Returns
recorder object
See also
nugu_recorder_add()
nugu_recorder_remove()

◆ nugu_recorder_set_property()

NUGU_API int nugu_recorder_set_property ( NuguRecorder rec,
NuguAudioProperty  property 
)

Set property to recorder object.

Parameters
[in]recrecorder object
[in]propertyproperty
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_start()

NUGU_API int nugu_recorder_start ( NuguRecorder rec)

Start recording.

Parameters
[in]recrecorder object
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_stop()

◆ nugu_recorder_stop()

NUGU_API int nugu_recorder_stop ( NuguRecorder rec)

Stop recording.

Parameters
[in]recrecorder object
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_start()

◆ nugu_recorder_clear()

NUGU_API int nugu_recorder_clear ( NuguRecorder rec)

Clear recording data.

Parameters
[in]recrecorder object
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_is_recording()

NUGU_API int nugu_recorder_is_recording ( NuguRecorder rec)

Get the status of recording.

Parameters
[in]recrecorder object
Returns
result
Return values
0idle
1recording
-1failure

◆ nugu_recorder_set_driver_data()

NUGU_API int nugu_recorder_set_driver_data ( NuguRecorder rec,
void *  data 
)

Set custom data for driver.

Parameters
[in]recrecorder object
[in]datacustom data managed by driver
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_get_driver_data()

◆ nugu_recorder_get_driver_data()

NUGU_API void* nugu_recorder_get_driver_data ( NuguRecorder rec)

Get custom data for driver.

Parameters
[in]recrecorder object
Returns
data
See also
nugu_recorder_set_driver_data()

◆ nugu_recorder_get_frame_size()

NUGU_API int nugu_recorder_get_frame_size ( NuguRecorder rec,
int *  size,
int *  max 
)

Get frame size.

Parameters
[in]recrecorder object
[out]sizeframe size
[out]maxmax count
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_set_frame_size()

◆ nugu_recorder_set_frame_size()

NUGU_API int nugu_recorder_set_frame_size ( NuguRecorder rec,
int  size,
int  max 
)

Set frame size.

Parameters
[in]recrecorder object
[in]sizeframe size
[in]maxmax count
Returns
result
Return values
0success
-1failure
See also
nugu_recorder_get_frame_size()

◆ nugu_recorder_push_frame()

NUGU_API int nugu_recorder_push_frame ( NuguRecorder rec,
const char *  data,
int  size 
)

Push recorded data.

Parameters
[in]recrecorder object
[in]datarecorded data
[in]sizesize of recorded data
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_get_frame()

NUGU_API int nugu_recorder_get_frame ( NuguRecorder rec,
char *  data,
int *  size 
)

Get recorded data.

Parameters
[in]recrecorder object
[out]datadata
[out]sizesize of data
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_get_frame_timeout()

NUGU_API int nugu_recorder_get_frame_timeout ( NuguRecorder rec,
char *  data,
int *  size,
int  timeout 
)

Get recorded data with timeout.

Parameters
[in]recrecorder object
[out]datadata
[out]sizesize of data
[in]timeouttimeout milliseconds
Returns
result
Return values
0success
-1failure

◆ nugu_recorder_get_frame_count()

NUGU_API int nugu_recorder_get_frame_count ( NuguRecorder rec)

Get frame count.

Parameters
[in]recrecorder object
Returns
result
Return values
>0success (frame count)
-1failure