跳到正文
OneSay 开发者

SDK 与 API 参考

ESP32 SDK参考

ESP32 SDK参考

  • 组件:onesay-esp32,用于ESP-IDF
  • 音频:16000 Hz单声道pcm_s16le,每帧40 ms
  • 重放缓冲区:默认3000 ms(96000字节);溢出时会报告错误,从不静默丢弃
  • 凭据:通过你的固件提供的安全存储接口读取
  • 网络:通过ESP-IDF使用TLS WebSocket
  • 音频输入:由你的固件提供PCM;SDK不采集音频

这个SDK是一个固定容量的C客户端:它负责绑定连接、封装音频帧、处理ACK、重放未确认的音频、对事件排序、分发回调和重新连接。音频、凭据存储和硬件驱动由你的固件提供。

语音任务

  • 入口:onesay_client_init, onesay_client_connect, onesay_client_start_dictation, onesay_client_write_audio, onesay_client_replay_unacked, onesay_client_reconnect, onesay_client_end_signal, onesay_client_dispatch, onesay_client_disconnect
  • 传输:onesay.realtime.v1 WebSocket with canonical PCM frames, contiguous ACK, unacked-only replay and bounded resume
  • 结果:Task events through the bounded event queue

实时语音(RTC)

  • 入口:onesay_esp32_rtc_prepare, onesay_esp32_rtc_connect_audio, onesay_esp32_rtc_read_media_status, onesay_esp32_rtc_read_binding, onesay_esp32_rtc_close
  • 传输:OneSay RTC binding over the pinned official ESP32 runtime behind one internal adapter
  • 结果:RTC audio, packet send, stream receive, RPC callee and Human-started Agent Control

能力

能力支持情况说明
语音任务(WSS、ACK、重放、恢复)支持Supported
RTC音频支持RTC audio owner
数据包部分支持Send only
数据流部分支持Receive only
RPC部分支持Callee only (answers 1–4 app.* methods, replies to the original caller only); no caller
DataTrack不支持ESP32暂不支持
Agent部分支持Human-started only: create, get and stop run under a Human's AppSession; a Device cannot start an Agent, and it is not yet verified on a device. A Device as the Agent's microphone and speaker (the agent_call example) is not yet verified end to end
状态、设备、错误和释放支持Binding and media status, OneSay error codes, close
所选模式的媒体加密不支持Unsupported: any selected value is refused before any request

不公开:native room or track handles;native token or connection material;the upstream ESP32 runtime API。不支持的能力会返回明确的错误。

参见SDK能力和兼容性。