我正在使用 apple 的 AVCam,当 AVCam 运行时,我无法运行 AVAudioPlayer。我应该怎么办?每次我同时运行它们时,其中一个就会停止。 AVCam 使用 dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{}); 运行,而 AVAudioPlayer 在主队列中。请帮我!我需要帮助!
最佳答案
导入以下内容
#import <AVFoundation/AVAudioSession.h>
在 AppDelegate 的 didFinishLaunchingwithOptions 中使用以下代码行
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
关于ios - 同时播放 AVAudio Player 和 AVCam,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19262932/