--- espeak-1.41.orig/debian/control +++ espeak-1.41/debian/control @@ -0,0 +1,72 @@ +Source: espeak +Section: sound +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Mario Lang +Vcs-Browser: http://git.debian.org/?p=pkg-a11y/espeak.git;a=summary +Vcs-Git: git://git.debian.org/git/pkg-a11y/espeak.git +Homepage: http://espeak.sourceforge.net/ +Build-Depends: debhelper (>= 5.0.0), portaudio19-dev +Standards-Version: 3.8.1 + +Package: espeak +Architecture: any +Depends: ${shlibs:Depends} +Description: A multi-lingual software speech synthesizer + eSpeak is a software speech synthesizer for English, and some other + languages. + . + eSpeak produces good quality English speech. It uses a different synthesis + method from other open source text to speech (TTS) engines, and sounds quite + different. It's perhaps not as natural or "smooth", but some find the + articulation clearer and easier to listen to for long periods. + . + It can run as a command line program to speak text from a file or from stdin. + . + It works well as a "Talker" with the KDE text to speech system (KTTS), as an + alternative to Festival for example. As such, it can speak text which has been + selected into the clipboard, or directly from the Konqueror browser or the Kate + editor. + . + * Includes different Voices, whose characteristics can be altered. + * Can produce speech output as a WAV file. + * Can translate text to phoneme codes, so it could be adapted as a front end + for another speech synthesis engine. + * Potential for other languages. Rudimentary (and probably humourous) + attempts at German and Esperanto are included. + * Compact size. The program and its data total about 350 kbytes. + * Written in C++. + +Package: espeak-data +Architecture: any +Recommends: espeak (= ${binary:Version}) +Description: A multi-lingual software speech synthesizer: speech data files + eSpeak is a software speech synthesizer for English, and some other + languages. This package contains necessary synthesizer data files needed + for the espeak program, and the shared library. + +Package: espeak-data-udeb +Section: debian-installer +Architecture: any +XC-Package-Type: udeb +Description: A multi-lingual software speech synthesizer: speech data files + eSpeak is a software speech synthesizer for English, and some other + languages. This package contains necessary synthesizer data files needed + for the espeak program, and the shared library. + +Package: libespeak1 +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, espeak-data (= ${binary:Version}) +Description: A multi-lingual software speech synthesizer: shared library + eSpeak is a software speech synthesizer for English, and some other + languages. This package contains the espeak program in a shared library. + +Package: libespeak-dev +Architecture: any +Section: libdevel +Depends: libespeak1 (= ${binary:Version}) +Description: A multi-lingual software speech synthesizer: development files + eSpeak is a software speech synthesizer for English, and some other + languages. This package contains the eSpeak development files needed to + build against the espeak shared library. --- espeak-1.41.orig/debian/changelog +++ espeak-1.41/debian/changelog @@ -0,0 +1,382 @@ +espeak (1.41-0ubuntu1) karmic; urgency=low + + * New upstream release + * debian/rules: + - Revert to shell code for determining package version + - Disable the use of the endian conversion utility for now, as it + causes a buffer overflow when run + + -- Luke Yelavich Tue, 25 Aug 2009 16:01:36 +1000 + +espeak (1.40.02-2ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Do not build with -pedantic. + - espeak doesn't need to be linked against libstdc++. + - update espeak manpage with new command-line arguments + - debian/control: Konquerer replaced with Konqueror + - debian/copyright: updated + * Build libespeak.a with an additional make call, and copy it from src/ + as it somehow vanishes during the rest of the build. + + -- Luke Yelavich Tue, 09 Jun 2009 11:51:32 +1000 + +espeak (1.40.02-2) unstable; urgency=low + + * Provide espeak-data-udeb. (Closes: 522578) + * debian/control: + - Add Vcs-Git and Vcs-Browser fields. + - Update Standards-Version to 3.8.1 (no changes). + + -- Mario Lang Sun, 24 May 2009 22:55:52 +0200 + +espeak (1.40.02-1ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Do not build with -pedantic. + - espeak doesn't need to be linked against libstdc++. + - update espeak manpage with new command-line arguments + - debian/control: Konquerer replaced with Konqueror + * debian/copyright: updated + + -- Luke Yelavich Tue, 05 May 2009 09:20:56 +1000 + +espeak (1.40.02-1) unstable; urgency=low + + * New upstream release. + * debian/control: Update Standards-Version to 3.8.0 (no changes). + + -- Mario Lang Sun, 15 Feb 2009 14:13:26 +0100 + +espeak (1.40.02-0ubuntu1) jaunty; urgency=low + + * New upstream release. + * debian/rules: Temporarily hard-code the version number, to deal with + the library soname being only 1.40. + * debian/espeak.1: Updated with new command-line arguments. + * Build against portaudio v19. + + -- Luke Yelavich Wed, 14 Jan 2009 10:31:19 +1100 + +espeak (1.39-0ubuntu1) intrepid; urgency=low + + * New upstream release, FFe granted. (LP: #268390) + + -- Luke Yelavich Sat, 20 Sep 2008 13:43:21 +1000 + +espeak (1.38-0ubuntu2) intrepid; urgency=low + + * Spelling mistake fixed (LP: #250860) + - Konquerer replaced with Konqueror in debian/control + * Moving Standard-Version to the current version + 3.7.3 -> 3.8.0 in debian/control + * Removing package homepage from package description + since it has its own field. + + -- Jad Madi Thu, 28 Aug 2008 11:45:18 +1000 + +espeak (1.38-0ubuntu1) intrepid; urgency=low + + * New upstream release. + + -- Luke Yelavich Tue, 26 Aug 2008 09:37:23 +1000 + +espeak (1.37-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + * Merge from debian unstable, remaining changes: + - Add conflict/replaces with earlier versions. + - Use PortAudio v18. + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Do not build with -pedantic. + - Update maintainer as per spec. + * src/Makefile: Espeak doesn't need to be linked against libstdc++. + + -- Luke Yelavich Mon, 05 May 2008 12:23:10 +1000 + +espeak (1.37-1) unstable; urgency=low + + * New upstream release. + + -- Mario Lang Sun, 20 Apr 2008 19:01:41 +0200 + +espeak (1.36.02-1) unstable; urgency=low + + * New upstream release. + + -- Mario Lang Tue, 18 Mar 2008 17:32:49 +0100 + +espeak (1.36-0ubuntu1) hardy; urgency=low + + * New upstream release, FF exception granted. (LP: #200370) + * Patches from upstream to fix speech intonation, and buffer overflows that + were found thanks to stack smashing. + + -- Luke Yelavich Fri, 14 Mar 2008 09:54:49 +1100 + +espeak (1.32-0ubuntu1) hardy; urgency=low + + * New upstream release. + + -- Luke Yelavich Wed, 05 Mar 2008 12:37:19 +1100 + +espeak (1.31-0ubuntu1) hardy; urgency=low + + * New upstream release. (LP: #190860) + * Merge from debian unstable, remaining changes: + - Add conflict/replaces with earlier versions. + - Use PortAudio v18. + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Do not build with -pedantic. + - Update maintainer as per spec. + + -- Luke Yelavich Mon, 11 Feb 2008 17:33:17 +1100 + +espeak (1.30-1) unstable; urgency=low + + * New upstream release. + * debian/control: + - Add Hompeage field. + - Update Standards-Version to 3.7.3 (no changes). + * debian/copyright: Update to include missed copyright + holders and mention big_endian/espeak-phoneme-data.c. + + -- Mario Lang Sat, 05 Jan 2008 12:58:30 +0100 + +espeak (1.29-1) unstable; urgency=low + + * New upstream release (Closes: Bug#439770). + * debian/copyright: Upstream switched to GPLv3. Update accordingly. + * debian/libespeak1.shlibs: Bump version. + + -- Mario Lang Sun, 14 Oct 2007 12:51:29 +0200 + +espeak (1.29-0ubuntu3) gutsy; urgency=low + + * Build against PortAudio v18, due to v19 causing speech output + headaches. (LP: #140673) + + -- Luke Yelavich Thu, 04 Oct 2007 21:31:10 +1000 + +espeak (1.29-0ubuntu2) gutsy; urgency=low + + * Do not build with -pedantic. LP: #138569. + + -- Matthias Klose Thu, 13 Sep 2007 14:02:48 +0000 + +espeak (1.29-0ubuntu1) gutsy; urgency=low + + * New upstream release. (LP: #128137) + * debian/copyright: Adjust for license change. + * debian/rules: Update location of endian conversion utility. + * Update espeak manpage. + + -- Luke Yelavich Tue, 28 Aug 2007 17:07:43 +1000 + +espeak (1.26-1ubuntu1) gutsy; urgency=low + + * Merge with Debian; remaining changes: + - Build-depend on dpatch. + - Add conflict/replaces with earlier versions. + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Modified debian/copyright to mention big_endian/espeak-phoneme-data.c. + - Patch to ensure compilation uses externally specified C(XX)FLAGS. + + -- Luke Yelavich Thu, 14 Jun 2007 09:24:23 +1000 + +espeak (1.26-1) unstable; urgency=low + + * New upstream release. + * debian/control: Change ${Source-Version} to ${binary:Version}. + + -- Mario Lang Fri, 08 Jun 2007 20:04:18 +0200 + +espeak (1.25-1) unstable; urgency=low + + * New upstream release. + * debian/rules: Grab the upstream version using dpkg-parsechangelog. + + -- Mario Lang Sun, 20 May 2007 16:12:39 +0200 + +espeak (1.25-0ubuntu1) gutsy; urgency=low + + * New upstream release. + * debian/rules: Grab the upstream version using dpkg-parsechangelog. + * Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + * Modified debian/copyright to mention + big_endian/espeak-phoneme-data.c. + * Patch to ensure compilation uses externally specified C(XX)FLAGS. + * debian/rules: + - Bump version number. + - Build big_endian/espeak-phoneme-data.c for use in preparing + espeak voice metadata for packaging. + - Fixed up ordering of dh_makeshlibs and dh_shlibdeps, and added + arguments to dh_shlibdeps to ensure the proper library + dependencies. + + -- Luke Yelavich Sun, 20 May 2007 21:37:19 +1000 + +espeak (1.22-1) unstable; urgency=low + + * New upstream release. + * Install speak_lib.h in /usr/include/espeak. + * Install src/espeak (dynamically linked) rather then src/speak. + * Use -L and -l with dh_shlibdeps so we pick up a tight dependency + on libespeak1 for package espeak. + * Change espeak-data to Arch: any. + + -- Mario Lang Sat, 14 Apr 2007 22:42:03 +0200 + +espeak (1.21-0ubuntu1) feisty; urgency=low + + * New upstream release + * debian/rules: Updated version number. + + -- Luke Yelavich Thu, 8 Mar 2007 22:10:29 +1100 + +espeak (1.19-2) unstable; urgency=low + + * Change roundl() to round() in src/wave.cpp. + + -- Mario Lang Mon, 29 Jan 2007 13:32:47 +0100 + +espeak (1.19-1) unstable; urgency=low + + * New upstream release (Closes: Bug#406840, Bug#408741). + + -- Mario Lang Sun, 28 Jan 2007 23:58:18 +0100 + +espeak (1.19-0ubuntu4) feisty; urgency=low + + * debian/copyright: Added copyright holders. + + -- Luke Yelavich Thu, 1 Feb 2007 14:42:52 +1100 + +espeak (1.19-0ubuntu3) feisty; urgency=low + + * Rebuild package files, due to odd FTBFS when attempting to apply + patch. + + -- Luke Yelavich Thu, 1 Feb 2007 12:05:48 +1100 + +espeak (1.19-0ubuntu2) feisty; urgency=low + + * debian/patches/01_roundl_fix.dpatch: + - Change roundl() to round() in src/wave.cpp, Thanks to Mario Lang. + * debian/control: Added dpatch to build-depends. + + -- Luke Yelavich Thu, 1 Feb 2007 11:29:35 +1100 + +espeak (1.19-0ubuntu1) feisty; urgency=low + + * New upstream release. + * debian/control: + - Changed espeak-data to be architecture specific. + - The espeak package now depends on libespeak1. + - Added homepage to all package descriptions. + * debian/rules: + - Use the espeak binary for the espeak package. + - Add a check for big endian architectures, (currently only ppc) to + ensure the proper espeak-data is copied into place. + - Bump package version to 1.19. + - Move location of espeak_lib.h to /usr/include/espeak. + * Packaging fixes from Mario Lang: + - Fix first-person description. + - Add missing dh_makeshlibs and fix misplaced dh_installdeb call. + + -- Luke Yelavich Sat, 27 Jan 2007 12:47:27 +1100 + +espeak (1.18-0ubuntu1) feisty; urgency=low + + * New upstream release: + - Asynchronous modes added to libespeak. Speech can either be played or + retrieved asynchonously. + - eSpeak API changed to accommodate asynchonous modes, see speak_lib.h. + - Changed eSpeak library functions and speak_lib.h to use C compatible + function calls. + - Two versions of the command-line program: espeak, which uses the + libespeak library. speak, which is a standalone program. + - Windows SAPI5 version made, with installer. + - Added "voice variants" feature, so that different sounding voices can + be used with any language. See "docs/voices.html" + - Added languages (* naive initial draft only): Romanian, French, + Swedish *, Norwegian, Hindi, Vietnamese + - Improved langugages: Afrikaans, German. + * debian/rules: + - bumped 'version'. + + -- Daniel Holbach Mon, 22 Jan 2007 12:02:57 +0100 + +espeak (1.18-0ubuntu1) feisty; urgency=low + + * New upstream release: + - Asynchronous modes added to libespeak. Speech can either be played or + retrieved asynchonously. + - eSpeak API changed to accommodate asynchonous modes, see speak_lib.h. + - Changed eSpeak library functions and speak_lib.h to use C compatible + function calls. + - Two versions of the command-line program: espeak, which uses the + libespeak library. speak, which is a standalone program. + - Windows SAPI5 version made, with installer. + - Added "voice variants" feature, so that different sounding voices can + be used with any language. See "docs/voices.html" + - Added languages (* naive initial draft only): Romanian, French, + Swedish *, Norwegian, Hindi, Vietnamese + - Improved langugages: Afrikaans, German. + * debian/rules: + - bumped 'version'. + + -- Daniel Holbach Mon, 22 Jan 2007 12:02:57 +0100 + +espeak (1.16-2) unstable; urgency=low + + * Fix first-person description (Closes: Bug#399585) + + -- Mario Lang Mon, 27 Nov 2006 15:24:02 +0100 + +espeak (1.16-1) unstable; urgency=low + + * New upstream release + * Add missing dh_makeshlibs and fix misplaced dh_installdeb call. + + -- Mario Lang Tue, 7 Nov 2006 10:55:27 +0100 + +espeak (1.15-0ubuntu2) edgy; urgency=low + + * Fixed up dependencies for espeak and libespeak1 to properly depend + on espeak-data. + + -- Luke Yelavich Fri, 29 Sep 2006 09:40:44 +1000 + +espeak (1.15-0ubuntu1) edgy; urgency=low + + * New upstream release. + * Updated manpage. + * Break out synthesizer data files into new package, espeak-data. + * Created libespeak1 and libespeak-dev library packages. + * debian/control: Removed ${misc:Depends} from the espeak package + Depends field as it isn't needed. + + -- Luke Yelavich Tue, 26 Sep 2006 18:58:56 +1000 + +espeak (1.11-0ubuntu1) edgy; urgency=low + + * New upstream release. + * debian/rules: Cleaned up a little bit. + + -- Luke Yelavich Wed, 9 Aug 2006 20:59:08 +1000 + +espeak (1.10-0ubuntu1) edgy; urgency=low + + * Initial release. + + -- Luke Yelavich Fri, 23 Jun 2006 08:49:03 +0200 + --- espeak-1.41.orig/debian/rules +++ espeak-1.41/debian/rules @@ -0,0 +1,101 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +soname=libespeak.so.1 +version=$(shell dpkg-parsechangelog|sed -n -e 's/^Version: //p'|cut -d- -f1) + +voicelist=$(shell ls -1 dictsource/*_list | cut -f2 -d/ | cut -f1 -d_) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + + +build: build-stamp + +build-stamp: + dh_testdir + + cd src && cp portaudio19.h portaudio.h + cd src && CXXFLAGS="$(CXXFLAGS) $(CFLAGS)" $(MAKE) libespeak.a + cp $(CURDIR)/src/libespeak.a $(CURDIR) + cd src && CXXFLAGS="$(CXXFLAGS) $(CFLAGS)" $(MAKE) + cp $(CURDIR)/libespeak.a $(CURDIR)/src + + # Build static speak binary + cd src && $(MAKE) clean + cd src && CXXFLAGS="$(CXXFLAGS) $(CFLAGS)" $(MAKE) speak DATADIR=$(CURDIR)/espeak-data + #cd platforms/big_endian && CFLAGS="$(CFLAGS)" $(MAKE) + # Build voice metadata. + #mkdir -p $(CURDIR)/tmp + #$(CURDIR)/platforms/big_endian/espeak-phoneme-data $(CURDIR)/espeak-data $(CURDIR)/tmp $(CURDIR)/espeak-data/phondata-manifest + #mv $(CURDIR)/tmp/* $(CURDIR)/espeak-data + #rmdir $(CURDIR)/tmp + cd dictsource && \ + for voice in $(voicelist); do \ + $(CURDIR)/src/speak --compile=$$voice; \ + done + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + -cd src && $(MAKE) distclean + -cd platforms/big_endian && $(MAKE) clean + -rm libespeak.a + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + install -m 755 -o root -g root src/espeak $(CURDIR)/debian/espeak/usr/bin/espeak + cp -r espeak-data $(CURDIR)/debian/espeak-data/usr/share + find $(CURDIR)/debian/espeak-data/usr/share -type f -exec chmod 644 {} \; + find $(CURDIR)/debian/espeak-data/usr/share -type d -exec chmod 755 {} \; + cp -al $(CURDIR)/debian/espeak-data/usr $(CURDIR)/debian/espeak-data-udeb + rm -fr $(CURDIR)/debian/espeak-data-udeb/usr/share/espeak-data/mbrola* $(CURDIR)/debian/espeak-data-udeb/usr/share/espeak-data/voices/mb $(CURDIR)/debian/espeak-data-udeb/usr/share/espeak-data/voices/test + install -m 644 -o root -g root src/$(soname).$(version) $(CURDIR)/debian/libespeak1/usr/lib/$(soname).$(version) + cd $(CURDIR)/debian/libespeak1/usr/lib && ln -s $(soname).$(version) $(soname) + cd $(CURDIR)/debian/libespeak1/usr/lib && ln -s $(soname).$(version) libespeak.so + mv $(CURDIR)/debian/libespeak1/usr/lib/libespeak.so $(CURDIR)/debian/libespeak-dev/usr/lib + install -m 644 -o root -g root libespeak.a $(CURDIR)/debian/libespeak-dev/usr/lib + install -m 644 -o root -g root src/speak_lib.h $(CURDIR)/debian/libespeak-dev/usr/include/espeak + +# 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_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installman debian/espeak.1 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs -V + dh_shlibdeps -L libespeak1 -l debian/libespeak1/usr/lib + dh_installdeb -v + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- espeak-1.41.orig/debian/espeak-data.dirs +++ espeak-1.41/debian/espeak-data.dirs @@ -0,0 +1 @@ +usr/share --- espeak-1.41.orig/debian/dirs +++ espeak-1.41/debian/dirs @@ -0,0 +1 @@ +usr/bin --- espeak-1.41.orig/debian/docs +++ espeak-1.41/debian/docs @@ -0,0 +1,2 @@ +docs/* +ReadMe --- espeak-1.41.orig/debian/libespeak-dev.dirs +++ espeak-1.41/debian/libespeak-dev.dirs @@ -0,0 +1,2 @@ +usr/include/espeak +usr/lib --- espeak-1.41.orig/debian/libespeak1.postrm +++ espeak-1.41/debian/libespeak1.postrm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +#DEBHELPER# + --- espeak-1.41.orig/debian/copyright +++ espeak-1.41/debian/copyright @@ -0,0 +1,43 @@ +This package was debianized by Luke Yelavich on +Fri, 23 Jun 2006 08:49:03 +0200. + +It was downloaded from http://prdownloads.sourceforge.net/espeak/speak-1.10-source.zip + +Copyright Holders: Jonathan Duddington 2005-2008 + Gilles Casse 2007 + Ross Bencina 1999-2002 + Phil Burk 1999-2002 + Sun Microsystems, Inc. 2008 + +License: + + This package 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 3 of the License, or + (at your option) any later version. + + This package 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 with +your Debian GNU system, in /usr/share/common-licenses/GPL-3, or with +the Debian espeak source package as the file License.txt. If not, see +. + + +The following files have a different license to what is stated above. + +big_endian/espeak-phoneme-data.c: + Author: Leonardo Boshell + This file has no copyright, as intended by the author, and + has been placed in the public domain. + +The following files have a different license to what is stated above. + +big_endian/espeak-phoneme-data.c: + Author: Leonardo Boshell + This file has no copyright, as intended by the author, and + has been placed in the public domain. --- espeak-1.41.orig/debian/libespeak1.dirs +++ espeak-1.41/debian/libespeak1.dirs @@ -0,0 +1 @@ +usr/lib --- espeak-1.41.orig/debian/espeak.1 +++ espeak-1.41/debian/espeak.1 @@ -0,0 +1,102 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH ESPEAK 1 "July 25, 2007" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +espeak \- A multi-lingual software speech synthesizer. +.SH SYNOPSIS +.B espeak +.RI [ options ]\ [ "" ] +.SH DESCRIPTION +.B espeak +is a software speech synthesizer for English, and some other languages. +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-f +Text file to speak +.TP +.B \-\-stdin +Read text input from stdin instead of a file +.TP +If neither -f nor --stdin, are spoken, or if none then text is spoken from stdin, each line separately. +.TP +.B \-q +Quiet, don't produce any speech (may be useful with -x) +.TP +.B \-a +Amplitude, 0 to 20, default is 10 +.TP +.B \-l +Line length. If not zero (which is the default), consider +lines less than this length as and-of-clause +.TP +.B \-p +Pitch adjustment, 0 to 99, default is 50 +.TP +.B -s +Speed in words per minute, default is 160 +.TP +.B \-v +Use voice file of this name from espeak-data/voices +.TP +.B -b +Input text is 8-bit encoding +.TP +.B -m +Indicates that the text contains SSML (Speech Synthesis Markup Language) tags or other XML tags. Those SSML tags which are supported are interpreted. Other tags, including HTML, are ignored, except that some HTML tags such as

