I am developing a live stream application in flutter. We are working on a feature which streams live audio from microphone to RTMP server
. Here how to reduce background noise from the mic audio while streaming to RTMP server
.
Configuration of audio session:
AudioSessionConfiguration(
avAudioSessionMode: AVAudioSessionMode.voiceChat,
avAudioSessionCategory: AVAudioSessionCategory.playAndRecord,
avAudioSessionCategoryOptions:
AVAudioSessionCategoryOptions.allowBluetooth|AVAudioSessionCategoryOptions.defaultToSpeaker,
androidAudioAttributes: const AndroidAudioAttributes(
contentType: AndroidAudioContentType.speech,
flags: AndroidAudioFlags.none,
usage: AndroidAudioUsage.voiceCommunication,
),
androidAudioFocusGainType: AndroidAudioFocusGainType.gain,
)