summaryrefslogtreecommitdiff
path: root/graphics/xanim/patches/patch-ac
blob: 2c81733f21720c2fac15867f86f0cb55acec9120 (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
33
--- xa_audio.c-orig	Mon May 26 12:57:15 1997
+++ xa_audio.c	Mon May 26 15:55:13 1997
@@ -4480,6 +4480,22 @@
   a_info.blocksize = 1024;
   ioctl(devAudio, AUDIO_SETINFO, &a_info);
   AUDIO_INITINFO(&a_info);
+#ifdef AUDIO_ENCODING_LINEAR_LE
+  /* Use new encoding names */
+  a_info.play.encoding = AUDIO_ENCODING_LINEAR_LE;
+  ioctl(devAudio, AUDIO_SETINFO, &a_info);
+  AUDIO_INITINFO(&a_info);
+  a_info.mode = AUMODE_PLAY | AUMODE_PLAY_ALL;
+  ioctl(devAudio, AUDIO_SETINFO, &a_info);
+  AUDIO_INITINFO(&a_info);
+  a_info.play.precision = 16;
+  if (ioctl(devAudio, AUDIO_SETINFO, &a_info) < 0) {
+    AUDIO_INITINFO(&a_info);
+    a_info.play.encoding = AUDIO_ENCODING_ULINEAR;
+    a_info.play.precision = 8;
+    ioctl(devAudio, AUDIO_SETINFO, &a_info);
+  }
+#else
   a_info.play.encoding = AUDIO_ENCODING_PCM16;
   ioctl(devAudio, AUDIO_SETINFO, &a_info);
   AUDIO_INITINFO(&a_info);
@@ -4488,6 +4504,7 @@
   AUDIO_INITINFO(&a_info);
   a_info.play.precision = 16;
   ioctl(devAudio, AUDIO_SETINFO, &a_info);
+#endif
   AUDIO_INITINFO(&a_info);
   a_info.play.sample_rate = 11025;
   ioctl(devAudio, AUDIO_SETINFO, &a_info);