and
  • ensure a break in the speech. +.TP +.B \-w +Write output to this WAV file, rather than speaking it directly +.TP +.B \-x +Write phoneme mnemonics to stdout +.TP +.B \-X +Write phonemes mnemonics and translation trace to stdout. If rules files have been built with --compile=debug, line numbers will also be displayed. +.TP +.B \-\-stdout +Write speech output to stdout +.TP +.B \-\-compile= +Compile the pronunciation rules and dictionary in the current directory. = is optional and specifies which language +.TP +.B \-\-path= +Specifies the directory containing the espeak-data directory +.TP +.B \-\-phonout= +Write output from -x -X commands and mbrola phoneme data to this file +.TP +.B \-\-punct="" +Speak the names of punctuation characters during speaking. If = is omitted, all punctuation is spoken. +.TP +.B \-k +Indicate capital letters with: 1=sound, 2=the word "capitals", higher values = a pitch increase (try -k20). +.TP +.B \-\-voices[=] +Lists the available voices. If = is present then only those voices which are suitable for that language are listed. +.TP +.B \-\-compile=voicename +Compile the pronunciation rules and dictionary in the current directory. = is optional and specifies which language +.TP +.B \-\-compile=debug +Compile the pronunciation rules and dictionary in the current directory as above, but include line numbers, that get shown when -X is used. +.SH AUTHOR +eSpeak was written by Jonathan Duddington . The webpage for this package can be found at http://espeak.sourceforge.net/. +.PP +This manual page was written by Luke Yelavich , for the Ubuntu project (but may be used by others). --- espeak-1.41.orig/debian/compat +++ espeak-1.41/debian/compat @@ -0,0 +1 @@ +5 --- espeak-1.41.orig/debian/libespeak1.shlibs +++ espeak-1.41/debian/libespeak1.shlibs @@ -0,0 +1,2 @@ +libespeak 1 libespeak1 (>= 1.30) + --- espeak-1.41.orig/debian/libespeak1.postinst +++ espeak-1.41/debian/libespeak1.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +#DEBHELPER# + --- espeak-1.41.orig/src/portaudio.h +++ espeak-1.41/src/portaudio.h @@ -1,21 +1,14 @@ -// NOTE: Copy this file to portaudio.h in order to compile with V18 portaudio - - -#ifndef PORT_AUDIO_H -#define PORT_AUDIO_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +// NOTE: Copy this file to portaudio.h in order to compile with V19 portaudio +#ifndef PORTAUDIO_H +#define PORTAUDIO_H /* - * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $ + * $Id: portaudio.h 1061 2006-06-19 22:46:41Z lschwardt $ * PortAudio Portable Real-Time Audio Library * PortAudio API Header File - * Latest version available at: http://www.audiomulch.com/portaudio/ + * Latest version available at: http://www.portaudio.com/ * - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * Copyright (c) 1999-2002 Ross Bencina and Phil Burk * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files @@ -39,17 +32,45 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * */ +/** @file + @brief The PortAudio API. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve the release number of the currently running PortAudio build, + eg 1900. +*/ +int Pa_GetVersion( void ); + + +/** Retrieve a textual description of the current PortAudio build, + eg "PortAudio V19-devel 13 October 2002". +*/ +const char* Pa_GetVersionText( void ); + + +/** Error codes returned by PortAudio functions. + Note that with the exception of paNoError, all PaErrorCodes are negative. +*/ + typedef int PaError; -typedef enum { +typedef enum PaErrorCode +{ paNoError = 0, - paHostError = -10000, + paNotInitialized = -10000, + paUnanticipatedHostError, paInvalidChannelCount, paInvalidSampleRate, - paInvalidDeviceId, + paInvalidDevice, paInvalidFlag, paSampleFormatNotSupported, paBadIODeviceCombination, @@ -60,407 +81,1047 @@ paBadStreamPtr, paTimedOut, paInternalError, - paDeviceUnavailable -} PaErrorNum; + paDeviceUnavailable, + paIncompatibleHostApiSpecificStreamInfo, + paStreamIsStopped, + paStreamIsNotStopped, + paInputOverflowed, + paOutputUnderflowed, + paHostApiNotFound, + paInvalidHostApi, + paCanNotReadFromACallbackStream, /**< @todo review error code name */ + paCanNotWriteToACallbackStream, /**< @todo review error code name */ + paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ + paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ + paIncompatibleStreamHostApi, + paBadBufferPtr +} PaErrorCode; + + +/** Translate the supplied PortAudio error code into a human readable + message. +*/ +const char *Pa_GetErrorText( PaError errorCode ); + + +/** Library initialization function - call this before using PortAudio. + This function initialises internal data structures and prepares underlying + host APIs for use. This function MUST be called before using any other + PortAudio API functions. + + If Pa_Initialize() is called multiple times, each successful + call must be matched with a corresponding call to Pa_Terminate(). + Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not + required to be fully nested. -/* - Pa_Initialize() is the library initialisation function - call this before - using the library. + Note that if Pa_Initialize() returns an error code, Pa_Terminate() should + NOT be called. -*/ + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + @see Pa_Terminate +*/ PaError Pa_Initialize( void ); -/* - Pa_Terminate() is the library termination function - call this after - using the library. -*/ +/** Library termination function - call this when finished using PortAudio. + This function deallocates all resources allocated by PortAudio since it was + initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has + been called multiple times, each call must be matched with a corresponding call + to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically + close any PortAudio streams that are still open. + + Pa_Terminate() MUST be called before exiting a program which uses PortAudio. + Failure to do so may result in serious resource leaks, such as audio devices + not being available until the next reboot. + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Initialize +*/ PaError Pa_Terminate( void ); -/* - Pa_GetHostError() returns a host specific error code. - This can be called after receiving a PortAudio error code of paHostError. + +/** The type used to refer to audio devices. Values of this type usually + range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice + and paUseHostApiSpecificDeviceSpecification values. + + @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification */ +typedef int PaDeviceIndex; -long Pa_GetHostError( void ); -/* - Pa_GetErrorText() translates the supplied PortAudio error number - into a human readable message. - +/** A special PaDeviceIndex value indicating that no device is available, + or should be used. + + @see PaDeviceIndex */ +#define paNoDevice ((PaDeviceIndex)-1) -const char *Pa_GetErrorText( PaError errnum ); -/* - Sample formats - - These are formats used to pass sound data between the callback and the - stream. Each device has a "native" format which may be used when optimum - efficiency or control over conversion is required. - - Formats marked "always available" are supported (emulated) by all - PortAudio implementations. - - The floating point representation (paFloat32) uses +1.0 and -1.0 as the - maximum and minimum respectively. +/** A special PaDeviceIndex value indicating that the device(s) to be used + are specified in the host api specific stream info structure. - paUInt8 is an unsigned 8 bit format where 128 is considered "ground" + @see PaDeviceIndex +*/ +#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) + +/* Host API enumeration mechanism */ + +/** The type used to enumerate to host APIs at runtime. Values of this type + range from 0 to (Pa_GetHostApiCount()-1). + + @see Pa_GetHostApiCount */ +typedef int PaHostApiIndex; -typedef unsigned long PaSampleFormat; -#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ -#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ -#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ -#define paInt24 ((PaSampleFormat) (1<<3)) -#define paPackedInt24 ((PaSampleFormat) (1<<4)) -#define paInt8 ((PaSampleFormat) (1<<5)) -#define paUInt8 ((PaSampleFormat) (1<<6)) -#define paCustomFormat ((PaSampleFormat) (1<<16)) -/* - Device enumeration mechanism. - - Device ids range from 0 to Pa_CountDevices()-1. - - Devices may support input, output or both. +/** Retrieve the number of available host APIs. Even if a host API is + available it may have no devices available. + + @return A non-negative value indicating the number of available host APIs + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaHostApiIndex +*/ +PaHostApiIndex Pa_GetHostApiCount( void ); + + +/** Retrieve the index of the default host API. The default host API will be + the lowest common denominator host API on the current platform and is + unlikely to provide the best performance. + @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) + indicating the default host API index or, a PaErrorCode (which are always + negative) if PortAudio is not initialized or an error is encountered. */ +PaHostApiIndex Pa_GetDefaultHostApi( void ); + + +/** Unchanging unique identifiers for each supported host API. This type + is used in the PaHostApiInfo structure. The values are guaranteed to be + unique and to never change, thus allowing code to be written that + conditionally uses host API specific extensions. + + New type ids will be allocated when support for a host API reaches + "public alpha" status, prior to that developers should use the + paInDevelopment type id. + + @see PaHostApiInfo +*/ +typedef enum PaHostApiTypeId +{ + paInDevelopment=0, /* use while developing support for a new host API */ + paDirectSound=1, + paMME=2, + paASIO=3, + paSoundManager=4, + paCoreAudio=5, + paOSS=7, + paALSA=8, + paAL=9, + paBeOS=10, + paWDMKS=11, + paJACK=12, + paWASAPI=13, + paAudioScienceHPI=14 +} PaHostApiTypeId; -typedef int PaDeviceID; -#define paNoDevice -1 -int Pa_CountDevices( void ); +/** A structure containing information about a particular host API. */ -typedef struct +typedef struct PaHostApiInfo { + /** this is struct version 1 */ int structVersion; + /** The well known unique identifier of this host API @see PaHostApiTypeId */ + PaHostApiTypeId type; + /** A textual description of the host API for display on user interfaces. */ const char *name; - int maxInputChannels; - int maxOutputChannels; - /* Number of discrete rates, or -1 if range supported. */ - int numSampleRates; - /* Array of supported sample rates, or {min,max} if range supported. */ - const double *sampleRates; - PaSampleFormat nativeSampleFormats; -} -PaDeviceInfo; -/* - Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the - default device ids for input and output respectively, or paNoDevice if - no device is available. - The result can be passed to Pa_OpenStream(). + /** The number of devices belonging to this host API. This field may be + used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate + all devices for this host API. + @see Pa_HostApiDeviceIndexToDeviceIndex + */ + int deviceCount; + + /** The default input device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default input device is available. + */ + PaDeviceIndex defaultInputDevice; + + /** The default output device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default output device is available. + */ + PaDeviceIndex defaultOutputDevice; + +} PaHostApiInfo; + + +/** Retrieve a pointer to a structure containing information about a specific + host Api. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @return A pointer to an immutable PaHostApiInfo structure describing + a specific host API. If the hostApi parameter is out of range or an error + is encountered, the function returns NULL. + + The returned structure is owned by the PortAudio implementation and must not + be manipulated or freed. The pointer is only guaranteed to be valid between + calls to Pa_Initialize() and Pa_Terminate(). +*/ +const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); + + +/** Convert a static host API unique identifier, into a runtime + host API index. + + @param type A unique host API identifier belonging to the PaHostApiTypeId + enumeration. + + @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + The paHostApiNotFound error code indicates that the host API specified by the + type parameter is not available. + + @see PaHostApiTypeId +*/ +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); + + +/** Convert a host-API-specific device index to standard PortAudio device index. + This function may be used in conjunction with the deviceCount field of + PaHostApiInfo to enumerate all devices for the specified host API. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @param hostApiDeviceIndex A valid per-host device index in the range + 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) + + @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + A paInvalidHostApi error code indicates that the host API index specified by + the hostApi parameter is out of range. + + A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter + is out of range. + + @see PaHostApiInfo +*/ +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, + int hostApiDeviceIndex ); + + + +/** Structure used to return information about a host error condition. +*/ +typedef struct PaHostErrorInfo{ + PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ + long errorCode; /**< the error code returned */ + const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ +}PaHostErrorInfo; + + +/** Return information about the last host error encountered. The error + information returned by Pa_GetLastHostErrorInfo() will never be modified + asyncronously by errors occurring in other PortAudio owned threads + (such as the thread that manages the stream callback.) + + This function is provided as a last resort, primarily to enhance debugging + by providing clients with access to all available error information. + + @return A pointer to an immutable structure constaining information about + the host error. The values in this structure will only be valid if a + PortAudio function has previously returned the paUnanticipatedHostError + error code. +*/ +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); + + + +/* Device enumeration and capabilities */ + +/** Retrieve the number of available devices. The number of available devices + may be zero. + + @return A non-negative value indicating the number of available devices or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. +*/ +PaDeviceIndex Pa_GetDeviceCount( void ); + + +/** Retrieve the index of the default input device. The result can be + used in the inputDevice parameter to Pa_OpenStream(). + + @return The default input device index for the default host API, or paNoDevice + if no default input device is available or an error was encountered. +*/ +PaDeviceIndex Pa_GetDefaultInputDevice( void ); + + +/** Retrieve the index of the default output device. The result can be + used in the outputDevice parameter to Pa_OpenStream(). + + @return The default output device index for the defualt host API, or paNoDevice + if no default output device is available or an error was encountered. + + @note On the PC, the user can specify a default device by setting an environment variable. For example, to use device #1. - - set PA_RECOMMENDED_OUTPUT_DEVICE=1 - +
    + set PA_RECOMMENDED_OUTPUT_DEVICE=1
    +
    The user should first determine the available device ids by using the supplied application "pa_devs". +*/ +PaDeviceIndex Pa_GetDefaultOutputDevice( void ); + +/** The type used to represent monotonic time in seconds that can be used + for syncronisation. The type is used for the outTime argument to the + PaStreamCallback and as the result of Pa_GetStreamTime(). + + @see PaStreamCallback, Pa_GetStreamTime */ +typedef double PaTime; -PaDeviceID Pa_GetDefaultInputDeviceID( void ); -PaDeviceID Pa_GetDefaultOutputDeviceID( void ); +/** A type used to specify one or more sample formats. Each value indicates + a possible format for sound data passed to and from the stream callback, + Pa_ReadStream and Pa_WriteStream. + The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 + and aUInt8 are usually implemented by all implementations. -/* - Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure - for the device specified. - If the device parameter is out of range the function returns NULL. + The floating point representation (paFloat32) uses +1.0 and -1.0 as the + maximum and minimum respectively. - PortAudio manages the memory referenced by the returned pointer, the client - must not manipulate or free the memory. The pointer is only guaranteed to be - valid between calls to Pa_Initialize() and Pa_Terminate(). + paUInt8 is an unsigned 8 bit format where 128 is considered "ground" + + The paNonInterleaved flag indicates that a multichannel buffer is passed + as a set of non-interleaved pointers. + @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo + @see paFloat32, paInt16, paInt32, paInt24, paInt8 + @see paUInt8, paCustomFormat, paNonInterleaved */ +typedef unsigned long PaSampleFormat; -const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device ); -/* - PaTimestamp is used to represent a continuous sample clock with arbitrary - start time that can be used for syncronization. The type is used for the - outTime argument to the PortAudioCallback and as the result of Pa_StreamTime() +#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ +#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ +#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ +#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ +#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ +#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ +#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ + +#define paNonInterleaved ((PaSampleFormat) 0x80000000) +/** A structure providing information and capabilities of PortAudio devices. + Devices may support input, output or both input and output. */ +typedef struct PaDeviceInfo +{ + int structVersion; /* this is struct version 2 */ + const char *name; + PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ + + int maxInputChannels; + int maxOutputChannels; -typedef double PaTimestamp; + /* Default latency values for interactive performance. */ + PaTime defaultLowInputLatency; + PaTime defaultLowOutputLatency; + /* Default latency values for robust non-interactive applications (eg. playing sound files). */ + PaTime defaultHighInputLatency; + PaTime defaultHighOutputLatency; -/* - PortAudioCallback is implemented by PortAudio clients. - - inputBuffer and outputBuffer are arrays of interleaved samples, - the format, packing and number of channels used by the buffers are - determined by parameters to Pa_OpenStream() (see below). - - framesPerBuffer is the number of sample frames to be processed by the callback. - - outTime is the time in samples when the buffer(s) processed by - this callback will begin being played at the audio output. - See also Pa_StreamTime() - - userData is the value of a user supplied pointer passed to Pa_OpenStream() - intended for storing synthesis data etc. - - return value: - The callback can return a non-zero value to stop the stream. This may be - useful in applications such as soundfile players where a specific duration - of output is required. However, it is not necessary to utilise this mechanism - as StopStream() will also terminate the stream. A callback returning a - non-zero value must fill the entire outputBuffer. - - NOTE: None of the other stream functions may be called from within the - callback function except for Pa_GetCPULoad(). + double defaultSampleRate; +} PaDeviceInfo; + +/** Retrieve a pointer to a PaDeviceInfo structure containing information + about the specified device. + @return A pointer to an immutable PaDeviceInfo structure. If the device + parameter is out of range the function returns NULL. + + @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). + + @see PaDeviceInfo, PaDeviceIndex */ +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); -typedef int (PortAudioCallback)( - void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, - PaTimestamp outTime, void *userData ); +/** Parameters for one direction (input or output) of a stream. +*/ +typedef struct PaStreamParameters +{ + /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + specifying the device to be used or the special constant + paUseHostApiSpecificDeviceSpecification which indicates that the actual + device(s) to use are specified in hostApiSpecificStreamInfo. + This field must not be set to paNoDevice. + */ + PaDeviceIndex device; + + /** The number of channels of sound to be delivered to the + stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). + It can range from 1 to the value of maxInputChannels in the + PaDeviceInfo record for the device specified by the device parameter. + */ + int channelCount; + + /** The sample format of the buffer provided to the stream callback, + a_ReadStream() or Pa_WriteStream(). It may be any of the formats described + by the PaSampleFormat enumeration. + */ + PaSampleFormat sampleFormat; + + /** The desired latency in seconds. Where practical, implementations should + configure their latency based on these parameters, otherwise they may + choose the closest viable latency instead. Unless the suggested latency + is greater than the absolute upper limit for the device implementations + should round the suggestedLatency up to the next practial value - ie to + provide an equal or higher latency than suggestedLatency wherever possibe. + Actual latency values for an open stream may be retrieved using the + inputLatency and outputLatency fields of the PaStreamInfo structure + returned by Pa_GetStreamInfo(). + @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo + */ + PaTime suggestedLatency; + + /** An optional pointer to a host api specific data structure + containing additional information for device setup and/or stream processing. + hostApiSpecificStreamInfo is never required for correct operation, + if not used it should be set to NULL. + */ + void *hostApiSpecificStreamInfo; + +} PaStreamParameters; + + +/** Return code for Pa_IsFormatSupported indicating success. */ +#define paFormatIsSupported (0) + +/** Determine whether it would be possible to open a stream with the specified + parameters. + + @param inputParameters A structure that describes the input parameters used to + open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. inputParameters must be NULL for + output-only streams. + + @param outputParameters A structure that describes the output parameters used + to open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. outputParameters must be NULL for + input-only streams. -/* - Stream flags - - These flags may be supplied (ored together) in the streamFlags argument to - the Pa_OpenStream() function. + @param sampleRate The required sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @return Returns 0 if the format is supported, and an error code indicating why + the format is not supported otherwise. The constant paFormatIsSupported is + provided to compare with the return value for success. + @see paFormatIsSupported, PaStreamParameters */ +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); -#define paNoFlag (0) -#define paClipOff (1<<0) /* disable default clipping of out of range samples */ -#define paDitherOff (1<<1) /* disable default dithering */ -#define paPlatformSpecificFlags (0x00010000) -typedef unsigned long PaStreamFlags; -/* - A single PortAudioStream provides multiple channels of real-time - input and output audio streaming to a client application. - Pointers to PortAudioStream objects are passed between PortAudio functions. + +/* Streaming types and functions */ + + +/** + A single PaStream can provide multiple channels of real-time + streaming audio input and output to a client application. A stream + provides access to audio hardware represented by one or more + PaDevices. Depending on the underlying Host API, it may be possible + to open multiple streams using the same device, however this behavior + is implementation defined. Portable applications should assume that + a PaDevice may be simultaneously used by at most one PaStream. + + Pointers to PaStream objects are passed between PortAudio functions that + operate on streams. + + @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, + Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, + Pa_GetStreamTime, Pa_GetStreamCpuLoad + */ +typedef void PaStream; -typedef void PortAudioStream; -#define PaStream PortAudioStream -/* - Pa_OpenStream() opens a stream for either input, output or both. +/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() + or Pa_OpenDefaultStream() to indicate that the stream callback will + accept buffers of any size. +*/ +#define paFramesPerBufferUnspecified (0) + + +/** Flags used to control the behavior of a stream. They are passed as + parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be + ORed together. + + @see Pa_OpenStream, Pa_OpenDefaultStream + @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, + paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags +*/ +typedef unsigned long PaStreamFlags; + +/** @see PaStreamFlags */ +#define paNoFlag ((PaStreamFlags) 0) + +/** Disable default clipping of out of range samples. + @see PaStreamFlags +*/ +#define paClipOff ((PaStreamFlags) 0x00000001) + +/** Disable default dithering. + @see PaStreamFlags +*/ +#define paDitherOff ((PaStreamFlags) 0x00000002) + +/** Flag requests that where possible a full duplex stream will not discard + overflowed input samples without calling the stream callback. This flag is + only valid for full duplex callback streams and only when used in combination + with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using + this flag incorrectly results in a paInvalidFlag error being returned from + Pa_OpenStream and Pa_OpenDefaultStream. + + @see PaStreamFlags, paFramesPerBufferUnspecified +*/ +#define paNeverDropInput ((PaStreamFlags) 0x00000004) + +/** Call the stream callback to fill initial output buffers, rather than the + default behavior of priming the buffers with zeros (silence). This flag has + no effect for input-only and blocking read/write streams. - stream is the address of a PortAudioStream pointer which will receive + @see PaStreamFlags +*/ +#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) + +/** A mask specifying the platform specific bits. + @see PaStreamFlags +*/ +#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) + +/** + Timing information for the buffers passed to the stream callback. +*/ +typedef struct PaStreamCallbackTimeInfo{ + PaTime inputBufferAdcTime; + PaTime currentTime; + PaTime outputBufferDacTime; +} PaStreamCallbackTimeInfo; + + +/** + Flag bit constants for the statusFlags to PaStreamCallback. + + @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, + paPrimingOutput +*/ +typedef unsigned long PaStreamCallbackFlags; + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that + input data is all silence (zeros) because no real data is available. In a + stream opened without paFramesPerBufferUnspecified, it indicates that one or + more zero samples have been inserted into the input buffer to compensate + for an input underflow. + @see PaStreamCallbackFlags +*/ +#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that data + prior to the first sample of the input buffer was discarded due to an + overflow, possibly because the stream callback is using too much CPU time. + Otherwise indicates that data prior to one or more samples in the + input buffer was discarded. + @see PaStreamCallbackFlags +*/ +#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) + +/** Indicates that output data (or a gap) was inserted, possibly because the + stream callback is using too much CPU time. + @see PaStreamCallbackFlags +*/ +#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) + +/** Indicates that output data will be discarded because no room is available. + @see PaStreamCallbackFlags +*/ +#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) + +/** Some of all of the output data will be used to prime the stream, input + data may be zero. + @see PaStreamCallbackFlags +*/ +#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) + +/** + Allowable return values for the PaStreamCallback. + @see PaStreamCallback +*/ +typedef enum PaStreamCallbackResult +{ + paContinue=0, + paComplete=1, + paAbort=2 +} PaStreamCallbackResult; + + +/** + Functions of type PaStreamCallback are implemented by PortAudio clients. + They consume, process or generate audio in response to requests from an + active PortAudio stream. + + @param input and @param output are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream(). + + @param frameCount The number of sample frames to be processed by + the stream callback. + + @param timeInfo The time in seconds when the first sample of the input + buffer was received at the audio input, the time in seconds when the first + sample of the output buffer will begin being played at the audio output, and + the time in seconds when the stream callback was called. + See also Pa_GetStreamTime() + + @param statusFlags Flags indicating whether input and/or output buffers + have been inserted or will be dropped to overcome underflow or overflow + conditions. + + @param userData The value of a user supplied pointer passed to + Pa_OpenStream() intended for storing synthesis data etc. + + @return + The stream callback should return one of the values in the + PaStreamCallbackResult enumeration. To ensure that the callback continues + to be called, it should return paContinue (0). Either paComplete or paAbort + can be returned to finish stream processing, after either of these values is + returned the callback will not be called again. If paAbort is returned the + stream will finish as soon as possible. If paComplete is returned, the stream + will continue until all buffers generated by the callback have been played. + This may be useful in applications such as soundfile players where a specific + duration of output is required. However, it is not necessary to utilise this + mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also + be used to stop the stream. The callback must always fill the entire output + buffer irrespective of its return value. + + @see Pa_OpenStream, Pa_OpenDefaultStream + + @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call + PortAudio API functions from within the stream callback. +*/ +typedef int PaStreamCallback( + const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + + +/** Opens a stream for either input, output or both. + + @param stream The address of a PaStream pointer which will receive a pointer to the newly opened stream. + + @param inputParameters A structure that describes the input parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + inputParameters must be NULL for output-only streams. + + @param outputParameters A structure that describes the output parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + outputParameters must be NULL for input-only streams. - inputDevice is the id of the device used for input (see PaDeviceID above.) - inputDevice may be paNoDevice to indicate that an input device is not required. - - numInputChannels is the number of channels of sound to be delivered to the - callback. It can range from 1 to the value of maxInputChannels in the - PaDeviceInfo record for the device specified by the inputDevice parameter. - If inputDevice is paNoDevice numInputChannels is ignored. - - inputSampleFormat is the sample format of inputBuffer provided to the callback - function. inputSampleFormat may be any of the formats described by the - PaSampleFormat enumeration (see above). PortAudio guarantees support for - the device's native formats (nativeSampleFormats in the device info record) - and additionally 16 and 32 bit integer and 32 bit floating point formats. - Support for other formats is implementation defined. - - inputDriverInfo is a pointer to an optional driver specific data structure - containing additional information for device setup or stream processing. - inputDriverInfo is never required for correct operation. If not used - inputDriverInfo should be NULL. - - outputDevice is the id of the device used for output (see PaDeviceID above.) - outputDevice may be paNoDevice to indicate that an output device is not required. - - numOutputChannels is the number of channels of sound to be supplied by the - callback. See the definition of numInputChannels above for more details. - - outputSampleFormat is the sample format of the outputBuffer filled by the - callback function. See the definition of inputSampleFormat above for more - details. - - outputDriverInfo is a pointer to an optional driver specific data structure - containing additional information for device setup or stream processing. - outputDriverInfo is never required for correct operation. If not used - outputDriverInfo should be NULL. - - sampleRate is the desired sampleRate. For full-duplex streams it is the + @param sampleRate The desired sampleRate. For full-duplex streams it is the sample rate for both input and output - - framesPerBuffer is the length in sample frames of all internal sample buffers - used for communication with platform specific audio routines. Wherever - possible this corresponds to the framesPerBuffer parameter passed to the - callback function. - - numberOfBuffers is the number of buffers used for multibuffered communication - with the platform specific audio routines. If you pass zero, then an optimum - value will be chosen for you internally. This parameter is provided only - as a guide - and does not imply that an implementation must use multibuffered - i/o when reliable double buffering is available (such as SndPlayDoubleBuffer() - on the Macintosh.) - - streamFlags may contain a combination of flags ORed together. - These flags modify the behaviour of the streaming process. Some flags may only - be relevant to certain buffer formats. - - callback is a pointer to a client supplied function that is responsible - for processing and filling input and output buffers (see above for details.) - - userData is a client supplied pointer which is passed to the callback - function. It could for example, contain a pointer to instance data necessary - for processing the audio buffers. - - return value: - Upon success Pa_OpenStream() returns PaNoError and places a pointer to a - valid PortAudioStream in the stream argument. The stream is inactive (stopped). - If a call to Pa_OpenStream() fails a non-zero error code is returned (see - PaError above) and the value of stream is invalid. - -*/ + + @param framesPerBuffer The number of frames passed to the stream callback + function, or the preferred block granularity for a blocking read/write stream. + The special value paFramesPerBufferUnspecified (0) may be used to request that + the stream callback will recieve an optimal (and possibly varying) number of + frames based on host requirements and the requested latency settings. + Note: With some host APIs, the use of non-zero framesPerBuffer for a callback + stream may introduce an additional layer of buffering which could introduce + additional latency. PortAudio guarantees that the additional latency + will be kept to the theoretical minimum however, it is strongly recommended + that a non-zero framesPerBuffer value only be used when your algorithm + requires a fixed number of frames per stream callback. + + @param streamFlags Flags which modify the behaviour of the streaming process. + This parameter may contain a combination of flags ORed together. Some flags may + only be relevant to certain buffer formats. + + @param streamCallback A pointer to a client supplied function that is responsible + for processing and filling input and output buffers. If this parameter is NULL + the stream will be opened in 'blocking read/write' mode. In blocking mode, + the client can receive sample data using Pa_ReadStream and write sample data + using Pa_WriteStream, the number of samples that may be read or written + without blocking is returned by Pa_GetStreamReadAvailable and + Pa_GetStreamWriteAvailable respectively. -PaError Pa_OpenStream( PortAudioStream** stream, - PaDeviceID inputDevice, - int numInputChannels, - PaSampleFormat inputSampleFormat, - void *inputDriverInfo, - PaDeviceID outputDevice, - int numOutputChannels, - PaSampleFormat outputSampleFormat, - void *outputDriverInfo, + @param userData A client supplied pointer which is passed to the stream callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. This parameter is ignored if streamCallback + is NULL. + + @return + Upon success Pa_OpenStream() returns paNoError and places a pointer to a + valid PaStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails, a non-zero error code is returned (see + PaError for possible error codes) and the value of stream is invalid. + + @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, + Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable +*/ +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, - unsigned long numberOfBuffers, PaStreamFlags streamFlags, - PortAudioCallback *callback, + PaStreamCallback *streamCallback, void *userData ); -/* - Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens - the default input and/or output devices. Most parameters have identical meaning - to their Pa_OpenStream() counterparts, with the following exceptions: - - If either numInputChannels or numOutputChannels is 0 the respective device - is not opened. This has the same effect as passing paNoDevice in the device - arguments to Pa_OpenStream(). +/** A simplified version of Pa_OpenStream() that opens the default input + and/or output devices. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. - sampleFormat applies to both the input and output buffers. + @param numInputChannels The number of channels of sound that will be supplied + to the stream callback or returned by Pa_ReadStream. It can range from 1 to + the value of maxInputChannels in the PaDeviceInfo record for the default input + device. If 0 the stream is opened as an output-only stream. + + @param numOutputChannels The number of channels of sound to be delivered to the + stream callback or passed to Pa_WriteStream. It can range from 1 to the value + of maxOutputChannels in the PaDeviceInfo record for the default output dvice. + If 0 the stream is opened as an output-only stream. + + @param sampleFormat The sample format of both the input and output buffers + provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. + sampleFormat may be any of the formats described by the PaSampleFormat + enumeration. + + @param sampleRate Same as Pa_OpenStream parameter of the same name. + @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. + @param streamCallback Same as Pa_OpenStream parameter of the same name. + @param userData Same as Pa_OpenStream parameter of the same name. -*/ + @return As for Pa_OpenStream -PaError Pa_OpenDefaultStream( PortAudioStream** stream, + @see Pa_OpenStream, PaStreamCallback +*/ +PaError Pa_OpenDefaultStream( PaStream** stream, int numInputChannels, int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, unsigned long framesPerBuffer, - unsigned long numberOfBuffers, - PortAudioCallback *callback, + PaStreamCallback *streamCallback, void *userData ); -/* - Pa_CloseStream() closes an audio stream, flushing any pending buffers. +/** Closes an audio stream. If the audio stream is active it + discards any pending buffers as if Pa_AbortStream() had been called. */ +PaError Pa_CloseStream( PaStream *stream ); -PaError Pa_CloseStream( PortAudioStream* ); -/* - Pa_StartStream() and Pa_StopStream() begin and terminate audio processing. - Pa_StopStream() waits until all pending audio buffers have been played. - Pa_AbortStream() stops playing immediately without waiting for pending +/** Functions of type PaStreamFinishedCallback are implemented by PortAudio + clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback + function. Once registered they are called when the stream becomes inactive + (ie once a call to Pa_StopStream() will not block). + A stream will become inactive after the stream callback returns non-zero, + or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio + output, if the stream callback returns paComplete, or Pa_StopStream is called, + the stream finished callback will not be called until all generated sample data + has been played. + + @param userData The userData parameter supplied to Pa_OpenStream() + + @see Pa_SetStreamFinishedCallback +*/ +typedef void PaStreamFinishedCallback( void *userData ); + + +/** Register a stream finished callback function which will be called when the + stream becomes inactive. See the description of PaStreamFinishedCallback for + further details about when the callback will be called. + + @param stream a pointer to a PaStream that is in the stopped state - if the + stream is not stopped, the stream's finished callback will remain unchanged + and an error code will be returned. + + @param streamFinishedCallback a pointer to a function with the same signature + as PaStreamFinishedCallback, that will be called when the stream becomes + inactive. Passing NULL for this parameter will un-register a previously + registered stream finished callback function. + + @return on success returns paNoError, otherwise an error code indicating the cause + of the error. + + @see PaStreamFinishedCallback +*/ +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); + + +/** Commences audio processing. +*/ +PaError Pa_StartStream( PaStream *stream ); + + +/** Terminates audio processing. It waits until all pending + audio buffers have been played before it returns. +*/ +PaError Pa_StopStream( PaStream *stream ); + + +/** Terminates audio processing immediately without waiting for pending buffers to complete. - */ +PaError Pa_AbortStream( PaStream *stream ); -PaError Pa_StartStream( PortAudioStream *stream ); -PaError Pa_StopStream( PortAudioStream *stream ); +/** Determine whether the stream is stopped. + A stream is considered to be stopped prior to a successful call to + Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. + If a stream callback returns a value other than paContinue the stream is NOT + considered to be stopped. -PaError Pa_AbortStream( PortAudioStream *stream ); + @return Returns one (1) when the stream is stopped, zero (0) when + the stream is running or, a PaErrorCode (which are always negative) if + PortAudio is not initialized or an error is encountered. -/* - Pa_StreamActive() returns one (1) when the stream is active (ie playing - or recording audio), zero (0) when not playing, or a negative error number - if the stream is invalid. - The stream is active between calls to Pa_StartStream() and Pa_StopStream(), - but may also become inactive if the callback returns a non-zero value. - In the latter case, the stream is considered inactive after the last - buffer has finished playing. - + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive */ +PaError Pa_IsStreamStopped( PaStream *stream ); -PaError Pa_StreamActive( PortAudioStream *stream ); -/* - Pa_StreamTime() returns the current output time in samples for the stream. - This time may be used as a time reference (for example synchronizing audio to - MIDI). - +/** Determine whether the stream is active. + A stream is active after a successful call to Pa_StartStream(), until it + becomes inactive either as a result of a call to Pa_StopStream() or + Pa_AbortStream(), or as a result of a return value other than paContinue from + the stream callback. In the latter case, the stream is considered inactive + after the last buffer has finished playing. + + @return Returns one (1) when the stream is active (ie playing or recording + audio), zero (0) when not playing or, a PaErrorCode (which are always negative) + if PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped */ +PaError Pa_IsStreamActive( PaStream *stream ); -PaTimestamp Pa_StreamTime( PortAudioStream *stream ); -/* - Pa_GetCPULoad() returns the CPU Load for the stream. - The "CPU Load" is a fraction of total CPU time consumed by the stream's + +/** A structure containing unchanging information about an open stream. + @see Pa_GetStreamInfo +*/ + +typedef struct PaStreamInfo +{ + /** this is struct version 1 */ + int structVersion; + + /** The input latency of the stream in seconds. This value provides the most + accurate estimate of input latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for output-only streams. + @see PaTime + */ + PaTime inputLatency; + + /** The output latency of the stream in seconds. This value provides the most + accurate estimate of output latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for input-only streams. + @see PaTime + */ + PaTime outputLatency; + + /** The sample rate of the stream in Hertz (samples per second). In cases + where the hardware sample rate is inaccurate and PortAudio is aware of it, + the value of this field may be different from the sampleRate parameter + passed to Pa_OpenStream(). If information about the actual hardware sample + rate is not available, this field will have the same value as the sampleRate + parameter passed to Pa_OpenStream(). + */ + double sampleRate; + +} PaStreamInfo; + + +/** Retrieve a pointer to a PaStreamInfo structure containing information + about the specified stream. + @return A pointer to an immutable PaStreamInfo structure. If the stream + parameter invalid, or an error is encountered, the function returns NULL. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid until the specified stream is closed. + + @see PaStreamInfo +*/ +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); + + +/** Determine the current time for the stream according to the same clock used + to generate buffer timestamps. This time may be used for syncronising other + events to the audio stream, for example synchronizing audio to MIDI. + + @return The stream's current time in seconds, or 0 if an error occurred. + + @see PaTime, PaStreamCallback +*/ +PaTime Pa_GetStreamTime( PaStream *stream ); + + +/** Retrieve CPU usage information for the specified stream. + The "CPU Load" is a fraction of total CPU time consumed by a callback stream's audio processing routines including, but not limited to the client supplied - callback. - A value of 0.5 would imply that PortAudio and the sound generating - callback was consuming roughly 50% of the available CPU time. - This function may be called from the callback function or the application. - + stream callback. This function does not work with blocking read/write streams. + + This function may be called from the stream callback function or the + application. + + @return + A floating point value, typically between 0.0 and 1.0, where 1.0 indicates + that the stream callback is consuming the maximum number of CPU cycles possible + to maintain real-time operation. A value of 0.5 would imply that PortAudio and + the stream callback was consuming roughly 50% of the available CPU time. The + return value may exceed 1.0. A value of 0.0 will always be returned for a + blocking read/write stream, or if an error occurrs. */ +double Pa_GetStreamCpuLoad( PaStream* stream ); -double Pa_GetCPULoad( PortAudioStream* stream ); -/* - Pa_GetMinNumBuffers() returns the minimum number of buffers required by - the current host based on minimum latency. - On the PC, for the DirectSound implementation, latency can be optionally set - by user by setting an environment variable. - For example, to set latency to 200 msec, put: - - set PA_MIN_LATENCY_MSEC=200 - - in the AUTOEXEC.BAT file and reboot. - If the environment variable is not set, then the latency will be determined - based on the OS. Windows NT has higher latency than Win95. +/** Read samples from an input stream. The function doesn't return until + the entire buffer has been filled - this may involve waiting for the operating + system to supply the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the inputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + inputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be read into buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or PaInputOverflowed if input + data was discarded by PortAudio after the previous call and before this call. */ +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ); -int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate ); -/* - Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds. - You may sleep longer than the requested time so don't rely on this for - accurate musical timing. - - Pa_Sleep() is provided as a convenience for authors of portable code (such as - the tests and examples in the PortAudio distribution.) - +/** Write samples to an output stream. This function doesn't return until the + entire buffer has been consumed - this may involve waiting for the operating + system to consume the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the outputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + outputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be written from buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or paOutputUnderflowed if + additional output data was inserted after the previous call and before this + call. */ +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ); -void Pa_Sleep( long msec ); -/* - Pa_GetSampleSize() returns the size in bytes of a single sample in the - supplied PaSampleFormat, or paSampleFormatNotSupported if the format is - no supported. - +/** Retrieve the number of frames that can be read from the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be read from the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. */ +signed long Pa_GetStreamReadAvailable( PaStream* stream ); + + +/** Retrieve the number of frames that can be written to the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be written to the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + +/* Miscellaneous utilities */ + +/** Retrieve the size of a given sample format in bytes. + + @return The size in bytes of a single sample in the specified format, + or paSampleFormatNotSupported if the format is not supported. +*/ PaError Pa_GetSampleSize( PaSampleFormat format ); +/** Put the caller to sleep for at least 'msec' milliseconds. This function is + provided only as a convenience for authors of portable code (such as the tests + and examples in the PortAudio distribution.) + + The function may sleep longer than requested so don't rely on this for accurate + musical timing. +*/ +void Pa_Sleep( long msec ); + + + #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* PORT_AUDIO_H */ +#endif /* PORTAUDIO_H */ --- espeak-1.41.orig/src/Makefile +++ espeak-1.41/src/Makefile @@ -68,7 +68,7 @@ SRCS3 = espeak.cpp OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) -LIBS3=-lstdc++ -L . -lespeak +LIBS3=-L . -lespeak CXXFLAGS=-O2 @@ -77,7 +77,7 @@ mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG) .cpp.o: - $(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $< + $(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -I. -c -fno-exceptions $< $(BIN_NAME): $(OBJS1) $(CXX) -o $@ $(OBJS1) $(LIBS1) @@ -88,7 +88,7 @@ x_%.o: %.cpp - $(CXX) $(CXXFLAGS) $(USE_AUDIO) -Wall -fpic -fvisibility=hidden -pedantic \ + $(CXX) $(CXXFLAGS) $(USE_AUDIO) -Wall -fpic -fvisibility=hidden \ -I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o $(LIB_NAME): $(OBJS2)