DuerOS Service

[中文]

The DuerOS service allows voice interaction with DuerOS.

Application Example

Implementation of this API is demonstrated in the following example:

Header File

Functions

audio_service_handle_t dueros_service_create()

Create the dueros service.

Returns

  • NULL, Fail

  • Others, Success

service_state_t dueros_service_state_get()

Get dueros service state.

Returns

The state of service

esp_err_t dueros_voice_upload(audio_service_handle_t handle, void *buf, int len)

Upload voice to backend server.

Parameters
  • handle – dueros service handle

  • buf – Data buffer

  • len – Size of buffer

Returns

ESP_OK ESP_FAIL

esp_err_t dueros_voice_cancel(audio_service_handle_t handle)

Cancel the current session.

Parameters

handle – dueros service handle

Returns

ESP_OK ESP_FAIL

esp_err_t dueros_start_wifi_cfg(audio_service_handle_t handle, duer_wifi_cfg_t *cfg)

Start the wifi configure process.

Parameters
  • handle – Dueros service handle

  • cfg – Configuration

Returns

ESP_OK ESP_FAIL

esp_err_t dueros_stop_wifi_cfg(audio_service_handle_t handle)

Stop the wifi configure process.

Parameters

handle – Dueros service handle

Returns

ESP_OK ESP_FAIL

esp_err_t dueros_wifi_status_report(audio_service_handle_t handle, dueros_wifi_st_t *st)

Report the wifi status to dipb.

Parameters
  • handle – Dueros service handle

  • st – WiFi status and error code

Returns

ESP_OK ESP_FAIL

Structures

struct dueros_wifi_st_t

Status of WiFi connection.

Public Members

int status

Please refer to: enum duer_dipb_client_status_e

int err

Please refer to: enum duer_wifi_connect_error_code_e