gpt4 book ai didi

iphone - 无法在Xcode iPhone模拟器上播放声音

转载 作者:行者123 更新时间:2023-12-01 19:23:59 27 4
gpt4 key购买 nike

我正在尝试播放链接到按钮的声音,但出现以下错误代码。我该如何解决这个问题?

2012-01-13 07:22:58.887 M3NYFAC3Z [5875:1e03]错误加载
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262):找不到符号:_CFXMLNodeGetInfoPtr引用自:
/System/Library/Frameworks/Security.framework/Versions/A/Security
预期在:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
在/System/Library/Frameworks/Security.framework/Versions/A/Security中
2012-01-13 07:22:58.892 M3NYFAC3Z [5875:1e03]错误加载
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262):找不到符号:_CFXMLNodeGetInfoPtr引用自:
/System/Library/Frameworks/Security.framework/Versions/A/Security
预期在:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
在/System/Library/Frameworks/Security.framework/Versions/A/Security中
2012-01-13 07:25:28.994 M3NYFAC3Z [5875:1e03] AQMEIO_Base::DoStartIO:
超时2012-01-13 07:25:29.271 M3NYFAC3Z [5875:1e03]
AQMEDevice(0x8831a00):: StartIO:错误-66681 2012-01-13 07:25:29.272
M3NYFAC3Z [5875:1e03] CA_UISoundClientBase::StartPlaying:
AddRunningClient失败(状态= -66681)。 [切换到过程5875
线程0x207] sharedlibrary apply-load-rules全部

这是我的代码:

-(IBAction)playobey:(id)sender { 
NSString *path = [[NSBundle mainBundle] pathForResource:@"renegadeyamaha" ofType:@"wav"];
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[audioPlayer play];
}

最佳答案

您需要在ivar / property中的某个地方保留对AVAudioPlayer的引用。它可能已经创建,然后在有机会完成播放声音之前立即发布。

我写了一些基于AVAudioPlayer的声音播放器类,它可以使您的生活更轻松:

https://github.com/nicklockwood/SoundManager

关于iphone - 无法在Xcode iPhone模拟器上播放声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8858804/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com