On this page

ZegoCustomAudioSource

2026-08-04

ZegoCustomAudioSource

Declared in ZegoExpressDefines.h

Methods

getIndex

getIndex
- (int)getIndex;
Get custom audio source instance index.
Declared in ZegoExpressDefines.h

Custom audio source instance index.

startCapture

startCapture
- (int)startCapture;
Start custom audio source capture.
Declared in ZegoExpressDefines.h

Start custom audio source capture.

  • Use cases: Typically used in educational scenarios that require switching between different audio capture sources.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: None.

The result of the API call.

stopCapture

stopCapture
- (int)stopCapture;
Stop custom audio source capture.
Declared in ZegoExpressDefines.h

Stop custom audio source capture.

  • Use cases: Typically used in educational scenarios that require switching between different audio capture sources.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: None.

The result of the API call.

enableAEC:

enableAEC:
- (int)enableAEC:(BOOL) enable;
Enable custom audio source echo cancellation.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
enableBOOLWhether to enable echo cancellation.

Details

Enable custom audio source echo cancellation.

  • Use cases: Typically used in educational scenarios that require switching between different audio capture sources.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: None.

Return

The result of the API call.

setVolume:

setVolume:
- (int)setVolume:(int) volume;
Set custom audio source volume.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
volumeintVolume, the range is 0 ~ 100.

Details

Set the volume of the custom audio source.

  • Use cases: Typically used in scenarios that require switching between different audio capture sources.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: The volume range is 0 ~ 100.

Return

The result of the API call.

mute:

mute:
- (int)mute:(BOOL) mute;
Mute or unmute the custom audio source.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
muteBOOLWhether to mute the custom audio source.

Details

Mute or unmute the audio data of the custom audio source.

  • Use cases: Typically used in scenarios that require switching between different audio capture sources.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: None.

Return

The result of the API call.

pushAudioFrame:dataLength:param:

pushAudioFrame:dataLength:param:
- (int)pushAudioFrame:(unsigned char *) data dataLength:(unsigned int) dataLength param:(ZegoAudioFrameParam *) param;
Push audio frame to the custom audio source.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
dataunsigned char *PCM buffer data.
dataLengthunsigned intThe total length of the buffer data.
paramZegoAudioFrameParam *The param of this PCM audio frame.

Details

Push audio frame to the custom audio source.

  • Use cases: Typically used when developers manage audio data capture themselves and input audio frames to a specified custom audio source.
  • When to call: After the custom audio source is created by [createCustomAudioSource].
  • Caution: ZegoCustomAudioSource can only be used as a mix source, not as the main capture source.
  • Available since: 3.25.0
  • Restrictions: None.

Return

The result of the API call.

Previous

zegocustomaudioprocessconfig

Next

zegocustommediacrypto

On this page

Back to top