diff --git a/iOS/APIExample-Audio/APIExample-Audio/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift b/iOS/APIExample-Audio/APIExample-Audio/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift index ce7da158b..69b7d1ece 100644 --- a/iOS/APIExample-Audio/APIExample-Audio/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift +++ b/iOS/APIExample-Audio/APIExample-Audio/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift @@ -143,7 +143,7 @@ class CustomPcmAudioSourceMain: BaseViewController { extension CustomPcmAudioSourceMain: AgoraPcmSourcePushDelegate { func onAudioFrame(data: UnsafeMutablePointer) { agoraKit.pushExternalAudioFrameRawData(data, - samples: samples, + samples: samples*Int(channel), sampleRate: Int(sampleRate), channels: Int(channel), trackId: Int(trackId), diff --git a/iOS/APIExample/APIExample/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift b/iOS/APIExample/APIExample/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift index 55582ffb8..f6bb34b48 100644 --- a/iOS/APIExample/APIExample/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift +++ b/iOS/APIExample/APIExample/Examples/Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift @@ -142,7 +142,7 @@ class CustomPcmAudioSourceMain: BaseViewController { extension CustomPcmAudioSourceMain: AgoraPcmSourcePushDelegate { func onAudioFrame(data: UnsafeMutablePointer) { agoraKit.pushExternalAudioFrameRawData(data, - samples: samples, + samples: samples*Int(channel), sampleRate: Int(sampleRate), channels: Int(channel), trackId: Int(trackId),