[Solved] Content Pipeline not loading .wav files

Author’s note: The issue has been fixed. For anyone having issues with WAVs in MonoGame, try using Audacity to convert your WAV using the WAV (Microsoft) 16-bit signed PCM file type and import that instead.

I’m working on adding audio to my game. Currently adding background music courtesy of the amazingly talented and awesome Anders Enger Jensen.

He sent me lossless versions of his Retro Grooves album for my game. They’re in .wavs, and I can easily convert them to MP3s to load in as Song objects - but there is one song in the album - called Dreams Inc - that I am trying to add to the main menu of the game.

I am trying to take a few seconds of the song out and create a looping sample that I’d like to play in the splash screen and “Press ENTER to continue” screen of my game. So basically, I have three parts of the song. First 2 seconds or so play right as the game starts, then the next 7 play in a loop while the game loads and waits for the user to press Enter. Once the user presses Enter, the rest of the song starts to play, with a seamless transition.

I did this looping myself in Audacity, but the loop turned out awful! One of the other devs of my game pointed out that MP3 files, by design, have a fraction of a second worth of silence at the beginning and the end of the track. Eush…that explains it. I’ma need a raw WAV file for each part of the song.

Well, thank god Anders sent me the album in WAV, but…when I loaded it into the Pipeline, and clicked “build”, it failed. I can’t give the stacktrace - not at a development environment right now - but the error was a generic “WavImporter ran into an unexpected error.”

This is actually the error that prompted me to use MP3 instead of WAV, but MP3 won’t work for the loop in the main menu of my game. Any suggestions?

For the record, this is the song I’m talking about.

You’ll probably be able to hear which part of the song I’m trying to loop. It lasts from about 2 seconds in to about 9-10 seconds in.

Note what bit rate you are using and bit fidelity… 8bit/16bit/24bit etc. …

I know they’re 24-bit, but not sure about the bitrate. I’ll have to ask Anders. I’ll do that and get back to you.

Edit: Just sent the email to Anders. Waiting on a reply. But, just so I don’t have to keep bugging him about this (I sent him this topic as well so it’d be a good reference for him as well), what bitrates/fidelities (why is there no plural for “fidelity” lol) does MonoGame support?

Status update @MrValentine

Anders just replied to my email. All the tracks I got from the album are in fact 24-bit and 44.1KHz.

There are some words that are singular and plural in the same spelling…

Hmm, surprised nobody has come to assist yet…

Tried finding info on file formats, can you try an AIFF file?

Just converted one of Anders’ songs to AIFF using Audacity - signed 16bit fidelity. Plays in WMP just fine, but when importing into Content Pipeline, it comes in as an invalid/unsupported content file. So…AIFF’s off the table.

Tried again with WAV, same export settings as the other song - 24bit fidelity, 44.1KHz, straight from his DAW. I used one of his other songs from the Retro Grooves album to confirm that it wasn’t just Dreams Inc failing on me…and sure enough…

Guess the Content Pipeline hates The 8-bit Guy as well. :stuck_out_tongue:

Edit: I FIGURED IT OUT.

So, AIFF’s not supported. I began to try various settings in Audacity to export the song as a WAV. First, I tried 32-bit float. Same error as above. I then tried 24-bit signed PCM. Same error.

I then tried 16-bit PCM and BAM! It worked perfectly. Of course, this may lose quality but I doubt anyone but audiophiles will care. The good thing is, we figured it out.

2 Likes

That’s why I asked about the quality settings, I just forgot what I was looking for and hoped someone would help after you posted…

Adding this to my Useful Links thread UMGRL