无论我尝试什么(build - > content,NSUrl,filename),我都会得到一个'null exception':当我尝试在monotouch中播放.caf声音文件时找不到文件.
//var path = NSBundle.MainBundle.PathForResource("MatchGame", "caf");
//var gameSong = SystemSound.FromFile( new NSUrl(path, false));
var gameSong = SystemSound.FromFile("MatchGame.caf");
gameSong.PlaySystemSound();
Run Code Online (Sandbox Code Playgroud)
我还尝试使用文件夹名称"images/MatchGame.caf"并将MatchGame.caf移动到根文件夹中进行组合.
我错过了什么?非常感谢.
这是一个链接到单声道添加声音的视频. http://www.screencast.com/t/MmE0ZmFh有 什么问题?