我正在使用AVAudioEngine進行音頻流式傳輸。但是,當我對麥克風說出任何詞語時,它會重複多次,就像回聲效果一樣。我想說話時,聽起來只有一次,而不是多次。我想取消回聲或額外的噪音。如何用AVAudioEngine取消或刪除回聲/重複聲音?
我該如何做到這一點?
var peerAudioEngine: AVAudioEngine = AVAudioEngine()
var peerAudioPlayer: AVAudioPlayerNode = AVAudioPlayerNode()
var peerInput: AVAudioInputNode?
var peerInputFormat: AVAudioFormat?
func setUpAVPlayer() {
self.peerInput = self.peerAudioEngine.inputNode
self.peerAudioEngine.attach(self.peerAudioPlayer)
self.peerInputFormat = AVAudioFormat.init(commonFormat: .pcmFormatFloat32, sampleRate: 44100, channels: 1, interleaved: false)
self.peerAudioEngine.connect(self.peerAudioPlayer, to: self.peerAudioEngine.mainMixerNode, format: self.peerInputFormat)
print("\(#file) > \(#function) > peerInputFormat = \(self.peerInputFormat.debugDescription)")
}
請給我們介紹一下你有什麼迄今所做的一些代碼。 –
@ParasGorasiya請檢查我的代碼 –
您是否在創建回聲的環境中錄製了某些內容? –