--- recite-1.0.orig/Makefile +++ recite-1.0/Makefile @@ -1,27 +1,28 @@ # # extra includes required for your system # -# H = -H = -I/usr/demo/SOUND +H = -I- +# H = -I/usr/demo/SOUND # # the name of the compiler to use # -CC = cc -# CC = gcc +# CC = cc +CC = gcc # # The compiler flags to use, except for include path. # -CFLAGS = -O +# CFLAGS = -O # CFLAGS = -g # CFLAGS = -O -Wall -ansi # gcc +CFLAGS = -O2 -g -Wall # # extra libraries required for your system # -# LIBRARIES = -LIBRARIES = -L/usr/demo/SOUND -laudio +LIBRARIES = +# LIBRARIES = -L/usr/demo/SOUND -laudio # You should not need to alter anything below this point. #------------------------------------------------------------ @@ -34,6 +35,11 @@ $(CC) $(CFLAGS) -Iaudio -Icommon $(H) -c audio/audio.c mv audio.o audio +audio/linuxaudio.o: audio/linuxaudio.c audio/audio.h common/main.h \ + common/error.h common/mem.h + $(CC) $(CFLAGS) -Iaudio -Icommon $(H) -c audio/linuxaudio.c + mv linuxaudio.o audio + common/ansi.o: common/ansi.c common/main.h $(CC) $(CFLAGS) -Icommon -Icommon $(H) -c common/ansi.c mv ansi.o common @@ -182,7 +188,7 @@ t0003a: all test/00/t0003a.sh sh test/00/t0003a.sh -ReciteObj = audio/audio.o common/ansi.o common/arglex.o common/error.o \ +ReciteObj = audio/linuxaudio.o common/arglex.o common/error.o \ common/frame.o common/help.o common/mem.o \ common/trace.o common/version.o english/english.o \ english/phoneme.o english/rules.o english/saynum.o \ @@ -193,14 +199,14 @@ phonemes/vowel.o recite/file.o recite/main.o bin/recite: $(ReciteObj) - -mkdir bin + -mkdir -p bin $(CC) -o bin/recite $(ReciteObj) $(LIBRARIES) -lm sure: t0001a t0002a t0003a @echo Passed All Tests clean: - rm -f core audio/audio.o common/ansi.o common/arglex.o \ + rm -f core audio/audio.o audio/linuxaudio.o common/arglex.o \ common/error.o common/frame.o common/help.o \ common/mem.o common/trace.o common/version.o \ english/english.o english/phoneme.o english/rules.o \ --- recite-1.0.orig/audio/audio.c +++ recite-1.0/audio/audio.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include "audio.h" +#include "error.h" +#include "mem.h" static double volume; --- recite-1.0.orig/audio/audio.h +++ recite-1.0/audio/audio.h @@ -23,7 +23,7 @@ #ifndef AUDIO_H #define AUDIO_H -#include +#include "main.h" void ulaw_play _((int spkr_or_jack, char *data, long datalen)); void ulaw_volume _((double)); --- recite-1.0.orig/audio/linuxaudio.c +++ recite-1.0/audio/linuxaudio.c @@ -0,0 +1,226 @@ +/* + * recite - english text speech synthesizer + * Copyright (C) 1993 Peter Miller. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * MANIFEST: functions to use workstation's speaker + * + * Portions of this file are derived from a program + * by H.F. Silverman (Jan-91) and A. Smith (Feb-91), + * no copyright notice present. + * + * Modified for Linux/OSS Tue 15 Dec 1998 + * by Charles Briscoe-Smith + * + * Modified for OSS buffering issues Thu 27 Mar 2003 + * by Sam Hocevar + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "audio.h" +#include "error.h" +#include "mem.h" + + +static double volume; + + +void +ulaw_volume(n) + double n; +{ + volume = n; +} + + +void +ulaw_read(filename, data_p, datalen_p) + char *filename; + char **data_p; + long *datalen_p; +{ + int fd; + char *data; + size_t data_max; + size_t datalen; + + /* + * open the file + */ + if (filename) + { + fd = open(filename, O_RDONLY, 0666); + if (fd < 0) + nfatal("could not open \"%s\"", filename); + } + else + { + fd = 0; + filename = "(standard input)"; + } + + /* + * read the data + */ + data_max = (1L << 18); + data = mem_alloc(data_max); + datalen = 0; + for (;;) + { + long rsize; + long nbytes; + + if (datalen >= data_max) + { + rsize = (1L << 18); + data_max += rsize; + mem_change_size(&data, data_max); + } + else + rsize = data_max - datalen; + nbytes = read(fd, data + datalen, rsize); + if (nbytes < 0) + nfatal("could not read from \"%s\"", filename); + if (!nbytes) + break; + datalen += nbytes; + } + if (datalen < data_max) + mem_change_size(&data, datalen); + *data_p = data; + *datalen_p = datalen; + + /* + * close the file + */ + if (close(fd)) + nfatal("could not close \"%s\"", filename); +} + + +void +ulaw_write(filename, data, datalen) + char *filename; + char *data; + long datalen; +{ + int fd; + + if (filename) + { + fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (fd < 0) + nfatal("could not create \"%s\"", filename); + } + else + { + fd = 1; + filename = "(standard output)"; + } + + if (write(fd, data, datalen) < 0) + nfatal("could not write to \"%s\"", filename); + + if (close(fd)) + nfatal("could not close \"%s\"", filename); +} + + +void +ulaw_play(jack, data, datalen) + int jack; + char *data; + long datalen; +{ + int i; + int err; + char *Audio_dev = "/dev/dsp"; + int fd; /* file descriptor for audio device */ + audio_buf_info info; /* audio device buffer info */ + int empty_bytes; /* available bytes in the device */ + + /* + * Try it quickly, first + */ + fd = open(Audio_dev, O_WRONLY | O_NDELAY, 0666); +#if 1 + if (fd < 0 && errno == EBUSY) + { + error("waiting for %s", Audio_dev); + fd = open(Audio_dev, O_WRONLY, 0666); + } +#endif + if (fd < 0) + nfatal("could not open \"%s\"", Audio_dev); + + /* Remember how many available bytes we have when the buffer is empty */ + if(ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0) + empty_bytes = info.bytes; + else + empty_bytes = -1; + + while (datalen > 0) + { + fd_set fdset; + struct timeval timeout; + + /* Wait for device to become available */ + FD_ZERO(&fdset); + FD_SET(fd, &fdset); + timeout.tv_sec = 2; + timeout.tv_usec = 0; + if(select(fd+1, NULL, &fdset, NULL, &timeout) <= 0) + nfatal("audio device \"%s\" is unavailable, check " + "that no other program is using it", Audio_dev); + + /* Write to device */ + err = write(fd, data, datalen); + if (err == -1) + { + if(errno != EAGAIN) + nfatal("could not write to \"%s\"", Audio_dev); + + /* Duh, looks like it wasn't really available */ + usleep(10000); + err = 0; + } + datalen -= err; + data += err; + } + + /* Wait for the samples to be played before closing the device, but + * not more than 2 seconds (40 * 50000 µs). */ + for(i = 0; i < 40; i++) + { + if(empty_bytes >= 0 && + ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0 && + info.bytes >= empty_bytes) + break; + usleep(50000); + } + + close(fd); +} --- recite-1.0.orig/common/ansi.c +++ recite-1.0/common/ansi.c @@ -6,14 +6,14 @@ * to implement absent ANSI functionality. */ -#if 1 /* ndef __STDC__ */ +#if 0 /* ndef __STDC__ */ #include #include #include #include -#include +#include "main.h" /* --- recite-1.0.orig/common/arglex.c +++ recite-1.0/common/arglex.c @@ -26,10 +26,10 @@ #include #include -#include -#include -#include -#include +#include "main.h" +#include "arglex.h" +#include "error.h" +#include "mem.h" static arglex_table_t table[] = --- recite-1.0.orig/common/arglex.h +++ recite-1.0/common/arglex.h @@ -23,7 +23,7 @@ #ifndef ARGLEX_H #define ARGLEX_H -#include +#include "main.h" typedef enum arglex_token_t arglex_token_t; enum arglex_token_t --- recite-1.0.orig/common/error.c +++ recite-1.0/common/error.c @@ -23,14 +23,14 @@ #include #include #include -#include +#include "s-v-arg.h" #include #include #include -#include -#include -#include +#include "main.h" +#include "error.h" +#include "arglex.h" static char *huge_buffer; @@ -288,8 +288,11 @@ sva_init(ap, s); vsprintf(huge_buffer, s, ap); va_end(ap); - strcat(huge_buffer, ": "); - strcat(huge_buffer, strerror(n)); + if (n) + { + strcat(huge_buffer, ": "); + strcat(huge_buffer, strerror(n)); + } wrap(huge_buffer); } @@ -330,8 +333,11 @@ sva_init(ap, s); vsprintf(huge_buffer, s, ap); va_end(ap); - strcat(huge_buffer, ": "); - strcat(huge_buffer, strerror(n)); + if (n) + { + strcat(huge_buffer, ": "); + strcat(huge_buffer, strerror(n)); + } wrap(huge_buffer); exit(1); } --- recite-1.0.orig/common/error.h +++ recite-1.0/common/error.h @@ -23,7 +23,7 @@ #ifndef ERROR_H #define ERROR_H -#include +#include "main.h" void error _((char *, ...)); void fatal _((char *, ...)); --- recite-1.0.orig/common/frame.c +++ recite-1.0/common/frame.c @@ -22,9 +22,9 @@ #include -#include -#include -#include +#include "error.h" +#include "frame.h" +#include "mem.h" static frame_ty *list; --- recite-1.0.orig/common/frame.h +++ recite-1.0/common/frame.h @@ -23,7 +23,7 @@ #ifndef FRAME_H #define FRAME_H -#include +#include "main.h" typedef struct frame_ty frame_ty; struct frame_ty --- recite-1.0.orig/common/help.c +++ recite-1.0/common/help.c @@ -25,10 +25,10 @@ #include #include -#include -#include -#include -#include +#include "arglex.h" +#include "error.h" +#include "help.h" +#include "patchlevel.h" int isatty _((int)); --- recite-1.0.orig/common/help.h +++ recite-1.0/common/help.h @@ -23,7 +23,7 @@ #ifndef HELP_H #define HELP_H -#include +#include "main.h" void help _((char **text, int text_lem, void (*usage)(void))); char *version_stamp _((void)); --- recite-1.0.orig/common/mem.c +++ recite-1.0/common/mem.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include "mem.h" +#include "error.h" /* --- recite-1.0.orig/common/mem.h +++ recite-1.0/common/mem.h @@ -24,7 +24,7 @@ #define MEM_H #include -#include +#include "main.h" char *enlarge _((size_t *, char **, size_t)); char *mem_alloc _((size_t)); --- recite-1.0.orig/common/trace.c +++ recite-1.0/common/trace.c @@ -19,14 +19,14 @@ */ #include -#include +#include "s-v-arg.h" #include #include -#include -#include -#include -#include +#include "error.h" +#include "mem.h" +#include "arglex.h" +#include "trace.h" #define INDENT 2 #define PAGE_WIDTH 79 --- recite-1.0.orig/common/trace.h +++ recite-1.0/common/trace.h @@ -25,7 +25,7 @@ #include -#include +#include "main.h" #ifdef DEBUG #define trace_pretest_ \ --- recite-1.0.orig/common/version.c +++ recite-1.0/common/version.c @@ -24,11 +24,11 @@ #include #include -#include -#include -#include -#include -#include +#include "arglex.h" +#include "error.h" +#include "help.h" +#include "version.h" +#include "mem.h" static void version_copyright _((void)); --- recite-1.0.orig/common/version.h +++ recite-1.0/common/version.h @@ -23,7 +23,7 @@ #ifndef VERSION_H #define VERSION_H -#include +#include "main.h" void version _((void)); --- recite-1.0.orig/debian/changelog +++ recite-1.0/debian/changelog @@ -0,0 +1,120 @@ +recite (1.0-8.2ubuntu1) xenial; urgency=medium + + * debian/compat: Change compatibility level to 9. + * debian/control: + - Build-depend on debhelper (>= 9). + - Depend on ${misc:Depends}. + * debian/rules: + - Use dh_prep instead of dh_clean -k. + - Add recommended build-arch and build-indep targets. + + -- Logan Rosen Sun, 27 Mar 2016 21:47:36 -0500 + +recite (1.0-8.2) unstable; urgency=medium + + * Non-maintainer upload. + * Real fix for segfaults on out-of-bounds. (Closes: #504905). + + Thanks to Peter De Wachter for the patch. + + -- Barry deFreese Tue, 11 Nov 2008 11:14:24 -0500 + +recite (1.0-8.1) unstable; urgency=medium + + * Non-maintainer upload. + + With permission from maintainer. + * klatt/parwave.c: Check upper bound on DBtoLIN. (Closes: #504200). + + Not a real solution but exits more gracefully. + + Thanks to Emmet Hikory for the help. + * Priority medium for RC bug fix. + * Escape hyphens in manpage. + * debian/copyright: Add Copyright holder. + + Update FSF address. + * Bump Standards Version to 3.8.0. (No changes needed). + + -- Barry deFreese Thu, 06 Nov 2008 15:23:30 -0500 + +recite (1.0-8) unstable; urgency=low + + * Makefile: + + Dropped the -ansi flag because we use non-ansi functions such as popen + or usleep (Closes: #226556). + * recite/main.c: + + Added a missing #include . + + -- Sam Hocevar (Debian packages) Wed, 7 Jan 2004 11:42:44 +0100 + +recite (1.0-7) unstable; urgency=low + + * audio/linuxaudio.c: + + Changed audio buffer size detection. We no longer test that info.bytes + reaches the total capacity, but just that it reached the value it had + upon initialization (Closes: #219707). Thanks to PJ for helping me debug this. + + -- Sam Hocevar (Debian packages) Mon, 10 Nov 2003 16:45:08 +0100 + +recite (1.0-6) unstable; urgency=low + + * debian/control: + + Set policy to 3.6.1.0. + + Minor enhancements to the package descriptions. + * debian/rules: + + Use debian/compat instead of DH_COMPAT. + * audio/linuxaudio.c recite/file.c: + + More meaningful error messages (Closes: #214822). + * common/error.c: + + Only print strerror(errno) if errno is non-null (Closes: #214822). + + -- Sam Hocevar (Debian packages) Sat, 11 Oct 2003 16:07:12 +0200 + +recite (1.0-5) unstable; urgency=low + + * Set policy to 3.5.10. + + -- Sam Hocevar (Debian packages) Sat, 31 May 2003 00:46:37 +0200 + +recite (1.0-4) unstable; urgency=low + + * New maintainer. + * Policy set to 3.5.9.0. + * Changed packaging to use debhelper instead of yada, diff.gz is now 7k + instead of 27k. + * Removed most compilation warnings. + * Applied a user-contributed fix to avoid problems whith decreasing + quality when playing long texts (Closes: #35197, #44433). + * Fixed the audio output so that recite does not abort when the /dev/dsp + buffer is full (fixes playback of long texts). + * Fixed the audio output so that recite does not close /dev/dsp too early + (fixes playback of short texts). + + -- Samuel Hocevar Sat, 29 Mar 2003 05:27:12 +0100 + +recite (1.0-3) unstable; urgency=low + + * Maintainer set to QA group. + * Policy set to 3.5.8 + * yada modified to remove /usr/doc link. + * forced again debian/yada to be executable. + + -- Francesco Paolo Lovergine Mon, 13 Jan 2003 23:16:05 +0100 + +recite (1.0-2.1) unstable; urgency=low + + * NMU + * Updated yada version. Closes: #91037, #91637, #92623. + * Force debian/yada to be executable. + + -- Roland Bauerschmidt Tue, 3 Jul 2001 23:53:30 +0200 + +recite (1.0-2) unstable; urgency=low + + * Changed packaging to use yada. + + -- Charles Briscoe-Smith Wed, 9 Jun 1999 12:02:04 +0100 + +recite (1.0-1) unstable; urgency=low + + * First Debian release. + * Ported (rather approximately) to Linux. + + -- Charles Briscoe-Smith Mon, 14 Dec 1998 21:40:34 +0000 --- recite-1.0.orig/debian/compat +++ recite-1.0/debian/compat @@ -0,0 +1 @@ +9 --- recite-1.0.orig/debian/control +++ recite-1.0/debian/control @@ -0,0 +1,22 @@ +Source: recite +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Sam Hocevar (Debian packages) +Section: sound +Priority: optional +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 9) + +Package: recite +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: English text speech synthesizer + Recite is a program to do speech synthesis. The quality of sound + produced is not terribly good, but it should be adequate for reporting + the occasional error message verbally. + . + Given some English text, recite will convert it to a series of phonemes, + then convert the phonemes to a sequence of vocal tract parameters, and + then synthesise the sound a vocal tract would make to say the sentence. + Recite can perform a subset of these operations, so it can be used to + convert text into phonemes, or to produce an utterance based on vocal + tract parameters computed by another program. --- recite-1.0.orig/debian/copyright +++ recite-1.0/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Charles Briscoe-Smith +using files from +and was later modified by Sam Hocevar to use debhelper +instead of yada. + +Upstream Author: Peter Miller + +Copyright: Copyright (C) 1993 Peter Miller + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation Inc., 51 Franklin St, Fifth Floor, Boston, +MA 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- recite-1.0.orig/debian/dirs +++ recite-1.0/debian/dirs @@ -0,0 +1,3 @@ +/usr/share/doc/recite +/usr/share/man/man1 +/usr/bin --- recite-1.0.orig/debian/rules +++ recite-1.0/debian/rules @@ -0,0 +1,70 @@ +#!/usr/bin/make -f +# debian/rules for recite - uses debhelper. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + -$(MAKE) clobber + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + cp bin/recite debian/recite/usr/bin/ + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install +# dh_testversion + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs MANIFEST README +# dh_installexamples +# dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit +# dh_installcron + dh_installman man1/recite.1 +# dh_installinfo +# dh_undocumented + dh_installchangelogs CHANGES + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install + --- recite-1.0.orig/english/english.c +++ recite-1.0/english/english.c @@ -21,13 +21,14 @@ */ #include +#include -#include -#include -#include -#include -#include -#include +#include "english.h" +#include "mem.h" +#include "phoneme.h" +#include "spellword.h" +#include "saynum.h" +#include "trace.h" #define THE_END -1 --- recite-1.0.orig/english/english.h +++ recite-1.0/english/english.h @@ -23,7 +23,7 @@ #ifndef ENGLISH_H #define ENGLISH_H -#include +#include "main.h" void english_to_phonemes _((char *in, long inlen, char **out, long *outlen)); --- recite-1.0.orig/english/phoneme.c +++ recite-1.0/english/phoneme.c @@ -27,10 +27,11 @@ #define FALSE (0) #define TRUE (!0) -#include -#include -#include -#include +#include "english.h" +#include "phoneme.h" +#include "rules.h" +#include "trace.h" +#include "../common/error.h" /* * English to Phoneme translation. @@ -115,6 +116,7 @@ { /* First check for simple text or space */ if (isalpha(*pat) || *pat == '\'' || *pat == ' ') + { if (*pat != *text) return FALSE; else @@ -122,6 +124,7 @@ text--; continue; } + } switch (*pat) { @@ -240,6 +243,7 @@ { /* First check for simple text or space */ if (isalpha(*pat) || *pat == '\'' || *pat == ' ') + { if (*pat != *text) return FALSE; else @@ -247,6 +251,7 @@ text++; continue; } + } switch (*pat) { --- recite-1.0.orig/english/phoneme.h +++ recite-1.0/english/phoneme.h @@ -23,7 +23,7 @@ #ifndef PHONEME_H #define PHONEME_H -#include +#include "main.h" void xlate_word _((char *)); --- recite-1.0.orig/english/rules.c +++ recite-1.0/english/rules.c @@ -148,7 +148,7 @@ * */ -#include +#include "rules.h" /* Context definitions */ static char Anything[] = ""; /* No context requirement */ --- recite-1.0.orig/english/rules.h +++ recite-1.0/english/rules.h @@ -23,7 +23,7 @@ #ifndef RULES_H #define RULES_H -#include +#include "main.h" typedef struct rule_t rule_t; struct rule_t --- recite-1.0.orig/english/saynum.c +++ recite-1.0/english/saynum.c @@ -1,6 +1,6 @@ -#include -#include +#include "phoneme.h" +#include "saynum.h" /* * Integer to Readable ASCII Conversion Routine. --- recite-1.0.orig/english/saynum.h +++ recite-1.0/english/saynum.h @@ -23,7 +23,7 @@ #ifndef SAYNUM_H #define SAYNUM_H -#include +#include "main.h" void say_ordinal _((long)); void say_cardinal _((long)); --- recite-1.0.orig/english/spellword.c +++ recite-1.0/english/spellword.c @@ -1,7 +1,7 @@ #include -#include -#include +#include "spellword.h" +#include "english.h" static char *Ascii[] = { --- recite-1.0.orig/english/spellword.h +++ recite-1.0/english/spellword.h @@ -23,7 +23,7 @@ #ifndef SPELLWORD_H #define SPELLWORD_H -#include +#include "main.h" void say_ascii _((int)); void spell_word _((char *)); --- recite-1.0.orig/klatt/klatt.c +++ recite-1.0/klatt/klatt.c @@ -23,13 +23,15 @@ * dated 25 July 1987, L. Goldstein, S. Levy */ +#if 0 #include +#endif -#include -#include -#include -#include -#include +#include "frame.h" +#include "klatt.h" +#include "mem.h" +#include "parwave.h" +#include "trace.h" static unsigned char *playbuf_data; @@ -238,7 +240,7 @@ { parwav(&par_array[icount], iwave); for (isam = 0; isam < NSAMP_PER_FRAME; ++isam) - playbuf(audio_s2u(iwave[isam])); + playbuf((iwave[isam] >> 8)+128); data_exist = 1; totsam = ibuf; } --- recite-1.0.orig/klatt/klatt.h +++ recite-1.0/klatt/klatt.h @@ -23,7 +23,7 @@ #ifndef KLATT_H #define KLATT_H -#include +#include "main.h" void klatt_to_ulaw _((char *in, long inlen, char **out, long *outlen)); --- recite-1.0.orig/klatt/parwave.c +++ recite-1.0/klatt/parwave.c @@ -28,10 +28,10 @@ #include -#include -#include -#include -#include +#include "error.h" +#include "parwave.h" +#include "r250.h" +#include "trace.h" /* @@ -576,7 +576,7 @@ /* * Check limits or argument (can be removed in final product) */ - if (dB < 0) + if (dB < 0 || dB > 88) { trace(("Try to compute amptable[%d]\n", dB)); return(0); @@ -1569,6 +1569,7 @@ +#if 0 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* S U B R O U T I N E P R - P A R S */ @@ -1638,6 +1639,7 @@ error("AVpa = %hd", pp->AVpdb); error("G0 = %hd", pp->Gain0); } +#endif static double dBconvert _((long)); --- recite-1.0.orig/klatt/parwave.h +++ recite-1.0/klatt/parwave.h @@ -23,7 +23,7 @@ #ifndef PARWAVE_H #define PARWAVE_H -#include +#include "main.h" #define SAMP_RATE 8000 /* samples/second */ #define N_MSEC_FRAME 10 /* ms/frame */ --- recite-1.0.orig/klatt/r250.c +++ recite-1.0/klatt/r250.c @@ -24,7 +24,10 @@ * Journal of Computational Physics, vol. 40, p. 157 (1981). */ -#include +#include +#include +#include +#include "r250.h" static unsigned long buf[250]; static unsigned long *pos; --- recite-1.0.orig/klatt/r250.h +++ recite-1.0/klatt/r250.h @@ -23,7 +23,7 @@ #ifndef R250_H #define R250_H -#include +#include "main.h" void r250_init _((void)); unsigned long r250 _((void)); --- recite-1.0.orig/man1/recite.1 +++ recite-1.0/man1/recite.1 @@ -110,10 +110,10 @@ The .I recite program comes with ABSOLUTELY NO WARRANTY; -for details use the '\fIrecite -VERSion Warranty\fP' command. +for details use the '\fIrecite \-VERSion Warranty\fP' command. This is free software and you are welcome to redistribute it under certain conditions; -for details use the '\fIrecite -VERSion Redistribution\fP' command. +for details use the '\fIrecite \-VERSion Redistribution\fP' command. .br .ne 1i .SH AUTHOR --- recite-1.0.orig/phonemes/features.c +++ recite-1.0/phonemes/features.c @@ -1,4 +1,5 @@ -#include +#include +#include "features.h" int InhDur[ALL_END + 1] = { --- recite-1.0.orig/phonemes/features.h +++ recite-1.0/phonemes/features.h @@ -23,7 +23,7 @@ #ifndef FEATURES_H #define FEATURES_H -#include +#include "frame.h" #define VOWEL_TYPE 0 #define SONORANT_TYPE 1 --- recite-1.0.orig/phonemes/fricatives.c +++ recite-1.0/phonemes/fricatives.c @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include +#include "features.h" +#include "fricatives.h" +#include "rules.h" +#include "trace.h" +#include "var.h" --- recite-1.0.orig/phonemes/fricatives.h +++ recite-1.0/phonemes/fricatives.h @@ -23,7 +23,7 @@ #ifndef FRICATIVES_H #define FRICATIVES_H -#include +#include "main.h" void gen_fricative _((int phone, int segdur, int prev_phone, int next_phone)); --- recite-1.0.orig/phonemes/phonemes.c +++ recite-1.0/phonemes/phonemes.c @@ -23,17 +23,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "error.h" +#include "features.h" +#include "fricatives.h" +#include "mem.h" +#include "phonemes.h" +#include "plosives.h" +#include "rules.h" +#include "sonorants.h" +#include "trace.h" +#include "var.h" +#include "vowel.h" static char *get_byte_data; @@ -268,6 +268,7 @@ } +#if 0 static void gen_pause _((void)); static void @@ -280,6 +281,7 @@ for (k = 0; k < 50; k++) frame_out(&frame); } +#endif /* @@ -565,6 +567,9 @@ i = 0; while (i < syll_count[h]) { + /* reinitialize F0 to avoid drift */ + f0[0] = 1300; + if (i == syll_count[h] - 1 && h == word_count-1) f0_change = -1000; else --- recite-1.0.orig/phonemes/phonemes.h +++ recite-1.0/phonemes/phonemes.h @@ -23,7 +23,7 @@ #ifndef PHONEMES_H #define PHONEMES_H -#include +#include "main.h" void phonemes_to_klatt _((char *in, long inlen, char **out, long *outlen)); --- recite-1.0.orig/phonemes/plosives.c +++ recite-1.0/phonemes/plosives.c @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include "features.h" +#include "plosives.h" +#include "rules.h" +#include "trace.h" +#include "var.h" void --- recite-1.0.orig/phonemes/plosives.h +++ recite-1.0/phonemes/plosives.h @@ -23,7 +23,7 @@ #ifndef PLOSIVES_H #define PLOSIVES_H -#include +#include "main.h" void gen_plosive _((int phone, int segdur, int prev_phone, int next_phone)); --- recite-1.0.orig/phonemes/rules.c +++ recite-1.0/phonemes/rules.c @@ -22,9 +22,9 @@ #include -#include -#include -#include +#include "features.h" +#include "rules.h" +#include "trace.h" void @@ -235,6 +235,11 @@ } if (ph <= FRICATIVES_END) { + *offset = ph - FRICATIVES_START; + return FRICATIVE_TYPE; + } + if (ph <= PLOSIVES_END) + { *offset = ph - PLOSIVES_START; return PLOSIVE_TYPE; } --- recite-1.0.orig/phonemes/rules.h +++ recite-1.0/phonemes/rules.h @@ -23,7 +23,7 @@ #ifndef RULES_H #define RULES_H -#include +#include "main.h" typedef struct segment_ty segment_ty; struct segment_ty --- recite-1.0.orig/phonemes/sonorants.c +++ recite-1.0/phonemes/sonorants.c @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include "features.h" +#include "rules.h" +#include "sonorants.h" +#include "trace.h" +#include "var.h" void --- recite-1.0.orig/phonemes/sonorants.h +++ recite-1.0/phonemes/sonorants.h @@ -23,7 +23,7 @@ #ifndef SONORANTS_H #define SONORANTS_H -#include +#include "main.h" void gen_sonorant _((int phone, int segdur, int prev_phone, int next_phone)); --- recite-1.0.orig/phonemes/var.c +++ recite-1.0/phonemes/var.c @@ -20,7 +20,7 @@ * MANIFEST: variable instances */ -#include +#include "var.h" frame_ty LastTarget; double f0[2]; --- recite-1.0.orig/phonemes/var.h +++ recite-1.0/phonemes/var.h @@ -23,7 +23,7 @@ #ifndef VAR_H #define VAR_H -#include +#include "features.h" extern frame_ty LastTarget; extern double f0[2]; --- recite-1.0.orig/phonemes/vowel.c +++ recite-1.0/phonemes/vowel.c @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include "features.h" +#include "rules.h" +#include "trace.h" +#include "var.h" +#include "vowel.h" void --- recite-1.0.orig/phonemes/vowel.h +++ recite-1.0/phonemes/vowel.h @@ -23,7 +23,7 @@ #ifndef VOWEL_H #define VOWEL_H -#include +#include "main.h" void gen_vowel _((int phone, int segdur, int prev_phone, int next_phone)); #endif /* VOWEL_H */ --- recite-1.0.orig/recite/file.c +++ recite-1.0/recite/file.c @@ -22,9 +22,9 @@ #include -#include -#include -#include +#include "file.h" +#include "error.h" +#include "mem.h" void @@ -47,7 +47,7 @@ { fp = fopen(filename, "rb"); if (!fp) - nfatal("open \"%s\"", filename); + nfatal("could not open \"%s\"", filename); } datalen = (1L << 15); data = mem_alloc(datalen); @@ -60,7 +60,7 @@ if (c == EOF) { if (ferror(fp)) - nfatal("read \"%s\"", filename); + nfatal("could not read from \"%s\"", filename); break; } if (pos >= datalen) @@ -71,7 +71,7 @@ data[pos++] = c; } if (fclose(fp)) - nfatal("close \"%s\"", filename); + nfatal("could not close \"%s\"", filename); if (pos < datalen) { datalen = pos; @@ -99,14 +99,14 @@ { fp = fopen(filename, "wb"); if (!fp) - nfatal("create \"%s\"", filename); + nfatal("could not create \"%s\"", filename); } if (fwrite(data, 1, datalen, fp) != datalen) - nfatal("write \"%s\"", filename); + nfatal("could not write to \"%s\"", filename); if (datalen > 0 && data[datalen - 1] != '\n') fputc('\n', fp); if (fflush(fp)) - nfatal("write \"%s\"", filename); + nfatal("could not write to \"%s\"", filename); if (fclose(fp)) - nfatal("close \"%s\"", filename); + nfatal("could not close \"%s\"", filename); } --- recite-1.0.orig/recite/file.h +++ recite-1.0/recite/file.h @@ -23,7 +23,7 @@ #ifndef FILE_H #define FILE_H -#include +#include "main.h" void file_read _((char *filename, char **data, long *datalen)); void file_write _((char *filename, char *data, long datalen)); --- recite-1.0.orig/recite/main.c +++ recite-1.0/recite/main.c @@ -21,19 +21,21 @@ */ #include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include <../english/english.h> -#include <../phonemes/phonemes.h> -#include <../klatt/klatt.h> -#include <../audio/audio.h> +#include "arglex.h" +#include "error.h" +#include "file.h" +#include "frame.h" +#include "help.h" +#include "mem.h" +#include "trace.h" +#include "version.h" +#include "../english/english.h" +#include "../phonemes/phonemes.h" +#include "../klatt/klatt.h" +#include "../audio/audio.h" enum {