diff --git a/audio/festival/core/Makefile b/audio/festival/core/Makefile index 9d04437b7da..04e26e24633 100644 --- a/audio/festival/core/Makefile +++ b/audio/festival/core/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.11 2010/01/30 19:08:30 jolan Exp $ +# $OpenBSD: Makefile,v 1.12 2010/04/26 01:32:38 jakemsr Exp $ COMMENT= general multi-lingual speech synthesis system V= 1.95 DISTNAME= festival-${V}-beta -PKGNAME= ${DISTNAME:S/-beta/beta/}p2 +PKGNAME= ${DISTNAME:S/-beta/beta/}p3 CATEGORIES= audio MASTER_SITES= http://www.cstr.ed.ac.uk/downloads/festival/${V}/ \ http://festvox.org/packed/festival/${V}/ @@ -51,11 +51,14 @@ PERMIT_DISTFILES_CDROM?=Yes PERMIT_DISTFILES_FTP= Yes PERMIT_PACKAGE_CDROM?= Yes PERMIT_PACKAGE_FTP= Yes -WANTLIB= c m ossaudio stdc++ termcap +WANTLIB= c m sndio stdc++ termcap post-patch: @cp ${FILESDIR}/OpenBSD.mak ${WRKSRC}/speech_tools/config/systems/OpenBSD.mak @cp ${FILESDIR}/Makefile ${WRKSRC} + @cp ${FILESDIR}/sndio_audio.mak ${WRKSRC}/festival/config/modules + @cp ${FILESDIR}/sndio_audio.mak ${WRKSRC}/speech_tools/config/modules + @cp ${FILESDIR}/sndio.cc ${WRKSRC}/speech_tools/audio do-configure: @cd ${FESTIVAL} && ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS} diff --git a/audio/festival/core/files/OpenBSD.mak b/audio/festival/core/files/OpenBSD.mak index d476cd37b9d..ec266a460f8 100644 --- a/audio/festival/core/files/OpenBSD.mak +++ b/audio/festival/core/files/OpenBSD.mak @@ -1,5 +1,5 @@ -# $OpenBSD: OpenBSD.mak,v 1.1 2004/07/11 06:27:07 jolan Exp $ +# $OpenBSD: OpenBSD.mak,v 1.2 2010/04/26 01:32:38 jakemsr Exp $ include $(EST)/config/systems/default.mak ECHO_N = /usr/bin/printf "%s" -NATIVE_AUDIO_MODULE= FREEBSD16 +NATIVE_AUDIO_MODULE= SNDIO NAWK=awk diff --git a/audio/festival/core/files/sndio.cc b/audio/festival/core/files/sndio.cc new file mode 100644 index 00000000000..866f43cc71d --- /dev/null +++ b/audio/festival/core/files/sndio.cc @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2010 Jacob Meuser + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* Based on voxware.cc which came with the following copyright notice. */ + +/*************************************************************************/ +/* */ +/* Centre for Speech Technology Research */ +/* University of Edinburgh, UK */ +/* Copyright (c) 1997,1998 */ +/* All Rights Reserved. */ +/* */ +/* Permission is hereby granted, free of charge, to use and distribute */ +/* this software and its documentation without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of this work, and to */ +/* permit persons to whom this work is furnished to do so, subject to */ +/* the following conditions: */ +/* 1. The code must retain the above copyright notice, this list of */ +/* conditions and the following disclaimer. */ +/* 2. Any modifications must be clearly marked as such. */ +/* 3. Original authors' names are not deleted. */ +/* 4. The authors' names are not used to endorse or promote products */ +/* derived from this software without specific prior written */ +/* permission. */ +/* */ +/* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */ +/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ +/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ +/* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */ +/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ +/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ +/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ +/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ +/* THIS SOFTWARE. */ +/* */ +/*************************************************************************/ +/* Author : Alan W Black */ +/* Date : July 1997 */ +/*-----------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include +#include "EST_cutils.h" +#include "EST_walloc.h" +#include "EST_Wave.h" +#include "EST_wave_aux.h" +#include "EST_Option.h" +#include "audioP.h" +#include "EST_io_aux.h" +#include "EST_error.h" + +#ifdef SUPPORT_SNDIO +#include +int sndio_supported = TRUE; +static char *aud_sys_name = "sndio"; +static int stereo_only = 0; + + +// Code to block signals while sound is playing. +// Needed inside Java on (at least some) linux systems +// as scheduling interrupts seem to break the writes. + +#ifdef THREAD_SAFETY +#include +#include + +#define THREAD_DECS() \ + sigset_t oldmask \ + +#define THREAD_PROTECT() do { \ + sigset_t newmask; \ + \ + sigfillset(&newmask); \ + \ + pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); \ + } while(0) + +#define THREAD_UNPROTECT() do { \ + pthread_sigmask(SIG_SETMASK, &oldmask, NULL); \ + } while (0) + +#else +#define THREAD_DECS() //empty +#define THREAD_PROTECT() //empty +#define THREAD_UNPROTECT() //empty +#endif + + +#define AUDIOBUFFSIZE 256 +// #define AUDIOBUFFSIZE 20480 + +int +play_sndio_wave(EST_Wave &inwave, EST_Option &al) +{ + struct sio_hdl *hdl; + struct sio_par par; + int sample_rate; + short *waveform; + short *waveform2 = NULL; + int num_samples; + int i, r, n; + char *audiodevice = NULL; + + if (al.present("-audiodevice")) + audiodevice = al.val("-audiodevice"); + + if ((hdl = sio_open(audiodevice, SIO_PLAY, 0)) == NULL) { + cerr << aud_sys_name << ": error opening device" << endl; + return -1; + } + + waveform = inwave.values().memory(); + num_samples = inwave.num_samples(); + sample_rate = inwave.sample_rate(); + + sio_initpar(&par); + + par.rate = sample_rate; + par.pchan = 1; + par.bits = 16; + par.sig = 1; + par.le = SIO_LE_NATIVE; + + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + cerr << aud_sys_name << ": error configuring parameters" << endl; + return -1; + } + + if ((par.pchan != 1 && par.pchan != 2) || + !((par.bits == 16 && par.sig == 1) || + (par.bits == 8 && par.sig == 0)) || + par.rate != sample_rate) { + cerr << aud_sys_name << ": could not set appropriate parameters" << endl; + return -1; + } + + if (!sio_start(hdl)) { + cerr << aud_sys_name << ": could not start sudio" << endl; + return -1; + } + + if (par.pchan == 2) + stereo_only = 1; + + if (stereo_only) { + waveform2 = walloc(short, num_samples * 2); + for (i = 0; i < num_samples; i++) { + waveform2[i * 2] = inwave.a(i); + waveform2[(i * 2) + 1] = inwave.a(i); + } + waveform = waveform2; + num_samples *= 2; + } + + THREAD_DECS(); + THREAD_PROTECT(); + + if (par.bits == 8) { + // Its actually 8bit unsigned so convert the buffer; + unsigned char *uchars = walloc(unsigned char,num_samples); + for (i=0; i < num_samples; i++) + uchars[i] = waveform[i] / 256 + 128; + for (i=0; i < num_samples; i += r) { + if (num_samples > i + AUDIOBUFFSIZE) + n = AUDIOBUFFSIZE; + else + n = num_samples - i; + r = sio_write(hdl, &uchars[i], n); + if (r == 0 && sio_eof(hdl)) { + THREAD_UNPROTECT(); + cerr << aud_sys_name << ": failed to write to buffer" << + sample_rate << endl; + sio_close(hdl); + return -1; + } + } + wfree(uchars); + } else { + // 16-bit + int nbuf, c; + short *buf; + + nbuf = par.round * par.bps * par.pchan; + + buf = new short[nbuf]; + + for (i = 0; i < num_samples; i += r / 2) { + if (num_samples > i+nbuf) + n = nbuf; + else + n = num_samples-i; + + for (c = 0; c < n; c++) + buf[c] = waveform[c + i]; + + for(; c < nbuf; c++) + buf[c] = waveform[n - 1]; + + r = sio_write(hdl, buf, nbuf * 2); + if (r == 0 && sio_eof(hdl)) { + THREAD_UNPROTECT(); + EST_warning("%s: failed to write to buffer (sr=%d)", + aud_sys_name, sample_rate ); + sio_close(hdl); + return -1; + } + + } + delete [] buf; + } + + sio_close(hdl); + if (waveform2) + wfree(waveform2); + + THREAD_UNPROTECT(); + return 1; +} + +int +record_sndio_wave(EST_Wave &inwave, EST_Option &al) +{ + struct sio_hdl *hdl; + struct sio_par par; + int sample_rate = 16000; // egcs needs the initialized for some reason + short *waveform; + short *waveform2 = NULL; + int num_samples; + int i,r,n; + char *audiodevice = NULL; + + if (al.present("-audiodevice")) + audiodevice = al.val("-audiodevice"); + + sample_rate = al.ival("-sample_rate"); + + if ((hdl = sio_open(audiodevice, SIO_REC, 0)) == NULL) { + cerr << aud_sys_name << ": error opening device" << endl; + return -1; + } + + sio_initpar(&par); + + par.rate = sample_rate; + par.rchan = 1; + par.bits = 16; + par.sig = 1; + par.le = SIO_LE_NATIVE; + + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + cerr << aud_sys_name << ": error configuring parameters" << endl; + return -1; + } + + if ((par.rchan != 1 && par.rchan != 2) || + !((par.bits == 16 && par.sig == 1) || + (par.bits == 8 && par.sig == 0)) || + par.rate != sample_rate) { + cerr << aud_sys_name << ": could not set appropriate parameters" << endl; + return -1; + } + + if (!sio_start(hdl)) { + cerr << aud_sys_name << ": could not start sudio" << endl; + return -1; + } + + if (par.rchan == 2) + stereo_only = 1; + + inwave.resize((int)(sample_rate * al.fval("-time"))); + inwave.set_sample_rate(sample_rate); + num_samples = inwave.num_samples(); + waveform = inwave.values().memory(); + + if (par.bits == 16) { + // We assume that the device returns audio in native byte order + // by default + + if (stereo_only) { + waveform2 = walloc(short, num_samples * 2); + num_samples *= 2; + } else + waveform2 = waveform; + + for (i = 0; i < num_samples; i+= r) { + if (num_samples > i+AUDIOBUFFSIZE) + n = AUDIOBUFFSIZE; + else + n = num_samples-i; + r = sio_read(hdl, &waveform2[i], n * 2); + r /= 2; + if (r == 0 && sio_eof(hdl)) { + cerr << aud_sys_name << ": failed to read from audio device" + << endl; + sio_close(hdl); + return -1; + } + } + } else { + unsigned char *u8wave = walloc(unsigned char, num_samples); + + for (i = 0; i < num_samples; i += r) { + if (num_samples > i+AUDIOBUFFSIZE) + n = AUDIOBUFFSIZE; + else + n = num_samples - i; + r = sio_read(hdl, &u8wave[i], n); + if (r == 0 && sio_eof(hdl)) { + cerr << aud_sys_name << ": failed to read from audio device" + << endl; + sio_close(hdl); + wfree(u8wave); + return -1; + } + + } + uchar_to_short(u8wave, waveform, num_samples); + wfree(u8wave); + } + + if (stereo_only) { + for (i = 0; i < num_samples; i += 2) + waveform[i / 2] = waveform2[i]; + wfree(waveform2); + } + + sio_close(hdl); + return 0; +} + +#else + +int sndio_supported = FALSE; + +int +play_sndio_wave(EST_Wave &inwave, EST_Option &al) +{ + (void)inwave; + (void)al; + cerr << "Audio: sndio not compiled in this version" << endl; + return -1; +} + +int +record_sndio_wave(EST_Wave &inwave, EST_Option &al) +{ + (void)inwave; + (void)al; + cerr << "Audio: sndio not compiled in this version" << endl; + return -1; +} + +#endif diff --git a/audio/festival/core/files/sndio_audio.mak b/audio/festival/core/files/sndio_audio.mak new file mode 100644 index 00000000000..1f5d7d2d82a --- /dev/null +++ b/audio/festival/core/files/sndio_audio.mak @@ -0,0 +1,8 @@ + +INCLUDE_SNDIO_AUDIO=1 + +MOD_DESC_SNDIO_AUDIO=(from EST) Audio module for sndio audio support + +AUDIO_DEFINES += -DSUPPORT_SNDIO + +MODULE_LIBS += -lsndio diff --git a/audio/festival/core/patches/patch-festival_config_modules_Makefile b/audio/festival/core/patches/patch-festival_config_modules_Makefile new file mode 100644 index 00000000000..415adccef1a --- /dev/null +++ b/audio/festival/core/patches/patch-festival_config_modules_Makefile @@ -0,0 +1,12 @@ +$OpenBSD: patch-festival_config_modules_Makefile,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- festival/config/modules/Makefile.orig Sat Apr 24 03:19:52 2010 ++++ festival/config/modules/Makefile Sat Apr 24 03:20:10 2010 +@@ -40,7 +40,7 @@ DIRNAME=config/modules + RULESETS = efence.mak dmalloc.mak \ + psola_tm.mak editline.mak tcl.mak \ + freebsd16_audio.mak irix_audio.mak linux16_audio.mak \ +- sun16_audio.mak win32_audio.mak \ ++ sun16_audio.mak win32_audio.mak sndio_audio.mak \ + mplayer_audio.mak nas_audio.mak esd_audio.mak native_audio.mak \ + siod.mak wagon.mak scfg.mak wfst.mak ols.mak debugging.mak + diff --git a/audio/festival/core/patches/patch-festival_lib_init_scm b/audio/festival/core/patches/patch-festival_lib_init_scm new file mode 100644 index 00000000000..2efb25d5917 --- /dev/null +++ b/audio/festival/core/patches/patch-festival_lib_init_scm @@ -0,0 +1,16 @@ +$OpenBSD: patch-festival_lib_init_scm,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- festival/lib/init.scm.orig Sat Apr 24 18:22:07 2010 ++++ festival/lib/init.scm Sat Apr 24 18:34:12 2010 +@@ -93,8 +93,10 @@ + (Parameter.def 'Audio_Method 'os2audio)) + ((member 'mplayeraudio *modules*) + (Parameter.def 'Audio_Method 'mplayeraudio)) +- (t ;; can't find direct support so guess that /dev/audio for 8k ulaw exists +- (Parameter.def 'Audio_Method 'sunaudio))) ++ ((member 'sndioaudio *modules*) ++ (Parameter.def 'Audio_Method 'sndioaudio)) ++ (t ;; stupid crappy software. default to only supported "protocol" ++ (Parameter.def 'Audio_Method 'sndioaudio))) + ;;; If you have an external program to play audio add its definition + ;;; in siteinit.scm + diff --git a/audio/festival/core/patches/patch-festival_lib_voices_scm b/audio/festival/core/patches/patch-festival_lib_voices_scm index 18b16ee0c05..8a4fffb16df 100644 --- a/audio/festival/core/patches/patch-festival_lib_voices_scm +++ b/audio/festival/core/patches/patch-festival_lib_voices_scm @@ -1,7 +1,7 @@ -$OpenBSD: patch-festival_lib_voices_scm,v 1.2 2004/08/06 03:36:24 jolan Exp $ ---- festival/lib/voices.scm.orig Sun Jun 27 10:04:07 2004 -+++ festival/lib/voices.scm Wed Aug 4 20:02:41 2004 -@@ -335,6 +335,10 @@ the default voice. [see Site initializat +$OpenBSD: patch-festival_lib_voices_scm,v 1.3 2010/04/26 01:32:38 jakemsr Exp $ +--- festival/lib/voices.scm.orig Sun Jun 27 08:04:07 2004 ++++ festival/lib/voices.scm Sat Apr 24 03:35:28 2010 +@@ -335,6 +335,10 @@ the default voice. [see Site initialization]") ked_diphone don_diphone rab_diphone diff --git a/audio/festival/core/patches/patch-festival_src_main_Makefile b/audio/festival/core/patches/patch-festival_src_main_Makefile deleted file mode 100644 index 7617420300b..00000000000 --- a/audio/festival/core/patches/patch-festival_src_main_Makefile +++ /dev/null @@ -1,20 +0,0 @@ -$OpenBSD: patch-festival_src_main_Makefile,v 1.1 2004/07/11 06:27:07 jolan Exp $ ---- festival/src/main/Makefile.orig 2001-04-04 06:55:20.000000000 -0500 -+++ festival/src/main/Makefile 2004-05-06 10:34:54.000000000 -0500 -@@ -50,13 +50,13 @@ include $(EST)/config/rules/bin_process. - ETCDIR=$(TOP)/lib/etc/$(SYSTEM_TYPE) - - festival: festival_main.o $(LIBDEPS) -- $(LINK_COMMAND) -o festival festival_main.o $(LIBS) -+ $(LINK_COMMAND) -o festival festival_main.o $(LIBS) -lossaudio - - festival_client: festival_client.o $(REQUIRED_LIBDEPS) -- $(LINK_COMMAND) -o festival_client festival_client.o $(LIBS) -+ $(LINK_COMMAND) -o festival_client festival_client.o $(LIBS) -lossaudio - - $(ETCDIR)/audsp: $(ETCDIR)/.made audsp.o $(LIBDEPS) -- $(LINK_COMMAND) -o $(ETCDIR)/audsp audsp.o $(LIBS) -+ $(LINK_COMMAND) -o $(ETCDIR)/audsp audsp.o $(LIBS) -lossaudio - - # Can't just rely on the dir as it gets updated with new files - # check for the data of a file created in etcdir diff --git a/audio/festival/core/patches/patch-speech_tools_audio_Makefile b/audio/festival/core/patches/patch-speech_tools_audio_Makefile new file mode 100644 index 00000000000..e135c86d6ea --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_audio_Makefile @@ -0,0 +1,12 @@ +$OpenBSD: patch-speech_tools_audio_Makefile,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/audio/Makefile.orig Wed Apr 21 19:21:55 2010 ++++ speech_tools/audio/Makefile Wed Apr 21 19:22:12 2010 +@@ -43,7 +43,7 @@ LOCAL_DEFAULT_LIBRARY = estbase + + H = audioP.h + CPPSRCS = gen_audio.cc nas.cc esd.cc sun16audio.cc voxware.cc \ +- mplayer.cc win32audio.cc irixaudio.cc os2audio.cc ++ mplayer.cc win32audio.cc irixaudio.cc os2audio.cc sndio.cc + SRCS = $(CPPSRCS) + OBJS = $(CPPSRCS:.cc=.o) + FILES = $(CPPSRCS) $(H) Makefile diff --git a/audio/festival/core/patches/patch-speech_tools_audio_audioP_h b/audio/festival/core/patches/patch-speech_tools_audio_audioP_h new file mode 100644 index 00000000000..20dc47047db --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_audio_audioP_h @@ -0,0 +1,18 @@ +$OpenBSD: patch-speech_tools_audio_audioP_h,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/audio/audioP.h.orig Sat Apr 24 04:27:45 2010 ++++ speech_tools/audio/audioP.h Sat Apr 24 04:28:17 2010 +@@ -43,6 +43,7 @@ int play_nas_wave(EST_Wave &inwave, EST_Option &al); + int play_esd_wave(EST_Wave &inwave, EST_Option &al); + int play_sun16_wave(EST_Wave &inwave, EST_Option &al); + int play_voxware_wave(EST_Wave &inwave, EST_Option &al); ++int play_sndio_wave(EST_Wave &inwave, EST_Option &al); + int play_mplayer_wave(EST_Wave &inwave, EST_Option &al); + int play_win32audio_wave(EST_Wave &inwave, EST_Option &al); + int play_irix_wave(EST_Wave &inwave, EST_Option &al); +@@ -51,5 +52,6 @@ int record_nas_wave(EST_Wave &inwave, EST_Option &al); + int record_esd_wave(EST_Wave &inwave, EST_Option &al); + int record_sun16_wave(EST_Wave &inwave, EST_Option &al); + int record_voxware_wave(EST_Wave &inwave, EST_Option &al); ++int record_sndio_wave(EST_Wave &inwave, EST_Option &al); + + #endif /* __AUDIOP_H__ */ diff --git a/audio/festival/core/patches/patch-speech_tools_audio_gen_audio_cc b/audio/festival/core/patches/patch-speech_tools_audio_gen_audio_cc new file mode 100644 index 00000000000..f1a3e4162dd --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_audio_gen_audio_cc @@ -0,0 +1,48 @@ +$OpenBSD: patch-speech_tools_audio_gen_audio_cc,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/audio/gen_audio.cc.orig Fri Apr 30 09:56:49 2004 ++++ speech_tools/audio/gen_audio.cc Sat Apr 24 18:40:17 2010 +@@ -103,6 +103,8 @@ int play_wave(EST_Wave &inwave, EST_Option &al) + protocol = "win32audio"; + else if (mplayer_supported) + protocol = "mplayeraudio"; ++ else if (sndio_supported) ++ protocol = "sndioaudio"; + else + protocol = "sunaudio"; + } +@@ -118,6 +120,8 @@ int play_wave(EST_Wave &inwave, EST_Option &al) + else if ((upcase(protocol) == "FREEBSD16AUDIO") || + (upcase(protocol) == "LINUX16AUDIO")) + return play_voxware_wave(*toplay,al); ++ else if (upcase(protocol) == "SNDIOAUDIO") ++ return play_sndio_wave(*toplay,al); + else if (upcase(protocol) == "IRIXAUDIO") + return play_irix_wave(*toplay,al); + else if (upcase(protocol) == "MPLAYERAUDIO") +@@ -256,6 +260,8 @@ EST_String options_supported_audio(void) + audios += " win32audio"; + if (os2audio_supported) + audios += " os2audio"; ++ if (sndio_supported) ++ audios += " sndioaudio"; + + return audios; + } +@@ -294,6 +300,8 @@ int record_wave(EST_Wave &wave, EST_Option &al) + protocol = "win32audio"; + else if (mplayer_supported) + protocol = "mplayeraudio"; ++ else if (sndio_supported) ++ protocol = "sndioaudio"; + else + protocol = "sunaudio"; + } +@@ -307,6 +315,8 @@ int record_wave(EST_Wave &wave, EST_Option &al) + else if ((upcase(protocol) == "FREEBSD16AUDIO") || + (upcase(protocol) == "LINUX16AUDIO")) + return record_voxware_wave(wave,al); ++ else if (upcase(protocol) == "SNDIOAUDIO") ++ return record_sndio_wave(wave,al); + else if (upcase(protocol) == "SUNAUDIO") + return record_sunau_wave(wave,al); + else diff --git a/audio/festival/core/patches/patch-speech_tools_audio_voxware_cc b/audio/festival/core/patches/patch-speech_tools_audio_voxware_cc deleted file mode 100644 index 79f3875112d..00000000000 --- a/audio/festival/core/patches/patch-speech_tools_audio_voxware_cc +++ /dev/null @@ -1,35 +0,0 @@ -$OpenBSD: patch-speech_tools_audio_voxware_cc,v 1.4 2005/10/26 02:45:23 jolan Exp $ ---- speech_tools/audio/voxware.cc.orig Fri Apr 30 11:56:49 2004 -+++ speech_tools/audio/voxware.cc Wed Aug 4 20:05:58 2004 -@@ -61,11 +61,12 @@ - #include "EST_error.h" - - #ifdef SUPPORT_FREEBSD16 --#include -+#include - #include - int freebsd16_supported = TRUE; - int linux16_supported = FALSE; - static char *aud_sys_name = "FreeBSD"; -+static int stereo_only = 0; - #endif - - #ifdef SUPPORT_LINUX16 -@@ -157,7 +158,7 @@ int play_voxware_wave(EST_Wave &inwave, - if (al.present("-audiodevice")) - audiodevice = al.val("-audiodevice"); - else -- audiodevice = "/dev/dsp"; -+ audiodevice = "/dev/audio"; - - if ((audio = open(audiodevice,O_WRONLY)) == -1) - { -@@ -284,7 +285,7 @@ int record_voxware_wave(EST_Wave &inwave - if (al.present("-audiodevice")) - audiodevice = al.val("-audiodevice"); - else -- audiodevice = "/dev/dsp"; -+ audiodevice = "/dev/audio"; - - sample_rate = al.ival("-sample_rate"); - diff --git a/audio/festival/core/patches/patch-speech_tools_config_modules_Makefile b/audio/festival/core/patches/patch-speech_tools_config_modules_Makefile new file mode 100644 index 00000000000..67b2b2c6996 --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_config_modules_Makefile @@ -0,0 +1,12 @@ +$OpenBSD: patch-speech_tools_config_modules_Makefile,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/config/modules/Makefile.orig Sat Apr 24 03:21:12 2010 ++++ speech_tools/config/modules/Makefile Sat Apr 24 03:21:28 2010 +@@ -41,7 +41,7 @@ RULESETS = efence.mak dmalloc.mak debugging.mak \ + psola_tm.mak editline.mak tcl.mak \ + freebsd16_audio.mak irix_audio.mak linux16_audio.mak \ + sun16_audio.mak win32_audio.mak \ +- mplayer_audio.mak nas_audio.mak esd_audio.mak ++ mplayer_audio.mak nas_audio.mak esd_audio.mak sndio_audio.mak + + FILES = Makefile descriptions $(RULESETS) + diff --git a/audio/festival/core/patches/patch-speech_tools_config_modules_freebsd16_audio_mak b/audio/festival/core/patches/patch-speech_tools_config_modules_freebsd16_audio_mak deleted file mode 100644 index c8b81142244..00000000000 --- a/audio/festival/core/patches/patch-speech_tools_config_modules_freebsd16_audio_mak +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-speech_tools_config_modules_freebsd16_audio_mak,v 1.1 2004/07/11 06:27:07 jolan Exp $ ---- speech_tools/config/modules/freebsd16_audio.mak.orig 2001-04-04 08:11:27.000000000 -0500 -+++ speech_tools/config/modules/freebsd16_audio.mak 2004-05-06 10:14:35.000000000 -0500 -@@ -44,6 +44,8 @@ MOD_DESC_FREEBSD16_AUDIO=Native audio mo - - AUDIO_DEFINES += -DSUPPORT_FREEBSD16 - -+MODULE_EXTRA_LIBS= -lossaudio -+ - #ifdef INCLUDE_JAVA_CPP - # AUDIO_DEFINES += -DTHREAD_SAFETY - # MODULE_LIBS += -lpthread diff --git a/audio/festival/core/patches/patch-speech_tools_include_EST_audio_h b/audio/festival/core/patches/patch-speech_tools_include_EST_audio_h new file mode 100644 index 00000000000..bd944add957 --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_include_EST_audio_h @@ -0,0 +1,11 @@ +$OpenBSD: patch-speech_tools_include_EST_audio_h,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/include/EST_audio.h.orig Sat Apr 24 04:30:41 2010 ++++ speech_tools/include/EST_audio.h Sat Apr 24 04:30:56 2010 +@@ -46,6 +46,7 @@ extern int nas_supported; + extern int esd_supported; + extern int sun16_supported; + extern int freebsd16_supported; ++extern int sndio_supported; + extern int linux16_supported; + extern int mplayer_supported; + extern int win32audio_supported; diff --git a/audio/festival/core/patches/patch-speech_tools_lib_siod_init_scm b/audio/festival/core/patches/patch-speech_tools_lib_siod_init_scm new file mode 100644 index 00000000000..6d5e113768a --- /dev/null +++ b/audio/festival/core/patches/patch-speech_tools_lib_siod_init_scm @@ -0,0 +1,16 @@ +$OpenBSD: patch-speech_tools_lib_siod_init_scm,v 1.1 2010/04/26 01:32:38 jakemsr Exp $ +--- speech_tools/lib/siod/init.scm.orig Sat Apr 24 18:23:13 2010 ++++ speech_tools/lib/siod/init.scm Sat Apr 24 18:33:03 2010 +@@ -76,8 +76,10 @@ + (Parameter.def 'Audio_Method 'os2audio)) + ((member 'mplayeraudio *modules*) + (Parameter.def 'Audio_Method 'mplayeraudio)) +- (t ;; can't find direct support so guess that /dev/audio for 8k ulaw exists +- (Parameter.def 'Audio_Method 'sunaudio))) ++ ((member 'sndioaudio *modules*) ++ (Parameter.def 'Audio_Method 'sndioaudio)) ++ (t ;; stupid crappy software. default to only supported "protocol" ++ (Parameter.def 'Audio_Method 'sndioaudio))) + + ;;; If you have an external program to play audio add its definition + ;;; in siteinit.scm diff --git a/audio/festival/core/pkg/PLIST b/audio/festival/core/pkg/PLIST index 6e675ac2759..d9b9cf81bcf 100644 --- a/audio/festival/core/pkg/PLIST +++ b/audio/festival/core/pkg/PLIST @@ -1,7 +1,7 @@ -@comment $OpenBSD: PLIST,v 1.2 2004/08/06 03:36:24 jolan Exp $ -bin/audsp -bin/festival -bin/festival_client +@comment $OpenBSD: PLIST,v 1.3 2010/04/26 01:32:38 jakemsr Exp $ +@bin bin/audsp +@bin bin/festival +@bin bin/festival_client bin/festival_server bin/festival_server_control bin/text2wave