问题描述
如何静音此AVFoundation音频播放器错误“ AppName [1188:30594] [plugin] AddInstanceForFactory:在ID中未注册工厂
这是我的audioPlayer方法
import Foundation
import AVFoundation
var audioPlayer: AVAudioPlayer!
func play(soundName: String,soundType: String){
if let path = Bundle.main.path(forResource: soundName,ofType: soundType){
let url = URL(fileURLWithPath: path)
do {
audioPlayer = try AVAudioPlayer(contentsOf: url)
audioPlayer.volume = 1.0
audioPlayer.prepareToPlay()
audioPlayer.play()
}catch{
print("....Couldn't find the sound....\(error.localizedDescription)")
}
}
}
func stopPlaying(){
audioPlayer.stop()
}
它播放音频文件,但是在模拟器中播放声音时Mac声音系统崩溃了两次,我不得不重新启动计算机,它又恢复了正常。 (Xcode 11.6)
错误:
"2020-08-19 09:56:28.261745+0600 AppName[1188:30594] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000034f1900> F8BB1C28-BAE8-11D6-9C31-00039315CD46"
需要解决此错误的解决方案!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)