[xiph-cvs] cvs commit: MTG soundboard.c

Monty xiphmont at xiph.org
Thu Nov 7 00:51:29 PST 2002



xiphmont    02/11/07 03:51:29

  Modified:    .        soundboard.c
  Log:
  Oops, don't hardwire LE request

Revision  Changes    Path
1.8       +11 -7     MTG/soundboard.c

Index: soundboard.c
===================================================================
RCS file: /usr/local/cvsroot/MTG/soundboard.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- soundboard.c	7 Nov 2002 08:41:14 -0000	1.7
+++ soundboard.c	7 Nov 2002 08:51:29 -0000	1.8
@@ -910,11 +910,11 @@
     if(channel_list[i].peak<fabs(staging[i]))
       channel_list[i].peak=fabs(staging[i]);
     if(staging[i]>32767.){
-      out[i]=SWAP(32767);
+      out[i]=32767;
     }else if(staging[i]<-32768.){
-      out[i]=SWAP(-32768);
+      out[i]=-32768;
     }else
-      out[i]=SWAP((int)(rint(staging[i])));
+      out[i]=(int)(rint(staging[i]));
   }
 }
 
@@ -925,7 +925,7 @@
   /* sound device startup */
   audio_buf_info info;
   int fd=fileno(audiofd),i;
-  int format=AFMT_S16_LE;
+  int format=AFMT_S16_NE;
   int channels=MAX_OUPUT_CHANNELS;
   int rate=44100;
   long last=0;
@@ -936,9 +936,13 @@
   int count=0,ret;
 
   ioctl(fd,SNDCTL_DSP_SETFRAGMENT,&fragment);
-  ioctl(fd,SNDCTL_DSP_SETFMT,&format);
+  ret=ioctl(fd,SNDCTL_DSP_SETFMT,&format);
+  if(ret || format!=AFMT_S16_NE){
+    fprintf(stderr,"Could not set AFMT_S16_NE\n");
+    exit(1);
+  }
   ret=ioctl(fd,SNDCTL_DSP_CHANNELS,&channels);
-  if(ret){
+  if(ret || channels!=MAX_OUPUT_CHANNELS){
     fprintf(stderr,"Could not set %d channels\n",channels);
     exit(1);
   }
@@ -2526,7 +2530,7 @@
     exit(1);
   }
 
-  audiofd=fopen("/dev/dsp","wb");
+  audiofd=fopen("/dev/dsp1","wb");
   if(!audiofd){
     fprintf(stderr,"unable to open audio device: %s.\n",strerror(errno));
     fprintf(stderr,"\nPress enter to continue\n");

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list