Skip to content

Commit d60a489

Browse files
Arlinxianing
authored andcommitted
Adaptive new change api of v3.7.202 on macos
1 parent d6bca9a commit d60a489

7 files changed

Lines changed: 15 additions & 20 deletions

File tree

macOS/APIExample/Commons/ExternalAudio/ExternalAudio.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void pushExternalData(void* data, int bytesLength)
9494
}
9595

9696
// copy byteBuffer to audioFrame.buffer
97-
virtual bool onRecordAudioFrame(AudioFrame& audioFrame) override
97+
virtual bool onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame) override
9898
{
9999
@synchronized(threadLockCapture) {
100100

@@ -172,7 +172,7 @@ int readAudioData(void* data, int bytesLength)
172172
}
173173

174174
// recive remote audio stream, push audio data to byteBuffer_play
175-
virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) override
175+
virtual bool onPlaybackAudioFrame(const char* channelId, AudioFrame& audioFrame) override
176176
{
177177
@synchronized(threadLockPlay) {
178178

@@ -211,9 +211,9 @@ virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) override
211211

212212
}
213213

214-
virtual bool onPlaybackAudioFrameBeforeMixing(agora::rtc::uid_t uid, AudioFrame& audioFrame) override { return true; }
214+
virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, agora::rtc::uid_t uid, AudioFrame& audioFrame) override { return true; }
215215

216-
virtual bool onMixedAudioFrame(AudioFrame& audioFrame) override { return true; }
216+
virtual bool onMixedAudioFrame(const char* channelId, AudioFrame& audioFrame) override { return true; }
217217
};
218218

219219
static ExternalAudioFrameObserver* s_audioFrameObserver;

macOS/APIExample/Commons/RawDataApi/AgoraMediaDataPlugin.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void modifiedAudioFrameWithNewAudioRawData(AudioFrame& audioFrame, AgoraAudioRaw
188188
audioFrame.renderTimeMs = audioRawData.renderTimeMs;
189189
}
190190

191-
virtual bool onRecordAudioFrame(AudioFrame& audioFrame) override
191+
virtual bool onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame) override
192192
{
193193
if (!mediaDataPlugin && ((mediaDataPlugin.observerAudioType >> 0) == 0)) return true;
194194
@autoreleasepool {
@@ -201,7 +201,7 @@ virtual bool onRecordAudioFrame(AudioFrame& audioFrame) override
201201
return true;
202202
}
203203

204-
virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) override
204+
virtual bool onPlaybackAudioFrame(const char* channelId, AudioFrame& audioFrame) override
205205
{
206206
if (!mediaDataPlugin && ((mediaDataPlugin.observerAudioType >> 1) == 0)) return true;
207207
@autoreleasepool {
@@ -214,7 +214,7 @@ virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) override
214214
return true;
215215
}
216216

217-
virtual bool onPlaybackAudioFrameBeforeMixing(agora::rtc::uid_t uid, AudioFrame& audioFrame) override
217+
virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, agora::rtc::uid_t uid, AudioFrame& audioFrame) override
218218
{
219219
if (!mediaDataPlugin && ((mediaDataPlugin.observerAudioType >> 2) == 0)) return true;
220220
@autoreleasepool {
@@ -227,7 +227,7 @@ virtual bool onPlaybackAudioFrameBeforeMixing(agora::rtc::uid_t uid, AudioFrame&
227227
return true;
228228
}
229229

230-
virtual bool onMixedAudioFrame(AudioFrame& audioFrame) override
230+
virtual bool onMixedAudioFrame(const char* channelId, AudioFrame& audioFrame) override
231231
{
232232
if (!mediaDataPlugin && ((mediaDataPlugin.observerAudioType >> 3) == 0)) return true;
233233
@autoreleasepool {

macOS/APIExample/Examples/Advanced/AudioMixing/AudioMixing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class AudioMixing: BaseViewController {
392392
agoraKit.setClientRole(.broadcaster)
393393

394394
// enable volume indicator
395-
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportvad: false)
395+
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportVad: false)
396396

397397
// update slider values
398398
mixingPlaybackVolumeSlider.slider.doubleValue = Double(agoraKit.getAudioMixingPlayoutVolume())

macOS/APIExample/Examples/Advanced/RawAudioData/RawAudioData.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,23 +303,19 @@ extension RawAudioData: AgoraRtcEngineDelegate {
303303
// audio data plugin, here you can process raw audio data
304304
// note this all happens in CPU so it comes with a performance cost
305305
extension RawAudioData: AgoraAudioFrameDelegate {
306-
func onRecord(_ frame: AgoraAudioFrame) -> Bool {
306+
func onRecord(_ frame: AgoraAudioFrame, channelId: String) -> Bool {
307307
return true
308308
}
309309

310-
func onPlaybackAudioFrame(_ frame: AgoraAudioFrame) -> Bool {
310+
func onPlaybackAudioFrame(_ frame: AgoraAudioFrame, channelId: String) -> Bool {
311311
return true
312312
}
313313

314-
func onMixedAudioFrame(_ frame: AgoraAudioFrame) -> Bool {
314+
func onMixedAudioFrame(_ frame: AgoraAudioFrame, channelId: String) -> Bool {
315315
return true
316316
}
317317

318-
func onPlaybackAudioFrame(beforeMixing frame: AgoraAudioFrame, uid: UInt) -> Bool {
319-
return true
320-
}
321-
322-
func onPlaybackAudioFrame(beforeMixing frame: AgoraAudioFrame, userId: String?) -> Bool {
318+
func onPlaybackAudioFrame(beforeMixing frame: AgoraAudioFrame, channelId: String, uid: UInt) -> Bool {
323319
return true
324320
}
325321
}

macOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ class SimpleFilterMain: BaseViewController {
292292
let config = AgoraRtcEngineConfig()
293293
config.appId = KeyCenter.AppId
294294
config.areaCode = GlobalSettings.shared.area
295-
config.mediaFilterExtensions = [SimpleFilterManager()]
296295
config.eventDelegate = self
297296

298297
agoraKit = AgoraRtcEngineKit.sharedEngine(with: config, delegate: self)

macOS/APIExample/Examples/Advanced/VoiceChanger/VoiceChanger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class VoiceChanger: BaseViewController {
523523
agoraKit.setClientRole(.broadcaster)
524524

525525
// enable volume indicator
526-
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportvad: true)
526+
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportVad: true)
527527

528528
// start joining channel
529529
// 1. Users can only see each other after they join the

macOS/APIExample/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class JoinChannelAudioMain: BaseViewController {
336336
// set myself as broadcaster to stream audio
337337
agoraKit.setClientRole(.broadcaster)
338338
// enable volume indicator
339-
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportvad: true)
339+
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportVad: true)
340340

341341
// start joining channel
342342
// 1. Users can only see each other after they join the

0 commit comments

Comments
 (0)