DuerOS 服务

[English]

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

应用示例

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

Header File

Functions

audio_service_handle_t dueros_service_create()

Create the dueros service.

Return

  • NULL, Fail

  • Others, Success

service_state_t dueros_service_state_get()

Get dueros service state.

Return

The state of service

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

Upload voice to backend server.

Return

ESP_OK ESP_FAIL

Parameters
  • handle: dueros service handle

  • buf: Data buffer

  • len: Size of buffer

esp_err_t dueros_voice_cancel(audio_service_handle_t handle)

Cancel the current session.

Return

ESP_OK ESP_FAIL

Parameters
  • handle: dueros service handle

esp_err_t dueros_start_wifi_cfg(audio_service_handle_t handle, duer_wifi_cfg_t *cfg)

Start the wifi configure process.

Return

ESP_OK ESP_FAIL

Parameters
  • handle: Dueros service handle

  • cfg: Configuration

esp_err_t dueros_stop_wifi_cfg(audio_service_handle_t handle)

Stop the wifi configure process.

Return

ESP_OK ESP_FAIL

Parameters
  • handle: Dueros service handle

esp_err_t dueros_wifi_status_report(audio_service_handle_t handle, dueros_wifi_st_t *st)

Report the wifi status to dipb.

Return

ESP_OK ESP_FAIL

Parameters
  • handle: Dueros service handle

  • st: WiFi status and error code

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