简体   繁体   English

SKAction playSoundFileNamed 不在物理上播放声音 iPad

[英]SKAction playSoundFileNamed Not Playing Sound on Physical iPad

I am currently on Whack-A-Penguin (Project 14) of Hacking with Swift.我目前正在使用 Swift 进行黑客攻击的 Whack-A-Penguin(项目 14)。 I am trying to get the sound to work, but I am unsure of why it is not working.我正在尝试让声音正常工作,但我不确定它为什么不工作。 There is no error code that comes up in debugger, which makes it hard to understand what is going wrong...调试器中没有出现错误代码,这使得很难理解出了什么问题......

I am testing on a physical iPad with the sound settings on.我正在使用声音设置在物理 iPad 上进行测试。 Below is a snapshot of where i have placed the files and how the soundfile is being called in my code.下面是我放置文件的位置以及如何在我的代码中调用声音文件的快照。 Not sure what the issue is...Any help would be greatly appreciated.不知道问题是什么......任何帮助将不胜感激。

Image of my file directory and code snippet我的文件目录和代码片段的图像

When you select your sound file in XCode, access the inspector on the right side, then make sure the file is selected for your target(s).当您 select 您的声音文件在 XCode 中时,访问右侧的检查器,然后确保为您的目标选择了该文件。

Screenshot from Xcode showing where to do this Xcode 的屏幕截图显示了在哪里执行此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM