DuerOS 服务

[English]

DuerOS 服务 (DuerOS service) 实现了 DuerOS 的语音交互。

应用示例

以下示例展示了该 API 的实现方式。

Header File

Functions

audio_service_handle_t dueros_service_create()

Create the dueros service.

返回

  • NULL, Fail

  • Others, Success

service_state_t dueros_service_state_get()

Get dueros service state.

返回

The state of service

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

Upload voice to backend server.

参数
  • handle – dueros service handle

  • buf – Data buffer

  • len – Size of buffer

返回

ESP_OK ESP_FAIL

esp_err_t dueros_voice_cancel(audio_service_handle_t handle)

Cancel the current session.

参数

handle – dueros service handle

返回

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.

参数
  • handle – Dueros service handle

  • cfg – Configuration

返回

ESP_OK ESP_FAIL

esp_err_t dueros_stop_wifi_cfg(audio_service_handle_t handle)

Stop the wifi configure process.

参数

handle – Dueros service handle

返回

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.

参数
  • handle – Dueros service handle

  • st – WiFi status and error code

返回

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