sndio supported as default audio output method
ok jolan@ (MAINTAINER)
This commit is contained in:
parent
5543d474aa
commit
d095622dbe
@ -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}
|
||||
|
@ -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
|
||||
|
371
audio/festival/core/files/sndio.cc
Normal file
371
audio/festival/core/files/sndio.cc
Normal file
@ -0,0 +1,371 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Jacob Meuser <jakemsr@sdf.lonestar.org>
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#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 <sndio.h>
|
||||
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 <signal.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#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
|
8
audio/festival/core/files/sndio_audio.mak
Normal file
8
audio/festival/core/files/sndio_audio.mak
Normal file
@ -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
|
@ -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
|
||||
|
16
audio/festival/core/patches/patch-festival_lib_init_scm
Normal file
16
audio/festival/core/patches/patch-festival_lib_init_scm
Normal file
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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
|
@ -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__ */
|
@ -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
|
@ -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 <machine/soundcard.h>
|
||||
+#include <soundcard.h>
|
||||
#include <fcntl.h>
|
||||
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");
|
||||
|
@ -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)
|
||||
|
@ -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
|
@ -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;
|
@ -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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user