In the following situations, it is recommended to use the custom audio capture function:
When developers have their own rendering requirements, such as special applications or processing and rendering of the original PCM data that are pulled, it is recommended to use the custom audio rendering function of the SDK.
After the developer adopts external acquisition and rendering, the SDK is not responsible for functions such as sound enhancement, noise suppression, and echo cancellation, and needs to be implemented by the user.
Before you begin, make sure you complete the following:
Create a project in ZEGOCLOUD Admin Console and get the AppID and AppSign of your project.
Refer to the Quick Start doc to complete the SDK integration and basic function implementation.
// Set the audio source to custom capture and render
ZegoCustomAudioConfig *audioConfig = [[ZegoCustomAudioConfig alloc] init];
audioConfig.sourceType = ZegoAudioSourceTypeCustom;
[[ZegoExpressEngine sharedEngine] enableCustomAudioIO:YES config:audioConfig];
After publishing or playing a stream, turn on the audio capture device and pass the collected audio data to the engine through sendCustomAudioCaptureAACData or sendCustomAudioCapturePCMData.
Use fetchCustomAudioRenderPCMData to get the data to be rendered from the engine, and then use the rendering device to play the audio data.