From 314ee769c1deec4fd9175ce0ef288a4d3317a887 Mon Sep 17 00:00:00 2001 From: wushengtao Date: Wed, 24 Jul 2024 19:58:11 +0800 Subject: [PATCH] fix: play samples fixed --- .../Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift | 2 +- .../Advanced/CustomPcmAudioSource/CustomPcmAudioSource.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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),