问题描述
我正在尝试播放以下声音:
I am trying to play a sound as follows:
import AVFoundation
let sound = URL(fileURLWithPath: Bundle.main.path(forResource: "audiofile", ofType: "wav")!)
var audioPlayer = AVAudioPlayer()
@IBAction func audio1(_ sender: Any) {
do {
audioPlayer = try AVAudioPlayer(contentsOf: sound)
audioPlayer.play()
} catch {
// error
}
在iOS模拟器中运行时,结果如下:
When running in the iOS simulator this results in the following:
/Library/Audio/Plug-Ins/HAL/NRDAudioClient.plugin/Contents/MacOS/NRDAudioClient: mach-o,但不是为iOS模拟器构建的
/Library/Audio/Plug-Ins/HAL/NRDAudioClient.plugin/Contents/MacOS/NRDAudioClient: mach-o, but not built for iOS simulator
2019-01-08 12:29:55.438703 + 0800测试应用程序[8096:118590]找不到 用于工厂3E9FAD07-70A8-4980-B39B-BB8B905C9872的功能指针NRDACLN_New_Instance CFBundle/CFPlugIn 0x7fcf5b135210 (捆绑,不是 已加载)
2019-01-08 12:29:55.438703+0800 Test App[8096:118590] Cannot find function pointer NRDACLN_New_Instance for factory 3E9FAD07-70A8-4980-B39B-BB8B905C9872 in CFBundle/CFPlugIn 0x7fcf5b135210 (bundle, not loaded)
我什么都没有找到关于"NRDAudioClient"的任何信息.我正在使用macincloud,因此不确定此错误是否与那里的特定设置有关.
I haven't found any information at all on what "NRDAudioClient" is. I am using macincloud so am not sure if this error is related to a specific setup there.
推荐答案
点击产品->清洁(或CMD-Shift-K)
Click on Product -> Clean (or CMD-Shift-K)
或通过手动清除Xcode设置文件:
Or by manually cleaning the Xcode setting files:
rm -rf"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"rm -rf〜/库/开发人员/Xcode/DerivedDatarm -rf〜/Library/Caches/com.apple.dt.Xcode
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"rm -rf ~/Library/Developer/Xcode/DerivedDatarm -rf ~/Library/Caches/com.apple.dt.Xcode
我不知道为什么.祝你好运,看看是否有帮助.
I have no idea why though. Good luck see if it helps.
希望这对您有用.
这篇关于Swift:加载/Library/Audio/Plug-Ins/HAL/NRDAudioClient时出错:未找到合适的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!