$NetBSD: patch-ad,v 1.6 2018/03/17 09:09:12 tnn Exp $

--- src/wavplay.c.orig	2017-11-15 17:56:45.000000000 +0000
+++ src/wavplay.c
@@ -39,6 +39,14 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
+#ifdef __NetBSD__
+#include <sys/ioctl.h>
+# ifdef HAVE_OSS
+#  include <soundcard.h>
+# else
+#  include <sys/audioio.h>
+# endif
+#endif
 #if defined(linux) || defined(__CYGWIN32__)
 # include <getopt.h>
 #endif
@@ -82,8 +90,8 @@ gint read_line(gint fd, gchar *ptr, gint
 off_t is_std_wav_file(int f, off_t *offset);
 
 
-#if defined(linux) || defined(__FreeBSD__)
-#define DEFAULT_AUDIO_DEVICE "/dev/dsp"
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
+#define DEFAULT_AUDIO_DEVICE "@DEVOSSAUDIO@"
 #elif defined (aix)
 #define DEFAULT_AUDIO_DEVICE ""
 #elif defined(__sgi)
@@ -95,7 +103,7 @@ off_t is_std_wav_file(int f, off_t *offs
 #define DEFAULT_BUFFER_SIZE 22050 
 
 
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
 
 /*
  * open the sound-device of linux and set cd-quality
@@ -147,7 +155,8 @@ gint flags;
 
 #endif
 
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
+
 
 /*
  * open the sound-device of solaris and set cd-quality
@@ -175,7 +184,7 @@ gint flags;
 	info.play.precision = 16;
 	info.play.encoding = AUDIO_ENCODING_LINEAR;
 	info.play.buffer_size = abuf_size;
-#ifndef __OpenBSD__
+#if !defined(__OpenBSD__) && !defined(__NetBSD__)
 	info.output_muted = 0;
 #endif
 
@@ -579,10 +588,10 @@ gchar keybuffer[MAXLINE];
 
 	/* the open sets also the global abuf_size-variable */
 
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
 	audio = open_linux_audio(audio_dev);
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
 	audio = open_solaris_audio(audio_dev);
 #endif
 #ifdef aix
