--- ./server/dda/voxware/auvoxware.c.orig	Sun Apr 29 17:11:08 2001
+++ ./server/dda/voxware/auvoxware.c	Sat Sep  7 17:02:34 2002
@@ -154,16 +154,11 @@
 #include <sys/param.h>
 #include <assert.h>
 
-#ifdef __FreeBSD__
-# include <machine/soundcard.h>
-# include <machine/pcaudioio.h>
+#ifdef __NetBSD__
+# include <sys/ioctl.h>
+# include <soundcard.h>
 #else
-# ifdef __NetBSD__
-#  include <sys/ioctl.h>
-#  include <soundcard.h>
-# else
-#  include <sys/soundcard.h>
-# endif
+# include <sys/soundcard.h>
 #endif
 
 #include <audio/audio.h>
@@ -624,7 +619,11 @@
 
     if(sndStatOut.fd == -1)
     {
+#ifdef __FreeBSD__
+       while ((sndStatOut.fd = open(sndStatOut.device, sndStatOut.howToOpen, 0666)) == -1 && wait)
+#else
        while ((sndStatOut.fd = open(sndStatOut.device, sndStatOut.howToOpen|O_SYNC, 0666)) == -1 && wait)
+#endif
        {
            osLogMsg("openDevice: waiting on output device\n");
            sleep(1);
@@ -1269,6 +1268,11 @@
 /*
  * Setup soundcard at maximum audio quality.
  */
+
+#ifdef __FreeBSD__
+#define NO_16_BIT_SAMPLING
+#endif
+
 static void setupSoundcard(sndStatPtr)
 SndStat* sndStatPtr;
 {
@@ -1425,7 +1429,11 @@
 	  osLogMsg("openDevice OUT %s mode %d\n", 
 		   sndStatOut.device, sndStatOut.howToOpen);
 	
+#ifdef __FreeBSD__
+	if ((fd = open(sndStatOut.device, sndStatOut.howToOpen, 0)) == -1)
+#else
 	if ((fd = open(sndStatOut.device, sndStatOut.howToOpen|O_SYNC, 0)) == -1)
+#endif
 	  {
 	    UNIDENTMSG;
 	    return AuFalse;
