AVAudioPlayer 使用audioPlayerDecodeErrorDidOccur 中断播放,使用 NSOSStatusErrorDomain -50

发布于 2024-10-06 14:50:07 字数 850 浏览 0 评论 0原文

在非常具体但可重现的情况下,我收到 audioPlayerDecodeErrorDidOccur:error: 并显示以下 NSError:

Error Domain=NSOSStatusErrorDomain Code=-50 “操作无法完成。(OSStatus错误 -50.)"

这发生在也使用 OpenAL 的游戏中;我们使用 OpenAL 播放声音,但尝试利用硬件 AAC 解码。然而,上述情况的发生似乎与我们在 OpenAL 中所做的任何事情都没有联系。

这种情况发生在我们执行场景(游戏模式)切换后大约 2-3 秒——但仅限于特定场景的组合。更奇怪的是,我们没有做任何与这些事件相关的重要音频。我已经证实我们没有对 AVAudioPlayer 做任何事情,但 OpenAL 似乎也没有做任何重要的事情。

我尝试通过释放 AVAudioPlayer 来解决此问题,并将其替换为引用同一文件、使用相同音量并从​​文件中同一时间恢复的另一个播放器。然而,几秒钟后,这名玩家又抛出了上述错误。另一方面,切换到新歌曲会创建一个功能齐全的播放器,不会出现任何问题。

我的问题是:错误 -50 在这种情况下意味着什么,或者您将如何弄清楚它的含义?

(如果这意味着什么的话,游戏必须至少在 iOS 3.1.2 上运行)。


我们尝试禁用 OpenAL 部分代码;但这没有帮助。

音频库代码可在 http://libxal.svn.sf.net/svnroot 处公开获取/libxal/主干/

In very specific, but reproducible cases, I'm getting audioPlayerDecodeErrorDidOccur:error: with the following NSError:

Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn’t be completed. (OSStatus error -50.)"

This occurs in a game that also uses OpenAL; we're playing sounds using OpenAL, but attempting to leverage hardware AAC decoding. However, the occurence of the above does not appear linked to anything we do in OpenAL.

This happens about 2-3 seconds after we perform scene (game mode) switching -- but only with certain combinations of from-and-to scenes. It is even stranger since we do nothing important audio related on these events. I've verified that we do nothing with AVAudioPlayer, but it doesn't seem that anything important is done with OpenAL either.

I've tried to resolve this by releasing the AVAudioPlayer, and replacing it with another one that references the same file, uses the same volume and resumes from the same time in the file. However, after a few seconds, this player also throws the aforementioned error. Switching to a new song, on the other hand, creates a fully functional player, that does not have any problems.

My question is: what does error -50 mean in this context, or how would you go about figuring out what it means?

(If it means anything, the game must run at minimum on iOS 3.1.2).


We have tried disabling OpenAL part of the code; it did not help.

Audio library code is publicly available at http://libxal.svn.sf.net/svnroot/libxal/trunk/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深已缘浅 2024-10-13 14:50:07

我们在 C++ 级别上搞砸了一些东西。这可能会导致 AVAudioPlayer 中的内存损坏,但实际上不会导致游戏崩溃,并且在模拟器和设备上的行为相同。我们修复了这个问题,AVAudioPlayer 现在可以工作了。

We managed to mess up something on the C++ level. This probably caused memory corruption in AVAudioPlayer without actually crashing the game, and behaving the same on the Simulator and the device. We fixed this and the AVAudioPlayer now works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文