diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
index a04ae9d3d0..72e610d8a6 100644
--- a/audio/out/ao_pipewire.c
+++ b/audio/out/ao_pipewire.c
@@ -20,6 +20,14 @@
* License along with mpv. If not, see .
*/
+// For FreeBSD where spa/param/audio/raw.h expects those to be defined
+#include "osdep/endian.h"
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+
#include
#include
#include