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.