Noise Suppression - Flutter
caution
The videosdk_media_effects plugin does not work with Flutter SDK v5.0.0. It depends on videosdk_webrtc, which you must remove when you upgrade to v5.0.0.
Noise suppression is built into the SDK. Turn it on with noiseSuppression in the noiseConfig of VideoSDK.createMicrophoneAudioTrack(). The SDK does not ask for microphone permission, so request it first.
final permissions = await VideoSDK.requestPermissions(Permissions.AUDIO);
if (permissions['audio'] != true) return;
try {
CustomStreamTrack micTrack = await VideoSDK.createMicrophoneAudioTrack(
noiseConfig: NoiseConfig(
noiseSuppression: true,
echoCancellation: true,
autoGainControl: true,
),
);
} on VideoSDKError catch (error) {
debugPrint("Could not create the track: ${error.code} ${error.name}");
}
Once you pass a NoiseConfig, a flag you leave out is turned on, except highPassFilter, which stays off. So set each flag you care about.
Pass the track as customMicrophoneTrack in createRoom(), or to room.unmuteMic() in a room. See Optimize Audio Track for the full steps, and the migration guide for the other changes in v5.0.0.
API Reference
Got a Question? Ask us on discord

