Skip to content
OneSay Developers

SDK & API Reference

ESP32 SDK Reference

ESP32 SDK Reference

  • Component: onesay-esp32 for ESP-IDF
  • Audio: 16000 Hz mono pcm_s16le, 40 ms frames
  • Replay buffer: 3000 ms (96000 bytes) by default; an overflow is reported as an error, never dropped silently
  • Credentials: read through a secure-store interface that your firmware provides
  • Network: TLS WebSocket through ESP-IDF
  • Audio input: PCM that your firmware supplies; the SDK does not capture audio

The SDK is a fixed-capacity C client. It binds the connection, frames audio, handles ACKs, replays unacknowledged audio, orders events, dispatches callbacks and reconnects. Your firmware provides the audio, the credential store and the hardware drivers.

Task voice

  • Entry points: 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
  • Transport: onesay.realtime.v1 WebSocket with canonical PCM frames, contiguous ACK, unacked-only replay and bounded resume
  • Results: Task events through the bounded event queue

Realtime RTC

  • Entry points: onesay_esp32_rtc_prepare, onesay_esp32_rtc_connect_audio, onesay_esp32_rtc_read_media_status, onesay_esp32_rtc_read_binding, onesay_esp32_rtc_close
  • Transport: OneSay RTC binding over the pinned official ESP32 runtime behind one internal adapter
  • Results: RTC audio, packet send, stream receive, RPC callee and Human-started Agent Control

Capabilities

CapabilitySupportDetail
Task voice (WSS, ACK, replay, resume)supportedSupported
RTC audiosupportedRTC audio owner
PacketspartialSend only
StreamspartialReceive only
RPCpartialCallee only (answers 1–4 app.* methods, replies to the original caller only); no caller
DataTrackunsupportedNot supported on ESP32 yet
AgentspartialHuman-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
State, device, error, releasesupportedBinding and media status, OneSay error codes, close
Selected-mode media encryptionunsupportedUnsupported: any selected value is refused before any request

Not exposed: native room or track handles; native token or connection material; the upstream ESP32 runtime API. An unsupported capability fails with an explicit error.

See the SDK capability and compatibility page.