blob: 583d15801cac26c09c90399578ff4710179a6bca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-ac,v 1.5 2003/03/22 05:44:38 dillo Exp $
--- audioIO_SunOS.c.orig Sat May 31 13:47:58 1997
+++ audioIO_SunOS.c
@@ -8,7 +8,11 @@
#include "amp.h"
#include <sys/types.h>
+#ifndef OS_NetBSD
#include <sys/stropts.h>
+#else
+#include <sys/ioctl.h>
+#endif
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
@@ -31,13 +35,12 @@ audioOpen(int frequency, int stereo, int
{
int res;
- if ((audio_fd = open("/dev/audio",O_RDWR))==-1) {
+ if ((audio_fd = open("/dev/audio",O_WRONLY))==-1) {
die(" unable to open the audio device\n");
}
DB(audio, msg("Audio device opened on %d\n",audio_fd) );
- if (ioctl(audio_fd,AUDIO_GETINFO,&auinfo)<0)
- die("Unable to get audio info\n");
+ AUDIO_INITINFO(&auinfo);
auinfo.play.precision=16;
auinfo.play.encoding=AUDIO_ENCODING_LINEAR;
|