--- server/dda/voxware/auvoxware.c.orig	Sun Mar  5 03:40:55 2000
+++ server/dda/voxware/auvoxware.c	Sat Dec 16 22:11:35 2000
@@ -156,7 +156,9 @@
 
 #ifdef __FreeBSD__
 # include <machine/soundcard.h>
-# include <machine/pcaudioio.h>
+# ifdef __i386__
+#  include <machine/pcaudioio.h>
+# endif
 #else
 # ifdef __NetBSD__
 #  include <sys/ioctl.h>
@@ -610,7 +612,11 @@
 
     if(sndStatOut.fd == -1)
     {
+#ifdef __FreeBSD__
+       while ((sndStatOut.fd = open(sndStatOut.device, O_RDWR)) == -1 && wait)
+#else
        while ((sndStatOut.fd = open(sndStatOut.device, O_RDWR|O_SYNC)) == -1 && wait)
+#endif
        {
            osLogMsg("openDevice: waiting on output device\n");
            sleep(1);
@@ -1230,6 +1236,11 @@
 /*
  * Setup soundcard at maximum audio quality.
  */
+
+#ifdef __FreeBSD__
+#define NO_16_BIT_SAMPLING
+#endif
+
 static void setupSoundcard(sndStatPtr)
 SndStat* sndStatPtr;
 {
@@ -1380,7 +1391,11 @@
 
     AL_initialized = AuTrue;
 
+#ifdef __FreeBSD__
+    if ((fd = open(sndStatOut.device, O_RDWR, 0)) == -1) {
+#else
     if ((fd = open(sndStatOut.device, O_RDWR|O_SYNC, 0)) == -1) {
+#endif
         UNIDENTMSG;
         return AuFalse;
     }
