libsent/src/adin/adin_netaudio.c

Go to the documentation of this file.
00001 
00032 /*
00033  * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University
00034  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00035  * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology
00036  * All rights reserved
00037  */
00038 
00039 /* Tested with DAT deck, DatLink hardware and NetAudio library
00040    on Solaris2.5.1  */
00041 
00042 /* because of `boolean' type conflict in sentlib and datlink includes, */
00043 /* there are only wrappers. The core functions are defined in adin_na.c */
00044 
00045 
00046 #include <sent/stddefs.h>
00047 #include <sent/adin.h>
00048 
00057 boolean
00058 adin_netaudio_standby(int sfreq, void *arg)
00059 {
00060   char *server_devname;
00061   server_devname = arg;
00062   if (NA_standby(sfreq, server_devname) == 0) return(FALSE); /* error */
00063   return(TRUE);
00064 }
00065 
00071 boolean
00072 adin_netaudio_begin()
00073 {
00074   NA_start();
00075   return(TRUE);
00076 }
00077 
00083 boolean
00084 adin_netaudio_end()
00085 {
00086   NA_stop();
00087   return(TRUE);
00088 }
00089 
00102 int
00103 adin_netaudio_read(SP16 *buf, int sampnum)
00104 {
00105   int cnt;
00106   cnt = NA_read(buf, sampnum);
00107   if (cnt < 0) {
00108     jlog("Error: adin_na: failed to read sample\n");
00109     return(-2);                 /* return negative on error */
00110   }
00111   return(cnt);
00112 }

Generated on Tue Dec 18 15:59:54 2007 for Julius by  doxygen 1.5.4