Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content.Load<Song> Gives a NullReferenceException #191

Closed
P-Storm opened this issue Jul 9, 2018 · 3 comments
Closed

Content.Load<Song> Gives a NullReferenceException #191

P-Storm opened this issue Jul 9, 2018 · 3 comments

Comments

@P-Storm
Copy link

P-Storm commented Jul 9, 2018

Hi all,

I'm trying to load a sound file (a mp3) in my game. The SoundEffect I can load this way.

            var song = Content.Load<Song>("Audio/Songs/song.mp3");
            MediaPlayer.Play(song);

And I get the following error:

Object reference not set to an instance of an object.
   at Vorbisfile.ov_info(IntPtr vf, Int32 link)
   at Microsoft.Xna.Framework.Media.Song..ctor(String fileName)
   at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject)
   at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
   at BeatBets.Game1.LoadContent()
   at Microsoft.Xna.Framework.Game.Initialize()
   at BeatBets.Game1.Initialize()
   at Microsoft.Xna.Framework.Game.DoInitialize()
   at Microsoft.Xna.Framework.Game.Run()
   at BeatBets.Program.Main(String[] args)

I'm using the newest fnalibs and FNA.

@flibitijibibo
Copy link
Member

@P-Storm
Copy link
Author

P-Storm commented Jul 9, 2018

Welp, skipped over that part! Thank you for your comment :)

@flibitijibibo
Copy link
Member

If you happen to be proficient with C:

FNA-XNA/FAudio#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants