We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba528d0 commit 09a1ba8Copy full SHA for 09a1ba8
iOS/APIExample/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift
@@ -151,9 +151,9 @@ extension CustomPcmAudioSourceMain: AgoraPcmSourcePushDelegate {
151
func onAudioFrame(data: UnsafeMutablePointer<UInt8>, samples: UInt) {
152
let frame = AgoraAudioFrame()
153
frame.buffer = UnsafeMutableRawPointer(data)
154
- frame.samplesPerSec = 48000
155
- frame.channels = 2
156
- frame.bytesPerSample = 32 * 8
+ frame.samplesPerSec = Int(sampleRate)
+ frame.channels = Int(channel)
+ frame.bytesPerSample = 2
157
frame.samplesPerChannel = self.samples / 2
158
let ret = agoraKit.pushExternalAudioFrameRawData(pushPos, frame: frame)
159
print("push result: \(ret)")
0 commit comments