ZegoCustomAudioSource
2026-08-04
ZegoCustomAudioSource
Declared in ZegoExpressDefines.h
Methods
getIndex
getIndex
- (int)getIndex;Get custom audio source instance index.
Declared in
ZegoExpressDefines.hCustom audio source instance index.
startCapture
startCapture
- (int)startCapture;Start custom audio source capture.
Declared in
ZegoExpressDefines.hStart 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.hStop 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.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether 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.hParameters
| Name | Type | Description |
|---|---|---|
| volume | int | Volume, 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.hParameters
| Name | Type | Description |
|---|---|---|
| mute | BOOL | Whether 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.hParameters
| Name | Type | Description |
|---|---|---|
| data | unsigned char * | PCM buffer data. |
| dataLength | unsigned int | The total length of the buffer data. |
| param | ZegoAudioFrameParam * | 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.
