- // Look for an appropriate sound format
- // TODO: we should also test mono/stereo and bits
- // TODO: support "-sndspeed", "-sndbits", "-sndmono" and "-sndstereo"
- shm->channels = 2;
- shm->samplebits = 16;
- for (i = 0; i < sizeof (tryrates) / sizeof (tryrates[0]); i++)
- {
- shm->speed = tryrates[i];
-
- AUDIO_INITINFO (&info);
- info.play.sample_rate = shm->speed;
- info.play.channels = shm->channels;
- info.play.precision = shm->samplebits;
-// We only handle sound cards of the same endianess than the CPU
-#if BYTE_ORDER == BIG_ENDIAN
- info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
+ AUDIO_INITINFO (&info);
+#ifdef AUMODE_PLAY // NetBSD / OpenBSD
+ info.mode = AUMODE_PLAY;
+#endif
+ info.play.sample_rate = requested->speed;
+ info.play.channels = requested->channels;
+ info.play.precision = requested->width * 8;
+ if (requested->width == 1)
+#ifdef SUNOS
+ info.play.encoding = AUDIO_ENCODING_LINEAR8;