sumom****@users*****
sumom****@users*****
2009年 7月 3日 (金) 02:05:20 JST
Index: julius4/plugin/adin_oss.c diff -u julius4/plugin/adin_oss.c:1.2 julius4/plugin/adin_oss.c:1.3 --- julius4/plugin/adin_oss.c:1.2 Wed Mar 18 16:05:31 2009 +++ julius4/plugin/adin_oss.c Fri Jul 3 02:05:20 2009 @@ -53,7 +53,7 @@ * @author Akinobu Lee * @date Thu Aug 7 14:28:37 2008 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ @@ -421,6 +421,8 @@ * If this function returns FALSE, Julius will exit recognition loop. * * JuliusLib: this will be called at j_open_stream(). + * + * @param pathname [in] file / device name to open or NULL for default * * @return TRUE on success, FALSE on failure. * </EN> @@ -434,11 +436,13 @@ * * JuliusLib: この関数は j_open_stream() 内で呼ばれる. * + * @param pathname [in] 開くファイルあるいはデバイス名,NULL ならデフォルト + * * @return 成功時 TRUE,失敗時 FALSE を返す. * </JA> */ boolean -adin_open() +adin_open(char *pathname) { /* do open the device */ int fmt; @@ -447,8 +451,8 @@ int s; char buf[2]; - if ((audio_fd = open("/dev/dsp", O_RDONLY)) == -1) { - printf("Error: cannot open /dev/dsp\n"); + if ((audio_fd = open(pathname ? pathname : "/dev/dsp", O_RDONLY)) == -1) { + printf("Error: cannot open %s\n", pathname ? pathname : "/dev/dsp"); return FALSE; } fmt = AFMT_S16_LE; /* 16bit signed (little endian) */