MonoGame icon indicating copy to clipboard operation
MonoGame copied to clipboard

[MacOS] Monogame content builder v.3.8.4 not working for audio files (wav, ogg, mp3)

Open ThomasFOG opened this issue 3 months ago • 1 comments

Discussed in https://github.com/MonoGame/MonoGame/discussions/9012

Originally posted by tholopai September 11, 2025 Hello,

I upgraded my Monogame project from 3.8.2.1105 to 3.8.4. After the update, build is not working anymore on my MacOS setup (Windows and Linux is working ok). Problem is related to Content.mgcb audio files: when I build, I got error:

Failed to open file wallhit. Ensure the file is a valid audio file and is not DRM protected. /Users/Tapio/.nuget/packages/monogame.content.builder.task/3.8.4/build/MonoGame.Content.Builder.Task.targets(155,5): error MSB3073

ffmpeg -i for wallhit.wav:

Duration: 00:00:00.99, bitrate: 1417 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s

Content.mgcb for wallhit.wav:

#begin sounds/wallhit.wav /importer:WavImporter /processor:SoundEffectProcessor /processorParam:Quality=Best /build:sounds/wallhit.wav

I tried different wav's and none of them is working. I tried to convert .wav to .ogg and .mp3 and those are not working also. If I remove all audio files from my Content.mgcb, then the build completes without errors.

Information about my setup:

OS: macOS Monterey 12.6.7 .NET SDK: 8.0.414

ThomasFOG avatar Sep 12 '25 15:09 ThomasFOG

Apparently, ffprobe fails on macOS since 3.8.3 but it used to work in 3.8.2.

This isn't fixed as of 3.8.5-develop.11.

ThomasFOG avatar Sep 12 '25 15:09 ThomasFOG

Hi,

I have the same problem with MonoGame v3.8.4.1 on an older, unsupported macOS (11.7.10). I can't update this old MacBook to a newer macOS.

In my case the crash was caused by ffprobe and ffmpeg being built for macOS 14 — I confirmed this from the crash logs in Console.

I worked around it by downloading ffmpeg and ffprobe binaries from https://ffbinaries.com/downloads and copying them to: ~/.nuget/packages/dotnet-mgcb/3.8.4.1/tools/net8.0/any/osx/

macOS flags them as downloaded from the Internet (quarantined). You can remove the quarantine with: xattr -d com.apple.quarantine ffprobe and the same for ffmpeg (or run xattr -dr com.apple.quarantine on the folder).

To actually run the game I also had to use the OpenAL dylib from the 3.8.2 NuGet package, because the 3.8.4.1 OpenAL build also requires macOS 14. It was a bit of a pain to set up, but it works for me.

For the MonoGame team: please consider building binaries targeting older macOS versions. I understand if you won't — macOS 14 appears to be the oldest supported version according to https://endoflife.date/macos.

morfah avatar Dec 14 '25 17:12 morfah

A quick look at all the mentioned libraries tells me that none of them are built with the CMAKE backward compatibility option we typically use everywhere else: CMAKE_OSX_DEPLOYMENT_TARGET=10.15. This seems relevant to your comment, @morfah.

I haven't looked the other dependencies (beside SDL, which correctly has that option), but it'll be worth checking that each and every of them have that option enabled and repackaged into the next release.

ThomasFOG avatar Dec 15 '25 13:12 ThomasFOG