shogo4405 / HaishinKit.swift

Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
https://docs.haishinkit.com/swift/latest
BSD 3-Clause "New" or "Revised" License
2.79k stars 619 forks source link

Background noise cancellation #1562

Closed Nandhu-89 closed 2 months ago

Nandhu-89 commented 2 months ago

Describe the bug

Hi @shogo4405 I am using haishin_kit: ^0.13.0 in my flutter app to publish audio to RTMP server. How to remove background noise from microphone audio. When I use headphones the audio is clear. But without headphones the audio has background noise.

To Reproduce

await session.configure(AudioSessionConfiguration(
      avAudioSessionMode: AVAudioSessionMode.voiceChat,
      avAudioSessionCategory: AVAudioSessionCategory.playAndRecord,
      avAudioSessionCategoryOptions:
      AVAudioSessionCategoryOptions.allowBluetooth|AVAudioSessionCategoryOptions.defaultToSpeaker,
    ));

audio bitrate => 120 kbps

Expected behavior

publish live audio to rtmp server without background noise.

Version

haishin_kit: ^0.13.0

Smartphone info.

iPhone

Additional context

No response

Screenshots

No response

Relevant log output

No response

shogo4405 commented 2 months ago

What kind of noise are you hearing? Could you record it and upload it? If it's just general noise, the library doesn't have a feature to handle that. I'm assuming you'll need to enable this OS feature: https://support.apple.com/en-ca/101993