Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Help! Trying to load a song throws SharpDX.SharpDXException

$
0
0

@DKCoder wrote:

I was following a simple tutorial online to learn the ins and outs of monogame for a Desktop application. I started learning how audio works and am now stuck because of a runtime error. I know how to load audio in with the pipeline tool and was able to successfully load in a SoundEffect object using it. However, when I try and follow the same procedure, this time using an mp3 specified to load in as a Song with the pipeline, and try to use Content.Load("songName"), a SharpDX.SharpDXException is thrown along with these details: SharpDX.SharpDXException occurred
HResult=0x80070002
Message=HRESULT: [0x80070002], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: The system cannot find the file specified.

Source=SharpDX
StackTrace:
at SharpDX.Result.CheckError()
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String wszURLRef, Int32 dwFlags, ComObject propsRef, ObjectType& objectTypeRef, ComObject& objectOut)
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String url, SourceResolverFlags flags, ComObject propertyStore, ObjectType& objectType)
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String url, SourceResolverFlags flags)
at Microsoft.Xna.Framework.Media.Song.PlatformInitialize(String fileName)
at Microsoft.Xna.Framework.Media.Song..ctor(String fileName)
at Microsoft.Xna.Framework.Media.Song..ctor(String fileName, Int32 durationMS)
at Microsoft.Xna.Framework.Content.SongReader.Read(ContentReader input, Song existingInstance)
at Microsoft.Xna.Framework.Content.ContentTypeReader1.Read(ContentReader input, Object existingInstance)
at Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[T](T existingInstance)
at Microsoft.Xna.Framework.Content.ContentReader.ReadObject[T]()
at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T]()
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action
1 recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
at _4.Audio.Game1.LoadContent() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Game1.cs:line 31
at Microsoft.Xna.Framework.Game.Initialize()
at _4.Audio.Game1.Initialize() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Game1.cs:line 24
at Microsoft.Xna.Framework.Game.DoInitialize()
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
at Microsoft.Xna.Framework.Game.Run()
at _4.Audio.Program.Main() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Program.cs:line 18

I'm very stuck and don't know what I did wrong. Is there something else I need to install to make this work? Please let me know, I appreciate any help.

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles