Getting SDKERR_NOT_JOIN_AUDIO when trying to subscribe to audio raw data

Meeting SDK Type and Version
Linux SDK v5.16.1.8573

Description
After I request recording privileges and get it approved by the host, I am starting raw recording and trying to subscribe to raw audio data. The subscribe method returns error 32 (according to enum in zoom_sdk_def.h, it is SDKERR_NOT_JOIN_AUDIO. Also I am not getting onMixedAudioRawDataReceived and onOneWayAudioRawDataReceived handlers called.

Error?
Error occurred subscribing to audio: 32

How To Reproduce
Steps to reproduce the behavior including:

  1. Init SDK
  2. Authenticate SDK
  3. Join meeting:
        ZOOM_SDK_NAMESPACE::JoinParam param;
        param.userType = ZOOM_SDK_NAMESPACE::SDK_UT_WITHOUT_LOGIN;
        ZOOM_SDK_NAMESPACE::JoinParam4WithoutLogin &withoutLoginParam = param.param.withoutloginuserJoin;
        withoutLoginParam.meetingNumber = meetingId;
        withoutLoginParam.userName = displayName.c_str();
        withoutLoginParam.psw = password.c_str();
        withoutLoginParam.isVideoOff = true; // set this to false when you want to enable video stream
        withoutLoginParam.isAudioOff = false;

        err = m_pMeetingService->SetEvent(new MeetingStatusEventListener(*this));
        if (err == ZOOMSDK::SDKError::SDKERR_SUCCESS) {
            std::cout << "MeetingStatusEventListener added." << std::endl;
        } else {
            cout << "Error: Unable to set event listener for meeting service: " << err << endl;
        }

        err = m_pMeetingService->Join(param);
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
            std::cerr << "Error: Unable to join Zoom meeting: " << err << std::endl;
            return false;
        } else {
            std::cout << "Joining Zoom meeting..." << std::endl;
        }
  1. Wait for the MEETING_STATUS_INMEETING status. Request local recording privilege:
        IMeetingRecordingController* meetingRecordingController = m_pMeetingService->GetMeetingRecordingController();
        err = meetingRecordingController->SetEvent(new MeetingRecordingCtrlEventListener(*this));
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
            std::cerr << "Error: Unable to set event listener for meeting recording controller: " << err << std::endl;
            return false;
        } else {
            std::cout << "MeetingRecordingCtrlEventListener added." << std::endl;
        }

        auto res = meetingRecordingController->RequestLocalRecordingPrivilege();
  1. Wait for the onRecordPrivilegeChanged event with bCanRec == TRUE
  2. Start local recording:
        cout << "Starting raw recording..." << endl;
        const auto pMeetingRecordingController = m_pMeetingService->GetMeetingRecordingController();

        err = pMeetingRecordingController->StartRawRecording();
        if(err != ZOOMSDK::SDKERR_SUCCESS)
        {
            cerr << "Failed to start raw recording with status " << err << endl;
            return false;
        }
        cout << "Raw recording started. Subscribing to audio data..." << endl;

        const auto pAudioRawDataDelegate = new AudioRawDataDelegate();
        IZoomSDKAudioRawDataHelper* audioHelper;

        audioHelper = ZOOM_SDK_NAMESPACE::GetAudioRawdataHelper();

        if (audioHelper) {
            err = audioHelper->subscribe(pAudioRawDataDelegate);
            if (err != SDKERR_SUCCESS) {
                std::cout << "Error occurred subscribing to audio: " << err << std::endl;
                return false;
            }
        }
        else {
            std::cout << "Error getting audioHelper" << std::endl;
            return false;
        }

The output I am getting is as follows:

onMeetingStatusChanged: MEETING_STATUS_CONNECTING
2023-10-06T22:38:22.183385312Z onMeetingParameterNotification: 0x55967ea535c0
2023-10-06T22:38:22.533907159Z onMeetingStatusChanged: MEETING_STATUS_IN_WAITING_ROOM
2023-10-06T22:38:27.031188196Z onMeetingStatusChanged: MEETING_STATUS_RECONNECTING
2023-10-06T22:38:33.130676708Z onMeetingParameterNotification: 0x55967ea3ed00
2023-10-06T22:38:33.130695584Z onMeetingStatusChanged: MEETING_STATUS_CONNECTING
2023-10-06T22:38:33.469355833Z onMeetingStatusChanged: MEETING_STATUS_INMEETING
2023-10-06T22:38:33.469382005Z MeetingRecordingCtrlEventListener added.
2023-10-06T22:38:33.469385016Z Requested local recording privilege
2023-10-06T22:38:35.763139511Z Recording privilege granted
2023-10-06T22:38:35.763166036Z Starting raw recording...
2023-10-06T22:38:35.763343839Z Raw recording started. Subscribing to audio data...
2023-10-06T22:38:35.763354554Z Error occurred subscribing to audio: 32
2023-10-06T22:38:35.804660848Z Recording started

@chunsiong.zoom, could you take a look, please?

@alextsi ,

Thank you for posting in the Zoom Developer Forum. Can you share what environment you are testing SDK? Are you using a Docker container to create your app?

Thanks for your response @donte.zoom.
Yes, I am using docker container, here is my Dockerfile:

FROM ubuntu:22.04
LABEL authors="Alex Tsmbalistov"

RUN apt-get update && apt-get install -y --no-install-recommends \
    ssh \
    build-essential \
    gcc \
    g++ \
    gdb \
    clang \
    make \
    cmake \
    ninja-build \
    autoconf \
    automake \
    locales-all \
    dos2unix \
    rsync \
    pkgconf \
    curl \
    zip \
    unzip \
    git \
    python3 \
    python3-pip \
    gtkmm-3.0 \
    libx11-xcb1 \
    libxcb-xfixes0 \
    libxcb-shape0 \
    libxcb-shm0 \
    libxcb-randr0 \
    libxcb-image0 \
    libxcb-keysyms1 \
    libxcb-xtest0 \
    libdbus-1-3 \
    libglib2.0-0 \
    libgbm1 \
    libxfixes3 \
    libgl1 \
    libdrm2 \
    openssl \
    ca-certificates \
    libegl-mesa0 \
    libsdl2-dev \
    g++-multilib \
    libasound2 libasound2-plugins alsa alsa-utils alsa-oss \
    pulseaudio pulseaudio-utils ffmpeg \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

# Dependencies manager
RUN pip3 install conan && \
    conan profile detect --force
WORKDIR /conan_project
COPY conanfile.txt .
## Install dependencies
RUN conan install . --build=missing
COPY debug.conf .
RUN conan install . --build=missing -pr ./debug.conf

WORKDIR /app
COPY . .
RUN ln -s libmeetingsdk.so libmeetingsdk.so.1 && \
    mkdir -p /app/build && \
    cd /app/build && \
    cmake ../ -DCMAKE_BUILD_TYPE=Release && \
    cmake --build .

WORKDIR /app/build
COPY ./secrets ../secrets
COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
CMD [ "./entrypoint.sh" ]

@alextsi ,

Here are some additional steps which I’ve done, they might be helpful

Joining Meeting phrase


	if (GetAudioRawData) {
		//set join audio to true
		ZOOM_SDK_NAMESPACE::IAudioSettingContext* pAudioContext = m_pSettingService->GetAudioSettings();
		if (pAudioContext)
		{
			//ensure auto join audio
			pAudioContext->EnableAutoJoinAudio(true);
		}
	}
1 Like

Thank you, @chunsiong.zoom!
After I added this, I was able to join, and the raw audio handlers were invoked.

1 Like

@alextsi ,

The sample code has been published, do take a look here if it helps

1 Like

Thanks for sharing this, @chunsiong.zoom! I managed to capture the audio and it works well. However, having a reference implementation is indeed beneficial.

1 Like