Closed 673697831 closed 2 years ago
API-Examles中音频自采集(PCM)报错,onAudioFrame回调后,agoraKit.pushExternalAudioFrameRawData返回值为-2.控制台一直输出
push result: -2 push result: -2 push result: -2 push result: -2 push result: -2 push result: -2
是iOS还是macOS的示例呢?
iOS的,在这个git上面close了在master不行。在官网上下载的zip包也不行。
token用的是临时的,有关系吗。
还有在真机上,好像没声音,滑动的ui也有bug,布局也报错了。
修复的代码: func onAudioFrame(data: UnsafeMutablePointer, samples: UInt) { let frame = AgoraAudioFrame() frame.buffer = UnsafeMutableRawPointer(data) frame.samplesPerSec = Int(sampleRate) frame.channels = Int(channel) frame.bytesPerSample = 2 frame.samplesPerChannel = self.samples / 2 let ret = agoraKit.pushExternalAudioFrameRawData(pushPos, frame: frame) print("push result: (ret)") }
会马上更新一下分支
API-Examles中音频自采集(PCM)报错,onAudioFrame回调后,agoraKit.pushExternalAudioFrameRawData返回值为-2.控制台一直输出
push result: -2 push result: -2 push result: -2 push result: -2 push result: -2 push result: -2