Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

adin_netaudio.c

Go to the documentation of this file.
00001 
00031 /*
00032  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00033  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00034  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology
00035  * All rights reserved
00036  */
00037 
00038 /* Tested with DAT deck, DatLink hardware and NetAudio library
00039    on Solaris2.5.1  */
00040 
00041 /* because of `boolean' type conflict in sentlib and datlink includes, */
00042 /* there are only wrappers. The core functions are defined in adin_na.c */
00043 
00044 
00045 #include <sent/stddefs.h>
00046 #include <sent/adin.h>
00047 
00056 boolean
00057 adin_netaudio_standby(int sfreq, void *arg)
00058 {
00059   char *server_devname;
00060   server_devname = arg;
00061   if (NA_standby(sfreq, server_devname) == 0) return(FALSE); /* error */
00062   return(TRUE);
00063 }
00064 
00070 boolean
00071 adin_netaudio_start()
00072 {
00073   NA_start();
00074   j_printerr("<<< please speak >>>\n");
00075   return(TRUE);
00076 }
00077 
00083 boolean
00084 adin_netaudio_stop()
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     j_printerr("Error: failed to read sample\n");
00109     return(-2);                 /* return negative on error */
00110   }
00111   return(cnt);
00112 }

Generated on Tue Mar 28 16:01:39 2006 for Julius by  doxygen 1.4.2