Skip to main content
Version: 0.0.x

Publish Audio - IoT SDK

The audio publishing feature lets an IoT device stream audio into a meeting for real-time, two-way communication with other participants.

startPublishAudio()

  • The startPublishAudio() function initiates publishing audio data from your IoT device into the active meeting session.
  • This function takes no parameters. The participant identity comes from the participantId you set once in init().
note
  • You must call the init() method before invoking startPublishAudio(). If not, the function will return an INIT_NOT_CALLED result code.

  • Only one publish task can run at a time. If another publish task is already active, calling this function again will result in a TASK_ALREADY_STARTED result code.

  • There is no separate stop call. leave() tears down all publishing and subscribing when you exit the meeting.

caution

The participantId must be unique for each participant in the meeting. If you leave it as NULL or an empty string in init(), the SDK generates a unique one for you.

Example

#include "videosdk.h"
#include "esp_log.h"
void app_main(){
result_t publish_result = startPublishAudio();
ESP_LOGI("IOT-SDK", "Publish Result: %d", publish_result);
}

API Reference

The API references for all the methods utilized in this guide are provided below.

Got a Question? Ask us on discord