【发布时间】:2020-07-19 10:18:20
【问题描述】:
当用户在我的应用中点击通话按钮/joinChanne(Agora) 时,我正在添加声音。
[self.agoraKit joinChannelByToken:self.userManager.agoraToken channelId:self.userManager.channelName info:nil uid:[self.userManager.UID integerValue] joinSuccess:^(NSString *channel, NSUInteger uid, NSInteger elapsed) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"ringing-sound-jalebi" ofType:@"mp3"];
NSURL *soundFileURL = [NSURL fileURLWithPath:path];
self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
self.audioPlayer.delegate = self;
[self.audioPlayer play];
}];
但我收到“AVAudioSession.mm:997:-[AVAudioSession setActive:withOptions:error:]:停用正在运行 I/O 的音频会话。所有 I/O 应在停用音频之前停止或暂停会话”错误。有人可以帮我解决这个问题吗
【问题讨论】:
标签: ios objective-c avaudioplayer avaudiosession agora.io