NUGU SDK Linux  1.7.6
Encoder

Encoder functions. More...

+ Collaboration diagram for Encoder:

Typedefs

typedef struct _nugu_encoder NuguEncoder
 encoder object
 

Functions

NUGU_API void * nugu_encoder_encode (NuguEncoder *enc, int is_last, const void *data, size_t data_len, size_t *output_len)
 Encode the encoded data. More...
 
NUGU_API int nugu_encoder_free (NuguEncoder *enc)
 Destroy the encoder object. More...
 
NUGU_API const char * nugu_encoder_get_codec (NuguEncoder *enc)
 Get encoder codec. e.g. "OGG_OPUS" or "SPEEX". More...
 
NUGU_API void * nugu_encoder_get_driver_data (NuguEncoder *enc)
 Get custom data for driver. More...
 
NUGU_API const char * nugu_encoder_get_mime_type (NuguEncoder *enc)
 Get encoder mime type. More...
 
NUGU_API NuguEncodernugu_encoder_new (NuguEncoderDriver *driver, NuguAudioProperty property)
 Create new encoder object. More...
 
NUGU_API int nugu_encoder_set_driver_data (NuguEncoder *enc, void *data)
 Set custom data for driver. More...
 

Detailed Description

Encoder functions.

The encoder object encodes the pcm data to specific encoded data.

Function Documentation

◆ nugu_encoder_new()

NUGU_API NuguEncoder* nugu_encoder_new ( NuguEncoderDriver driver,
NuguAudioProperty  property 
)

Create new encoder object.

Parameters
[in]driverencoder driver
[in]propertyaudio property(channel,type,sample-rate)
Returns
encoder object
See also
nugu_encoder_free()

◆ nugu_encoder_free()

NUGU_API int nugu_encoder_free ( NuguEncoder enc)

Destroy the encoder object.

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

◆ nugu_encoder_set_driver_data()

NUGU_API int nugu_encoder_set_driver_data ( NuguEncoder enc,
void *  data 
)

Set custom data for driver.

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

◆ nugu_encoder_get_driver_data()

NUGU_API void* nugu_encoder_get_driver_data ( NuguEncoder enc)

Get custom data for driver.

Parameters
[in]encencoder object
Returns
data
See also
nugu_encoder_set_driver_data()

◆ nugu_encoder_encode()

NUGU_API void* nugu_encoder_encode ( NuguEncoder enc,
int  is_last,
const void *  data,
size_t  data_len,
size_t *  output_len 
)

Encode the encoded data.

Parameters
[in]encencoder object
[in]is_lastlast data hint (1 = last, 0 = not last)
[in]datapcm data
[in]data_lenpcm data length
[out]output_lenoutput buffer length
Returns
memory allocated encoded data. Developer must free the data manually.

◆ nugu_encoder_get_codec()

NUGU_API const char* nugu_encoder_get_codec ( NuguEncoder enc)

Get encoder codec. e.g. "OGG_OPUS" or "SPEEX".

Parameters
[in]encencoder object
Returns
encoder type string

◆ nugu_encoder_get_mime_type()

NUGU_API const char* nugu_encoder_get_mime_type ( NuguEncoder enc)

Get encoder mime type.

Parameters
[in]encencoder object
Returns
encoder mime type string