[Liboss-commit] CVS: liboss/src osscat.c,1.3,1.4
Brought to you by:
thesin
|
From: Dave V. <va...@us...> - 2002-10-19 07:02:04
|
Update of /cvsroot/liboss/liboss/src
In directory usw-pr-cvs1:/tmp/cvs-serv22435/src
Modified Files:
osscat.c
Log Message:
We have sound! Too bad it's meaningless static so far...time to look up
exactly what a .WAV is...
Index: osscat.c
===================================================================
RCS file: /cvsroot/liboss/liboss/src/osscat.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- osscat.c 18 Oct 2002 22:46:49 -0000 1.3
+++ osscat.c 19 Oct 2002 07:02:01 -0000 1.4
@@ -10,7 +10,7 @@
int main(int argc, char **argv)
{
- int fd, play;
+ int fd, play, format, channels, speed;
char buf[BUF_SIZE];
if (argc != 2) {
@@ -28,6 +28,13 @@
exit(1);
}
+ format = AFMT_S16_LE;
+ ioctl(play, SNDCTL_DSP_SETFMT, &format);
+ channels = 2;
+ ioctl(play, SNDCTL_DSP_CHANNELS, &channels);
+ speed = 41100;
+ ioctl(play, SNDCTL_DSP_SPEED, &speed);
+
while (read(fd, buf, BUF_SIZE) > 0) {
write(play, buf, BUF_SIZE); /* if it errors, keep going */
}
|