Encoder functions.
More...
|
typedef struct _nugu_encoder | NuguEncoder |
| encoder object
|
|
Encoder functions.
The encoder object encodes the pcm data to specific encoded data.
◆ nugu_encoder_new()
Create new encoder object.
- Parameters
-
[in] | driver | encoder driver |
[in] | property | audio property(channel,type,sample-rate) |
- Returns
- encoder object
- See also
- nugu_encoder_free()
◆ nugu_encoder_free()
Destroy the encoder object.
- Parameters
-
- Returns
- result
- Return values
-
- 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] | enc | encoder object |
[in] | data | custom data managed by driver |
- Returns
- result
- Return values
-
- See also
- nugu_encoder_get_driver_data()
◆ nugu_encoder_get_driver_data()
NUGU_API void* nugu_encoder_get_driver_data |
( |
NuguEncoder * |
enc | ) |
|
◆ 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] | enc | encoder object |
[in] | is_last | last data hint (1 = last, 0 = not last) |
[in] | data | pcm data |
[in] | data_len | pcm data length |
[out] | output_len | output 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
-
- 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
-
- Returns
- encoder mime type string