Forum Libraries, Components, and Plugins

BackgroundMusic in WinPhone not working?


This line works in Android, but not in WinPhone:
CCAudioEngine.SharedEngine.PlayBackgroundMusic("music.mp3", true);

Microsoft.Xna.Framework.Content.ContentLoadException: Failed to load the asset file from music.mp3 at CocosSharp.CCContentManager.Load[T](String assetName, Boolean weakReference) at CocosSharp.CCContentManager.Load[T](String assetName) at CocosSharp.CCMusicPlayer.Open(String fileName, Int32 uId) at CocosSharp.CCAudioEngine.PlayBackgroundMusic(String filename, Boolean loop) at Gulag.GameDelegate.LoadGame(Object sender, EventArgs e) at CocosSharp.CCGameView.LoadGame() at CocosSharp.CCGameView.ViewSizeChanged(Object sender, SizeChangedEventArgs e)

I tryied using the .mp3, the .xnb generated by the MonoGame Pipeline Tool, and the .wma generated by the same tool, with and without extension and with and without the path, just in case, but nothing works.
Preloading the file also gives the same exception in WinPhone.

The .mp3 works fine in a wp8.1 project of mine (not Xamarin/CocosSharp), and the .wma plays ok in Windows, so the file should be ok.
Also, the path is ok, so... I'm really lost with this one.

Maybe I need to explicit a Custom Tool in the file properties or configure something else?

Any ideas?


Best Answer


Sign In or Register to comment.