Issue loading in a song with an OpenGL project

For some reason my content manager is using some weird file path when trying to load in a song.

Here is the error:

I do some loading of sound effects and it works fine.

Here is the structure of my Content.mgcb and highlighting the song in question:

It is looking for 1.ogg in the error message instead of 1.mp3 in the mgcb

On OpenGL platforms, streaming media are converted to Ogg Vorbis format. The content then contains song.xnb and song.ogg, in your case 1.xnb and 1.ogg. For some reason your content folder in the output does not appear to contain the .ogg file. Did you generate your project from the OpenGL project template? This project template contains the build steps that automatically copy the content build output to the project output.

Hum !!! I’ve learned something :slight_smile: Why are there 2 files ? Is the xnb just a middle file to point to the ogg file ?

Yes. The ContentManager loads XNB files. For a song, the XNB contains the relative path to the song file that was produced by the content pipeline.

It is generated from a template yeah. The weirdest thing is that it works on my surface pro. It’s almost like for loading in the Song objects it uses a wrong path. It also weird that the SoundEffect loads in just fine.

I have check the output folder and it outputs properly in the right place and is converted to .ogg.

If you look at the first image I posted the path is “M:/Development/1.ogg” this is not right, and I have no idea how that is happening.

Could you paste here the part of the Content.mgcb file that processes the song. It looks like it may be getting an absolute path in the XNB file for some reason.

I’m not sure what you are look for but this is my best guess

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False

#---------------------------------- Content ---------------------------------#

begin audio/spring/1.mp3
/importer:Mp3Importer
/processor:SongProcessor
/processorParam:Quality=Best
/build:audio/spring/1.mp3