debian/0000775000000000000000000000000012240466351007173 5ustar debian/libttspico0.dirs0000664000000000000000000000001012174160016012274 0ustar usr/lib debian/copyright0000664000000000000000000000364012174160016011124 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: SVOX Pico Source: https://android.googlesource.com/platform/external/svox/ Disclaimer: Due to the license restrictions described below, the packages are formally part of Debian's non-free category rather than Debian proper ("main"). X-Autobuild: yes The package is freely rebuildable and redistribuable. Files: * Copyright: 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland 2009, The Android Open Source Project License: Apache-2.0 Files: pico/lang/*: Copyright: 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland 2009, The Android Open Source Project License: other Claims to be Apache-2.0 but the source code is not included. At least, it is redistribuable. See http://code.google.com/p/android/issues/detail?id=4415 Files: pico/lib/picofftsg.c: Copyright: 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland Adapted from http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html (Copyright Takuya OOURA, 1996-2001) License: Apache-2.0 Files: pico/bin/pico2wave.c: Copyright: 2009 Mathieu Parent License: Apache-2.0 Files: debian/*: Copyright: 2009-2013 Mathieu Parent License: Apache-2.0 License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the complete text of the Apache version 2.0 license can be found in `/usr/share/common-licenses/Apache-2.0'. debian/README.Source0000664000000000000000000000165712174160016011316 0ustar Git main branches: * upstream (synced from https://android.googlesource.com/platform/external/svox) * upstream+patches (from upstream): non-Debian specific patches * debian-sid (from upstream+patches) Quick setup: git clone ssh://git.debian.org/git/collab-maint/svox.git cd svox/ git branch debian-sid origin/debian-sid git branch upstream origin/upstream git branch upstream+patches origin/upstream+patches git remote add android https://android.googlesource.com/platform/external/svox git fetch android git branch android-master android/master Quick merge: git checkout upstream git merge android/master git checkout upstream+patches git merge upstream git checkout debian-sid git merge upstream+patches To build the package, run: git-buildpackage (you can also follow https://wiki.ubuntu.com/PbuilderHowto and add the following option: --git-builder="DIST=sid pdebuild --debbuildopts '-i\.git -I.git'") debian/libttspico0.install0000664000000000000000000000002412174160016013006 0ustar usr/lib/*/lib*.so.* debian/pico/0000775000000000000000000000000012240461734010125 5ustar debian/pico/bin/0000775000000000000000000000000012240461734010675 5ustar debian/pico/bin/pico2wave.c0000664000000000000000000003261612240461734012750 0ustar /* pico2wave.c * Copyright (C) 2009 Mathieu Parent * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Convert text to .wav using svox text-to-speech system. * */ #include #include #include #include #include #include #include /* adaptation layer defines */ #define PICO_MEM_SIZE 2500000 #define DummyLen 100000000 /* string constants */ #define MAX_OUTBUF_SIZE 128 #ifdef picolangdir const char * PICO_LINGWARE_PATH = picolangdir "/"; #else const char * PICO_LINGWARE_PATH = "./lang/"; #endif const char * PICO_VOICE_NAME = "PicoVoice"; /* supported voices Pico does not seperately specify the voice and locale. */ const char * picoSupportedLangIso3[] = { "eng", "eng", "deu", "spa", "fra", "ita" }; const char * picoSupportedCountryIso3[] = { "USA", "GBR", "DEU", "ESP", "FRA", "ITA" }; const char * picoSupportedLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; const char * picoInternalLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; const char * picoInternalTaLingware[] = { "en-US_ta.bin", "en-GB_ta.bin", "de-DE_ta.bin", "es-ES_ta.bin", "fr-FR_ta.bin", "it-IT_ta.bin" }; const char * picoInternalSgLingware[] = { "en-US_lh0_sg.bin", "en-GB_kh0_sg.bin", "de-DE_gl0_sg.bin", "es-ES_zl0_sg.bin", "fr-FR_nk0_sg.bin", "it-IT_cm0_sg.bin" }; const char * picoInternalUtppLingware[] = { "en-US_utpp.bin", "en-GB_utpp.bin", "de-DE_utpp.bin", "es-ES_utpp.bin", "fr-FR_utpp.bin", "it-IT_utpp.bin" }; const int picoNumSupportedVocs = 6; /* adapation layer global variables */ void * picoMemArea = NULL; pico_System picoSystem = NULL; pico_Resource picoTaResource = NULL; pico_Resource picoSgResource = NULL; pico_Resource picoUtppResource = NULL; pico_Engine picoEngine = NULL; pico_Char * picoTaFileName = NULL; pico_Char * picoSgFileName = NULL; pico_Char * picoUtppFileName = NULL; pico_Char * picoTaResourceName = NULL; pico_Char * picoSgResourceName = NULL; pico_Char * picoUtppResourceName = NULL; int picoSynthAbort = 0; int main(int argc, const char *argv[]) { char * wavefile = NULL; char * lang = "en-US"; int langIndex = -1, langIndexTmp = -1; char * text; int8_t * buffer; size_t bufferSize = 256; /* Parsing options */ poptContext optCon; /* context for parsing command-line options */ int opt; /* used for argument parsing */ struct poptOption optionsTable[] = { { "wave", 'w', POPT_ARG_STRING, &wavefile, 0, "Write output to this WAV file (extension SHOULD be .wav)", "filename.wav" }, { "lang", 'l', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &lang, 0, "Language", "lang" }, POPT_AUTOHELP POPT_TABLEEND }; optCon = poptGetContext(NULL, argc, argv, optionsTable, POPT_CONTEXT_POSIXMEHARDER); poptSetOtherOptionHelp(optCon, ""); /* Reporting about invalid extra options */ while ((opt = poptGetNextOpt(optCon)) != -1) { switch (opt) { default: fprintf(stderr, "Invalid option %s: %s\n", poptBadOption(optCon, 0), poptStrerror(opt)); poptPrintHelp(optCon, stderr, 0); exit(1); } } /* Mandatory option: --wave */ if(!wavefile) { fprintf(stderr, "Mandatory option: %s\n\n", "--wave=filename.wav"); poptPrintHelp(optCon, stderr, 0); exit(1); } /* option: --lang */ for(langIndexTmp =0; langIndexTmp */ const char **extra_argv; extra_argv = poptGetArgs(optCon); if(extra_argv) { text = (char *) &(*extra_argv)[0]; } else { //TODO: stdin not supported yet. fprintf(stderr, "Missing argument: %s\n\n", ""); poptPrintHelp(optCon, stderr, 0); exit(1); } poptFreeContext(optCon); buffer = malloc( bufferSize ); int ret, getstatus; pico_Char * inp = NULL; pico_Char * local_text = NULL; short outbuf[MAX_OUTBUF_SIZE/2]; pico_Int16 bytes_sent, bytes_recv, text_remaining, out_data_type; pico_Retstring outMessage; picoSynthAbort = 0; picoMemArea = malloc( PICO_MEM_SIZE ); if((ret = pico_initialize( picoMemArea, PICO_MEM_SIZE, &picoSystem ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot initialize pico (%i): %s\n", ret, outMessage); goto terminate; } /* Load the text analysis Lingware resource file. */ picoTaFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoTaFileName, PICO_LINGWARE_PATH); strcat((char *) picoTaFileName, (const char *) picoInternalTaLingware[langIndex]); if((ret = pico_loadResource( picoSystem, picoTaFileName, &picoTaResource ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot load text analysis resource file (%i): %s\n", ret, outMessage); goto unloadTaResource; } /* Load the signal generation Lingware resource file. */ picoSgFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoSgFileName, PICO_LINGWARE_PATH); strcat((char *) picoSgFileName, (const char *) picoInternalSgLingware[langIndex]); if((ret = pico_loadResource( picoSystem, picoSgFileName, &picoSgResource ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot load signal generation Lingware resource file (%i): %s\n", ret, outMessage); goto unloadSgResource; } /* Load the utpp Lingware resource file if exists - NOTE: this file is optional and is currently not used. Loading is only attempted for future compatibility. If this file is not present the loading will still succeed. // picoUtppFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoUtppFileName, PICO_LINGWARE_PATH); strcat((char *) picoUtppFileName, (const char *) picoInternalUtppLingware[langIndex]); ret = pico_loadResource( picoSystem, picoUtppFileName, &picoUtppResource ); pico_getSystemStatusMessage(picoSystem, ret, outMessage); printf("pico_loadResource: %i: %s\n", ret, outMessage); */ /* Get the text analysis resource name. */ picoTaResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); if((ret = pico_getResourceName( picoSystem, picoTaResource, (char *) picoTaResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot get the text analysis resource name (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Get the signal generation resource name. */ picoSgResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); if((ret = pico_getResourceName( picoSystem, picoSgResource, (char *) picoSgResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot get the signal generation resource name (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Create a voice definition. */ if((ret = pico_createVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot create voice definition (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Add the text analysis resource to the voice. */ if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoTaResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot add the text analysis resource to the voice (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Add the signal generation resource to the voice. */ if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoSgResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot add the signal generation resource to the voice (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Create a new Pico engine. */ if((ret = pico_newEngine( picoSystem, (const pico_Char *) PICO_VOICE_NAME, &picoEngine ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot create a new pico engine (%i): %s\n", ret, outMessage); goto disposeEngine; } local_text = (pico_Char *) text ; text_remaining = strlen((const char *) local_text) + 1; inp = (pico_Char *) local_text; size_t bufused = 0; picoos_Common common = (picoos_Common) pico_sysGetCommon(picoSystem); picoos_SDFile sdOutFile = NULL; picoos_bool done = TRUE; if(TRUE != (done = picoos_sdfOpenOut(common, &sdOutFile, (picoos_char *) wavefile, SAMPLE_FREQ_16KHZ, PICOOS_ENC_LIN))) { fprintf(stderr, "Cannot open output wave file\n"); ret = 1; goto disposeEngine; } /* synthesis loop */ while (text_remaining) { /* Feed the text into the engine. */ if((ret = pico_putTextUtf8( picoEngine, inp, text_remaining, &bytes_sent ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot put Text (%i): %s\n", ret, outMessage); goto disposeEngine; } text_remaining -= bytes_sent; inp += bytes_sent; do { if (picoSynthAbort) { goto disposeEngine; } /* Retrieve the samples and add them to the buffer. */ getstatus = pico_getData( picoEngine, (void *) outbuf, MAX_OUTBUF_SIZE, &bytes_recv, &out_data_type ); if((getstatus !=PICO_STEP_BUSY) && (getstatus !=PICO_STEP_IDLE)){ pico_getSystemStatusMessage(picoSystem, getstatus, outMessage); fprintf(stderr, "Cannot get Data (%i): %s\n", getstatus, outMessage); goto disposeEngine; } if (bytes_recv) { if ((bufused + bytes_recv) <= bufferSize) { memcpy(buffer+bufused, (int8_t *) outbuf, bytes_recv); bufused += bytes_recv; } else { done = picoos_sdfPutSamples( sdOutFile, bufused / 2, (picoos_int16*) (buffer)); bufused = 0; memcpy(buffer, (int8_t *) outbuf, bytes_recv); bufused += bytes_recv; } } } while (PICO_STEP_BUSY == getstatus); /* This chunk of synthesis is finished; pass the remaining samples. */ if (!picoSynthAbort) { done = picoos_sdfPutSamples( sdOutFile, bufused / 2, (picoos_int16*) (buffer)); } picoSynthAbort = 0; } if(TRUE != (done = picoos_sdfCloseOut(common, &sdOutFile))) { fprintf(stderr, "Cannot close output wave file\n"); ret = 1; goto disposeEngine; } disposeEngine: if (picoEngine) { pico_disposeEngine( picoSystem, &picoEngine ); pico_releaseVoiceDefinition( picoSystem, (pico_Char *) PICO_VOICE_NAME ); picoEngine = NULL; } unloadUtppResource: if (picoUtppResource) { pico_unloadResource( picoSystem, &picoUtppResource ); picoUtppResource = NULL; } unloadSgResource: if (picoSgResource) { pico_unloadResource( picoSystem, &picoSgResource ); picoSgResource = NULL; } unloadTaResource: if (picoTaResource) { pico_unloadResource( picoSystem, &picoTaResource ); picoTaResource = NULL; } terminate: if (picoSystem) { pico_terminate(&picoSystem); picoSystem = NULL; } exit(ret); } debian/pico/configure.in0000664000000000000000000000046112240461726012440 0ustar dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([svox], [1.0], [math.parent@gmail.com]) AM_INIT_AUTOMAKE([1.9 foreign]) AC_PROG_CC LT_INIT AC_PROG_LIBTOOL AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_CONFIG_MACRO_DIR([m4]) AC_CHECK_LIB(popt, poptGetContext) debian/pico/autogen.sh0000664000000000000000000000102712240461720012116 0ustar #!/bin/sh #created by aclocal rm -rf autom4te.cache rm -f aclocal.m4 #created by libtoolize rm -rf m4 rm -f ltmain.sh #created by autoconf rm -f configure #created by automake rm -f install-sh missing depcomp Makefile.in config.guess config.sub #created by ./configure rm -rf .deps rm -f Makefile config.log config.status libtool if [ "$1" = "clean" ]; then exit fi IPATHS="-I lib" aclocal $IPATHS libtoolize autoconf $IPATHS automake --add-missing rm -rf autom4te.cache echo "Now run ./configure and then make." exit 0 debian/pico/Makefile.am0000664000000000000000000000334012240461734012161 0ustar ## Makefile.am -- Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libttspico.la libttspico_la_SOURCES = \ lib/picoacph.c \ lib/picoapi.c \ lib/picobase.c \ lib/picocep.c \ lib/picoctrl.c \ lib/picodata.c \ lib/picodbg.c \ lib/picoextapi.c \ lib/picofftsg.c \ lib/picokdbg.c \ lib/picokdt.c \ lib/picokfst.c \ lib/picoklex.c \ lib/picoknow.c \ lib/picokpdf.c \ lib/picokpr.c \ lib/picoktab.c \ lib/picoos.c \ lib/picopal.c \ lib/picopam.c \ lib/picopr.c \ lib/picorsrc.c \ lib/picosa.c \ lib/picosig.c \ lib/picosig2.c \ lib/picospho.c \ lib/picotok.c \ lib/picotrns.c \ lib/picowa.c libttspico_ladir = $(includedir) libttspico_la_HEADERS = \ lib/picoacph.h \ lib/picoapid.h \ lib/picoapi.h \ lib/picobase.h \ lib/picocep.h \ lib/picoctrl.h \ lib/picodata.h \ lib/picodbg.h \ lib/picodefs.h \ lib/picodsp.h \ lib/picoextapi.h \ lib/picofftsg.h \ lib/picokdbg.h \ lib/picokdt.h \ lib/picokfst.h \ lib/picoklex.h \ lib/picoknow.h \ lib/picokpdf.h \ lib/picokpr.h \ lib/picoktab.h \ lib/picoos.h \ lib/picopal.h \ lib/picopam.h \ lib/picopltf.h \ lib/picopr.h \ lib/picorsrc.h \ lib/picosa.h \ lib/picosig2.h \ lib/picosig.h \ lib/picospho.h \ lib/picotok.h \ lib/picotrns.h \ lib/picowa.h picolangdir = $(datadir)/pico/lang picolang_DATA = \ lang/de-DE*.bin \ lang/en-GB*.bin \ lang/en-US*.bin \ lang/es-ES*.bin \ lang/fr-FR*.bin \ lang/it-IT*.bin bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ libttspico.la -lm -lpopt pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib debian/changelog0000664000000000000000000000621012240464113011036 0ustar svox (1.0+git20130326-1ubuntu1) trusty; urgency=low * d/patches/0009-Fix-link-order.patch: Added to resolve FTBFS with new toolchain. -- Daniel T Chen Tue, 12 Nov 2013 12:38:13 -0500 svox (1.0+git20130326-1) unstable; urgency=low [ Samuel Thibault ] * control: - Make libttspico-dev Multi-Arch: same. - Move libttspico0 to non-free/libs. - svox2wave -> pico2wave. - Add automake1.9 build-dep. [ Mathieu Parent ] * New upstream snapshot * Move to debhelper 9: - d/compat - d/control: Build-Depends upgraded to dh9 * With lintian's assistance - Fix copyright format URL - remove "(C)" in copyright file - Update upstream source URL - Update copyright fields (Format-Specification to Format, and Contact to Upstream-Contact) - Fix Vcs-* fields - Standards-Version: 3.9.3 -> 3.9.4 (no changes) * Added gbp.conf -- Samuel Thibault Sat, 13 Jul 2013 19:57:25 +0200 svox (1.0+git20110131-2) unstable; urgency=low * control: - Add myself as uploader. - Depend on hardening-check. - Bump Standards-Version to 3.9.3 (no changes). - Set libttspico0 multi-arch: same. - Set libttspico-data multi-arch: foreign. * rules: - Set DEB_BUILD_HARDENING=1 to enable hardening. - Set multi-arch libdir. * debian/libttspico0.install,libttspico-dev.install: Use multi-arch path. -- Samuel Thibault Fri, 08 Jun 2012 23:17:24 +0200 svox (1.0+git20110131-1) unstable; urgency=low [ Samuel Thibault ] * d/patches/0008-64bits.patch: New patch to fix execution on 64bit archs. * d/control: Bump Standards-Version to 3.9.2 (no change needed). [ Mathieu Parent ] * New upstream snapshot, updated symbols * Mention explicitly required .wav extension (Closes: #596135) * Specify libraries in the proper variable in Makefile.am (Closes: #616406) * Merged 0007-Add-to-pico-lang-path.patch into 0006-Set-picolangdir.patch * d/control: Maintainer is now Debian Accessibility Team (/me is Uploader) * d/control: Fix "package description formating issues" (Closes: #582689) * d/control: Breaks+Replaces instead of Conflicts as recommended by lintian * d/control, debian/copyright: Allow automatic building * d/README.Source: more info on workflow * d/watch: removed, this points to android versions -- Mathieu Parent Sun, 03 Jul 2011 14:32:51 +0200 svox (1.0+git20100205-2) unstable; urgency=low * Switch to dpkg-source 3.0 (quilt) format * Fix "pico2wave should be in a separate package" by creating a libttspico-utils package containing only pico2wave (Closes: #582092) -- Mathieu Parent Fri, 21 May 2010 16:03:21 +0200 svox (1.0+git20100205-1) unstable; urgency=low * Initial release. (Closes: #552499) * Git snapshot (2010-02-05) * non-free because source for lingware files is not included * debian/rules: make autogen.sh executable before executing it * debian/control: Build-depends on automake, autoconf, libtool * debian/control: Build-depends on libpopt-dev -- Mathieu Parent Fri, 12 Mar 2010 19:29:55 +0100 debian/libttspico0.symbols0000664000000000000000000002733512174160016013046 0ustar libttspico.so.0 libttspico0 #MINVER# bitrv208neg@Base 1.0 bitrv216neg@Base 1.0 bitrv2conj@Base 1.0 cftb040@Base 1.0 cftb1st@Base 1.0 dfct_nmf@Base 1.0 env_spec@Base 1.0 getMemUsage@Base 1.0 impulse_response@Base 1.0 is_valid_itemtype@Base 1.0 is_valid_system_handle@Base 1.0 mel_2_lin_init@Base 1.0 mel_2_lin_lookup@Base 1.0 norm_result@Base 1.0 overlap_add@Base 1.0 phase_spec2@Base 1.0 pico_addResourceToVoiceDefinition@Base 1.0 pico_createVoiceDefinition@Base 1.0 pico_disposeEngine@Base 1.0 pico_getData@Base 1.0 pico_getEngineStatusMessage@Base 1.0 pico_getEngineWarning@Base 1.0 pico_getNrEngineWarnings@Base 1.0 pico_getNrSystemWarnings@Base 1.0 pico_getResourceName@Base 1.0 pico_getSystemStatusMessage@Base 1.0 pico_getSystemWarning@Base 1.0 pico_initialize@Base 1.0 pico_initialize_priv@Base 1.0 pico_loadResource@Base 1.0 pico_newEngine@Base 1.0 pico_putTextUtf8@Base 1.0 pico_releaseVoiceDefinition@Base 1.0 pico_resetEngine@Base 1.0 pico_sysGetCommon@Base 1.0 pico_terminate@Base 1.0 pico_unloadResource@Base 1.0 picoacph_newAccPhrUnit@Base 1.0 picobase_get_next_utf8char@Base 1.0 picobase_get_next_utf8charpos@Base 1.0 picobase_get_prev_utf8char@Base 1.0 picobase_get_prev_utf8charpos@Base 1.0 picobase_is_utf8_lowercase@Base 1.0 picobase_is_utf8_uppercase@Base 1.0 picobase_lowercase_utf8_str@Base 1.0 picobase_uppercase_utf8_str@Base 1.0 picobase_utf8_length@Base 1.0 picocep_newCepUnit@Base 1.0 picoctrl_disposeControl@Base 1.0 picoctrl_disposeEngine@Base 1.0 picoctrl_engFeedText@Base 1.0 picoctrl_engFetchOutputItemBytes@Base 1.0 picoctrl_engGetCommon@Base 1.0 picoctrl_engReset@Base 1.0 picoctrl_engResetExceptionManager@Base 1.0 picoctrl_getLastProducedItemType@Base 1.0 picoctrl_getLastScheduledPU@Base 1.0 picoctrl_isValidEngineHandle@Base 1.0 picoctrl_isValidResourceHandle@Base 1.0 picoctrl_newControl@Base 1.0 picoctrl_newEngine@Base 1.0 picodata_cbGetCh@Base 1.0 picodata_cbGetFrontItemType@Base 1.0 picodata_cbGetItem@Base 1.0 picodata_cbGetSpeechData@Base 1.0 picodata_cbPutCh@Base 1.0 picodata_cbPutItem@Base 1.0 picodata_cbReset@Base 1.0 picodata_copy_item@Base 1.0 picodata_disposeCharBuffer@Base 1.0 picodata_disposeProcessingUnit@Base 1.0 picodata_getCbIn@Base 1.0 picodata_getCbOut@Base 1.0 picodata_getPuTypeFromExtension@Base 1.0 picodata_get_default_buf_size@Base 1.0 picodata_get_iteminfo@Base 1.0 picodata_get_itemparts@Base 1.0 picodata_get_itemparts_nowarn@Base 1.0 picodata_is_valid_item@Base 1.0 picodata_is_valid_itemhead@Base 1.0 picodata_mapPAStrToPAIds@Base 1.0 picodata_newCharBuffer@Base 1.0 picodata_newProcessingUnit@Base 1.0 picodata_put_itemparts@Base 1.0 picodata_setCbIn@Base 1.0 picodata_setCbOut@Base 1.0 picodata_set_iteminfo1@Base 1.0 picodata_set_iteminfo2@Base 1.0 picodata_set_itemlen@Base 1.0 picodata_transformDurations@Base 1.0 picoext_getEngineMemUsage@Base 1.0 picoext_getLastProducedItemType@Base 1.0 picoext_getLastScheduledPU@Base 1.0 picoext_getSystemMemUsage@Base 1.0 picoext_getVersionInfo@Base 1.0 picoext_initialize@Base 1.0 picoext_setLogFile@Base 1.0 picoext_setTraceFilterFN@Base 1.0 picoext_setTraceLevel@Base 1.0 picokdt_dtACCclassify@Base 1.0 picokdt_dtACCconstructInVec@Base 1.0 picokdt_dtACCdecomposeOutClass@Base 1.0 picokdt_dtG2Pclassify@Base 1.0 picokdt_dtG2PconstructInVec@Base 1.0 picokdt_dtG2PdecomposeOutClass@Base 1.0 picokdt_dtPAMclassify@Base 1.0 picokdt_dtPAMconstructInVec@Base 1.0 picokdt_dtPAMdecomposeOutClass@Base 1.0 picokdt_dtPHRclassify@Base 1.0 picokdt_dtPHRconstructInVec@Base 1.0 picokdt_dtPHRdecomposeOutClass@Base 1.0 picokdt_dtPosDclassify@Base 1.0 picokdt_dtPosDconstructInVec@Base 1.0 picokdt_dtPosDdecomposeOutClass@Base 1.0 picokdt_dtPosDreverseMapOutFixed@Base 1.0 picokdt_dtPosPclassify@Base 1.0 picokdt_dtPosPconstructInVec@Base 1.0 picokdt_dtPosPdecomposeOutClass@Base 1.0 picokdt_getDtACC@Base 1.0 picokdt_getDtG2P@Base 1.0 picokdt_getDtPAM@Base 1.0 picokdt_getDtPHR@Base 1.0 picokdt_getDtPosD@Base 1.0 picokdt_getDtPosP@Base 1.0 picokdt_specializeDtKnowledgeBase@Base 1.0 picokfst_getFST@Base 1.0 picokfst_kfstGetFSTSizes@Base 1.0 picokfst_kfstGetNextInEpsTrans@Base 1.0 picokfst_kfstGetNextPair@Base 1.0 picokfst_kfstGetTrans@Base 1.0 picokfst_kfstGetTransductionMode@Base 1.0 picokfst_kfstIsAcceptingState@Base 1.0 picokfst_kfstStartInEpsTransSearch@Base 1.0 picokfst_kfstStartPairSearch@Base 1.0 picokfst_specializeFSTKnowledgeBase@Base 1.0 picoklex_getLex@Base 1.0 picoklex_lexIndLookup@Base 1.0 picoklex_lexLookup@Base 1.0 picoklex_specializeLexKnowledgeBase@Base 1.0 picoknow_disposeKnowledgeBase@Base 1.0 picoknow_newKnowledgeBase@Base 1.0 picokpdf_getPdfDUR@Base 1.0 picokpdf_getPdfMUL@Base 1.0 picokpdf_getPdfPHS@Base 1.0 picokpdf_specializePdfKnowledgeBase@Base 1.0 picokpr_getAttrValArrInt32@Base 1.0 picokpr_getCtxArrLen@Base 1.0 picokpr_getCtxCtxNameOfs@Base 1.0 picokpr_getCtxNetNameOfs@Base 1.0 picokpr_getCtxProdNameOfs@Base 1.0 picokpr_getLexCat@Base 1.0 picokpr_getOutItemArgOfs@Base 1.0 picokpr_getOutItemNextOfs@Base 1.0 picokpr_getOutItemStr@Base 1.0 picokpr_getOutItemStrOfs@Base 1.0 picokpr_getOutItemType@Base 1.0 picokpr_getOutItemVal@Base 1.0 picokpr_getPreproc@Base 1.0 picokpr_getPreprocNetName@Base 1.0 picokpr_getProdATokOfs@Base 1.0 picokpr_getProdArrLen@Base 1.0 picokpr_getProdETokOfs@Base 1.0 picokpr_getProdNameOfs@Base 1.0 picokpr_getProdPrefCost@Base 1.0 picokpr_getTokAltLOfs@Base 1.0 picokpr_getTokAltROfs@Base 1.0 picokpr_getTokAttribOfs@Base 1.0 picokpr_getTokNextOfs@Base 1.0 picokpr_getTokSetNP@Base 1.0 picokpr_getTokSetWP@Base 1.0 picokpr_getVarStrPtr@Base 1.0 picokpr_isEqual@Base 1.0 picokpr_isEqualHead@Base 1.0 picokpr_isEqualMid@Base 1.0 picokpr_isEqualTail@Base 1.0 picokpr_specializePreprocKnowledgeBase@Base 1.0 picoktab_disposeFixedIds@Base 1.0 picoktab_getFixedIds@Base 1.0 picoktab_getGraphs@Base 1.0 picoktab_getIntPropPunct@Base 1.0 picoktab_getIntPropTokenSubType@Base 1.0 picoktab_getIntPropTokenType@Base 1.0 picoktab_getIntPropValue@Base 1.0 picoktab_getPauseID@Base 1.0 picoktab_getPhones@Base 1.0 picoktab_getPos@Base 1.0 picoktab_getPosGroup@Base 1.0 picoktab_getPrimstressID@Base 1.0 picoktab_getSecstressID@Base 1.0 picoktab_getStrPropGraphsubs1@Base 1.0 picoktab_getStrPropGraphsubs2@Base 1.0 picoktab_getStrPropLowercase@Base 1.0 picoktab_getSyllboundID@Base 1.0 picoktab_getWordboundID@Base 1.0 picoktab_graphOffset@Base 1.0 picoktab_graphsGetGraphInfo@Base 1.0 picoktab_graphsGetNumEntries@Base 1.0 picoktab_hasDiphthProp@Base 1.0 picoktab_hasGlottProp@Base 1.0 picoktab_hasNonsyllvowelProp@Base 1.0 picoktab_hasSyllconsProp@Base 1.0 picoktab_hasVowelProp@Base 1.0 picoktab_hasVowellikeProp@Base 1.0 picoktab_isPartOfPosGroup@Base 1.0 picoktab_isPause@Base 1.0 picoktab_isPrimstress@Base 1.0 picoktab_isSecstress@Base 1.0 picoktab_isSyllCarrier@Base 1.0 picoktab_isSyllbound@Base 1.0 picoktab_isUniquePos@Base 1.0 picoktab_isWordbound@Base 1.0 picoktab_newFixedIds@Base 1.0 picoktab_specializeGraphsKnowledgeBase@Base 1.0 picoktab_specializeIdsKnowledgeBase@Base 1.0 picoktab_specializePhonesKnowledgeBase@Base 1.0 picoktab_specializePosKnowledgeBase@Base 1.0 picoos_CloseBinary@Base 1.0 picoos_CreateBinary@Base 1.0 picoos_Eof@Base 1.0 picoos_FileExists@Base 1.0 picoos_FileLength@Base 1.0 picoos_GetPos@Base 1.0 picoos_Name@Base 1.0 picoos_OpenBinary@Base 1.0 picoos_ReadByte@Base 1.0 picoos_ReadBytes@Base 1.0 picoos_SetPos@Base 1.0 picoos_WriteByte@Base 1.0 picoos_WriteBytes@Base 1.0 picoos_allocProtMem@Base 1.0 picoos_allocate@Base 1.0 picoos_atoi@Base 1.0 picoos_clearHeader@Base 1.0 picoos_cos@Base 1.0 picoos_deallocProtMem@Base 1.0 picoos_deallocate@Base 1.0 picoos_disposeCommon@Base 1.0 picoos_disposeExceptionManager@Base 1.0 picoos_disposeFile@Base 1.0 picoos_disposeMemoryManager@Base 1.0 picoos_emGetExceptionCode@Base 1.0 picoos_emGetExceptionMessage@Base 1.0 picoos_emGetNumOfWarnings@Base 1.0 picoos_emGetWarningCode@Base 1.0 picoos_emGetWarningMessage@Base 1.0 picoos_emRaiseException@Base 1.0 picoos_emRaiseWarning@Base 1.0 picoos_emReset@Base 1.0 picoos_fabs@Base 1.0 picoos_getHeaderField@Base 1.0 picoos_getMemUsage@Base 1.0 picoos_getSVOXHeaderString@Base 1.0 picoos_get_sep_part_str@Base 1.0 picoos_get_str@Base 1.0 picoos_get_timer@Base 1.0 picoos_has_extension@Base 1.0 picoos_hdrParseHeader@Base 1.0 picoos_mem_copy@Base 1.0 picoos_mem_set@Base 1.0 picoos_newCommon@Base 1.0 picoos_newExceptionManager@Base 1.0 picoos_newFile@Base 1.0 picoos_newMemoryManager@Base 1.0 picoos_protectMem@Base 1.0 picoos_quick_exp@Base 1.0 picoos_raw_malloc@Base 1.0 picoos_readPicoHeader@Base 1.0 picoos_read_le_int16@Base 1.0 picoos_read_le_uint16@Base 1.0 picoos_read_le_uint32@Base 1.0 picoos_read_mem_pi_uint16@Base 1.0 picoos_read_mem_pi_uint32@Base 1.0 picoos_read_pi_int32@Base 1.0 picoos_read_pi_uint16@Base 1.0 picoos_read_pi_uint32@Base 1.0 picoos_sdfCloseIn@Base 1.0 picoos_sdfCloseOut@Base 1.0 picoos_sdfFlushOutput@Base 1.0 picoos_sdfGetSamples@Base 1.0 picoos_sdfOpenIn@Base 1.0 picoos_sdfOpenOut@Base 1.0 picoos_sdfPutSamples@Base 1.0 picoos_setErrorMsg@Base 1.0 picoos_setHeaderField@Base 1.0 picoos_showMemUsage@Base 1.0 picoos_sin@Base 1.0 picoos_slprintf@Base 1.0 picoos_strcat@Base 1.0 picoos_strchr@Base 1.0 picoos_strcmp@Base 1.0 picoos_strcpy@Base 1.0 picoos_string_to_int32@Base 1.0 picoos_string_to_uint32@Base 1.0 picoos_strlcpy@Base 1.0 picoos_strlen@Base 1.0 picoos_strncmp@Base 1.0 picoos_strstr@Base 1.0 picoos_write_le_uint16@Base 1.0 picoos_write_le_uint32@Base 1.0 picoos_write_mem_pi_uint16@Base 1.0 picopal_atoi@Base 1.0 picopal_cos@Base 1.0 picopal_eol@Base 1.0 picopal_fabs@Base 1.0 picopal_fclose@Base 1.0 picopal_feof@Base 1.0 picopal_fflush@Base 1.0 picopal_fget_char@Base 1.0 picopal_flength@Base 1.0 picopal_fopen@Base 1.0 picopal_fread_bytes@Base 1.0 picopal_fseek@Base 1.0 picopal_fwrite_bytes@Base 1.0 picopal_get_fnil@Base 1.0 picopal_get_timer@Base 1.0 picopal_is_fnil@Base 1.0 picopal_mem_copy@Base 1.0 picopal_mem_set@Base 1.0 picopal_mpr_alloc@Base 1.0 picopal_mpr_free@Base 1.0 picopal_mpr_protect@Base 1.0 picopal_quick_exp@Base 1.0 picopal_sin@Base 1.0 picopal_slprintf@Base 1.0 picopal_sprintf@Base 1.0 picopal_strcat@Base 1.0 picopal_strchr@Base 1.0 picopal_strcmp@Base 1.0 picopal_strcpy@Base 1.0 picopal_strlcpy@Base 1.0 picopal_strlen@Base 1.0 picopal_strncmp@Base 1.0 picopal_strstr@Base 1.0 picopal_vslprintf@Base 1.0 picopam_newPamUnit@Base 1.0 picopr_newPreprocUnit@Base 1.0 picorsrc_addResourceToVoiceDefinition@Base 1.0 picorsrc_createDefaultResource@Base 1.0 picorsrc_createVoice@Base 1.0 picorsrc_createVoiceDefinition@Base 1.0 picorsrc_disposeResourceManager@Base 1.0 picorsrc_loadResource@Base 1.0 picorsrc_newResourceManager@Base 1.0 picorsrc_releaseVoice@Base 1.0 picorsrc_releaseVoiceDefinition@Base 1.0 picorsrc_rsrcGetName@Base 1.0 picorsrc_unloadResource@Base 1.0 picosa_newSentAnaUnit@Base 1.0 picosig_newSigUnit@Base 1.0 picospho_newSentPhoUnit@Base 1.0 picotok_newTokenizeUnit@Base 1.0 picotrns_allocate_alt_desc_buf@Base 1.0 picotrns_deallocate_alt_desc_buf@Base 1.0 picotrns_disposeSimpleTransducer@Base 1.0 picotrns_eliminate_epsilons@Base 1.0 picotrns_newSimpleTransducer@Base 1.0 picotrns_stAddWithPlane@Base 1.0 picotrns_stGetSymSequence@Base 1.0 picotrns_stInitialize@Base 1.0 picotrns_stTransduce@Base 1.0 picotrns_transduce@Base 1.0 picotrns_trivial_syllabify@Base 1.0 picotrns_unplane@Base 1.0 picowa_newWordAnaUnit@Base 1.0 prInitialize@Base 1.0 prReset@Base 1.0 prStep@Base 1.0 prSubObjDeallocate@Base 1.0 prTerminate@Base 1.0 pr_process@Base 1.0 pr_processToken@Base 1.0 pr_treatItem@Base 1.0 rdft@Base 1.0 save_transition_frame@Base 1.0 sigAllocate@Base 1.0 sigDeallocate@Base 1.0 sigDspInitialize@Base 1.0 td_psola2@Base 1.0 debian/libttspico-utils.install0000664000000000000000000000001212174160016014061 0ustar usr/bin/* debian/libttspico-dev.install0000664000000000000000000000006112174160016013503 0ustar usr/include/* usr/lib/*/lib*.a usr/lib/*/lib*.so debian/patches/0000775000000000000000000000000012240466327010625 5ustar debian/patches/0002-gitignore-for-autotools-files.patch0000664000000000000000000000153712174160016020125 0ustar From b56b0a4bdf3e11271caab744f532cb055c517b51 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Sat, 24 Oct 2009 17:12:42 +0200 Subject: [PATCH 2/7] gitignore for autotools files --- pico/.gitignore | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) create mode 100644 pico/.gitignore diff --git a/pico/.gitignore b/pico/.gitignore new file mode 100644 index 0000000..4235569 --- /dev/null +++ b/pico/.gitignore @@ -0,0 +1,32 @@ +#created by aclocal +autom4te.cache +aclocal.m4 + +#created by libtoolize +m4 +ltmain.sh + +#created by autoconf +configure + +#created by automake +install-sh +missing +depcomp +Makefile.in +config.guess +config.sub + +#created by ./configure +.deps +Makefile +config.log +config.status +libtool + +#created by make +*.o +*.lo +.libs +libttspico.la + -- 1.7.1 debian/patches/0009-Fix-link-order.patch0000664000000000000000000000120012240466327015017 0ustar Index: svox-1.0+git20130326/pico/Makefile.am =================================================================== --- svox-1.0+git20130326.orig/pico/Makefile.am 2013-11-12 12:37:05.939979854 -0500 +++ svox-1.0+git20130326/pico/Makefile.am 2013-11-12 13:00:52.336945041 -0500 @@ -70,6 +70,8 @@ lib/picotrns.h \ lib/picowa.h +libttspico_la_LIBADD = -lm + picolangdir = $(datadir)/pico/lang picolang_DATA = \ lang/de-DE*.bin \ @@ -83,6 +85,6 @@ pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ - libttspico.la -lm -lpopt + libttspico.la -lpopt pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib debian/patches/0005-Install-lang-files.patch0000664000000000000000000000140012174160016015640 0ustar From 486b9f924bdf38f5f213feed2631060b44024c11 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Tue, 27 Oct 2009 23:06:46 +0100 Subject: [PATCH 5/7] Install lang files --- pico/Makefile.am | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/pico/Makefile.am b/pico/Makefile.am index 9151042..8898050 100644 --- a/pico/Makefile.am +++ b/pico/Makefile.am @@ -70,6 +70,15 @@ libttspico_la_HEADERS = \ lib/picotrns.h \ lib/picowa.h +picolangdir = $(datadir)/pico/lang +picolang_DATA = \ + lang/de-DE*.bin \ + lang/en-GB*.bin \ + lang/en-US*.bin \ + lang/es-ES*.bin \ + lang/fr-FR*.bin \ + lang/it-IT*.bin + bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c -- 1.7.1 debian/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch0000664000000000000000000003611712174160016024160 0ustar From 8bec80dccc9f4fe147a500486813f4e89a0d56d8 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Sun, 25 Oct 2009 15:19:01 +0100 Subject: [PATCH 3/7] pico2wave: Convert text to .wav using svox text-to-speech system. --- pico/.gitignore | 1 + pico/Makefile.am | 7 + pico/bin/pico2wave.c | 341 ++++++++++++++++++++++++++++++++++++++++++++++++++ pico/configure.in | 3 + 4 files changed, 352 insertions(+), 0 deletions(-) create mode 100644 pico/bin/pico2wave.c diff --git a/pico/.gitignore b/pico/.gitignore index 4235569..a110298 100644 --- a/pico/.gitignore +++ b/pico/.gitignore @@ -29,4 +29,5 @@ libtool *.lo .libs libttspico.la +pico2wave diff --git a/pico/Makefile.am b/pico/Makefile.am index 6d8a10c..0d9472d 100644 --- a/pico/Makefile.am +++ b/pico/Makefile.am @@ -34,3 +34,10 @@ libttspico_la_SOURCES = \ lib/picotrns.c \ lib/picowa.c +bin_PROGRAMS = pico2wave +pico2wave_SOURCES = \ + bin/pico2wave.c +pico2wave_LDADD = \ + libttspico.la -lm -lpopt +pico2wave_CFLAGS = -Wall -I lib + diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c new file mode 100644 index 0000000..0c035a7 --- /dev/null +++ b/pico/bin/pico2wave.c @@ -0,0 +1,341 @@ +/* pico2wave.c + + * Copyright (C) 2009 Mathieu Parent + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Convert text to .wav using svox text-to-speech system. + * + */ + + +#include +#include +#include +#include + +#include +#include +#include + + +/* adaptation layer defines */ +#define PICO_MEM_SIZE 2500000 +#define DummyLen 100000000 + +/* string constants */ +#define MAX_OUTBUF_SIZE 128 +const char * PICO_LINGWARE_PATH = "./lang/"; +const char * PICO_VOICE_NAME = "PicoVoice"; + +/* supported voices + Pico does not seperately specify the voice and locale. */ +const char * picoSupportedLangIso3[] = { "eng", "eng", "deu", "spa", "fra", "ita" }; +const char * picoSupportedCountryIso3[] = { "USA", "GBR", "DEU", "ESP", "FRA", "ITA" }; +const char * picoSupportedLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; +const char * picoInternalLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; +const char * picoInternalTaLingware[] = { "en-US_ta.bin", "en-GB_ta.bin", "de-DE_ta.bin", "es-ES_ta.bin", "fr-FR_ta.bin", "it-IT_ta.bin" }; +const char * picoInternalSgLingware[] = { "en-US_lh0_sg.bin", "en-GB_kh0_sg.bin", "de-DE_gl0_sg.bin", "es-ES_zl0_sg.bin", "fr-FR_nk0_sg.bin", "it-IT_cm0_sg.bin" }; +const char * picoInternalUtppLingware[] = { "en-US_utpp.bin", "en-GB_utpp.bin", "de-DE_utpp.bin", "es-ES_utpp.bin", "fr-FR_utpp.bin", "it-IT_utpp.bin" }; +const int picoNumSupportedVocs = 6; + +/* adapation layer global variables */ +void * picoMemArea = NULL; +pico_System picoSystem = NULL; +pico_Resource picoTaResource = NULL; +pico_Resource picoSgResource = NULL; +pico_Resource picoUtppResource = NULL; +pico_Engine picoEngine = NULL; +pico_Char * picoTaFileName = NULL; +pico_Char * picoSgFileName = NULL; +pico_Char * picoUtppFileName = NULL; +pico_Char * picoTaResourceName = NULL; +pico_Char * picoSgResourceName = NULL; +pico_Char * picoUtppResourceName = NULL; +int picoSynthAbort = 0; + + +int main(int argc, const char *argv[]) { + char * wavefile = NULL; + char * lang = "en-US"; + int langIndex = -1, langIndexTmp = -1; + char * text; + int8_t * buffer; + size_t bufferSize = 256; + + /* Parsing options */ + poptContext optCon; /* context for parsing command-line options */ + int opt; /* used for argument parsing */ + + struct poptOption optionsTable[] = { + { "wave", 'w', POPT_ARG_STRING, &wavefile, 0, + "Write output to this WAV file (extension SHOULD be .wav)", "filename.wav" }, + { "lang", 'l', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &lang, 0, + "Language", "lang" }, + POPT_AUTOHELP + POPT_TABLEEND + }; + optCon = poptGetContext(NULL, argc, argv, optionsTable, POPT_CONTEXT_POSIXMEHARDER); + poptSetOtherOptionHelp(optCon, ""); + + /* Reporting about invalid extra options */ + while ((opt = poptGetNextOpt(optCon)) != -1) { + switch (opt) { + default: + fprintf(stderr, "Invalid option %s: %s\n", + poptBadOption(optCon, 0), poptStrerror(opt)); + poptPrintHelp(optCon, stderr, 0); + exit(1); + } + } + + /* Mandatory option: --wave */ + if(!wavefile) { + fprintf(stderr, "Mandatory option: %s\n\n", + "--wave=filename.wav"); + poptPrintHelp(optCon, stderr, 0); + exit(1); + } + /* option: --lang */ + for(langIndexTmp =0; langIndexTmp */ + const char **extra_argv; + extra_argv = poptGetArgs(optCon); + if(extra_argv) { + text = (char *) &(*extra_argv)[0]; + } else { + //TODO: stdin not supported yet. + fprintf(stderr, "Missing argument: %s\n\n", + ""); + poptPrintHelp(optCon, stderr, 0); + exit(1); + } + + poptFreeContext(optCon); + + buffer = malloc( bufferSize ); + + int ret, getstatus; + pico_Char * inp = NULL; + pico_Char * local_text = NULL; + short outbuf[MAX_OUTBUF_SIZE/2]; + pico_Int16 bytes_sent, bytes_recv, text_remaining, out_data_type; + pico_Retstring outMessage; + + picoSynthAbort = 0; + + picoMemArea = malloc( PICO_MEM_SIZE ); + if((ret = pico_initialize( picoMemArea, PICO_MEM_SIZE, &picoSystem ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot initialize pico (%i): %s\n", ret, outMessage); + goto terminate; + } + + /* Load the text analysis Lingware resource file. */ + picoTaFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); + strcpy((char *) picoTaFileName, PICO_LINGWARE_PATH); + strcat((char *) picoTaFileName, (const char *) picoInternalTaLingware[langIndex]); + if((ret = pico_loadResource( picoSystem, picoTaFileName, &picoTaResource ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot load text analysis resource file (%i): %s\n", ret, outMessage); + goto unloadTaResource; + } + + /* Load the signal generation Lingware resource file. */ + picoSgFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); + strcpy((char *) picoSgFileName, PICO_LINGWARE_PATH); + strcat((char *) picoSgFileName, (const char *) picoInternalSgLingware[langIndex]); + if((ret = pico_loadResource( picoSystem, picoSgFileName, &picoSgResource ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot load signal generation Lingware resource file (%i): %s\n", ret, outMessage); + goto unloadSgResource; + } + + /* Load the utpp Lingware resource file if exists - NOTE: this file is optional + and is currently not used. Loading is only attempted for future compatibility. + If this file is not present the loading will still succeed. // + picoUtppFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); + strcpy((char *) picoUtppFileName, PICO_LINGWARE_PATH); + strcat((char *) picoUtppFileName, (const char *) picoInternalUtppLingware[langIndex]); + ret = pico_loadResource( picoSystem, picoUtppFileName, &picoUtppResource ); + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + printf("pico_loadResource: %i: %s\n", ret, outMessage); + */ + + /* Get the text analysis resource name. */ + picoTaResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); + if((ret = pico_getResourceName( picoSystem, picoTaResource, (char *) picoTaResourceName ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot get the text analysis resource name (%i): %s\n", ret, outMessage); + goto unloadUtppResource; + } + + /* Get the signal generation resource name. */ + picoSgResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); + if((ret = pico_getResourceName( picoSystem, picoSgResource, (char *) picoSgResourceName ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot get the signal generation resource name (%i): %s\n", ret, outMessage); + goto unloadUtppResource; + } + + + /* Create a voice definition. */ + if((ret = pico_createVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot create voice definition (%i): %s\n", ret, outMessage); + goto unloadUtppResource; + } + + /* Add the text analysis resource to the voice. */ + if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoTaResourceName ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot add the text analysis resource to the voice (%i): %s\n", ret, outMessage); + goto unloadUtppResource; + } + + /* Add the signal generation resource to the voice. */ + if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoSgResourceName ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot add the signal generation resource to the voice (%i): %s\n", ret, outMessage); + goto unloadUtppResource; + } + + /* Create a new Pico engine. */ + if((ret = pico_newEngine( picoSystem, (const pico_Char *) PICO_VOICE_NAME, &picoEngine ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot create a new pico engine (%i): %s\n", ret, outMessage); + goto disposeEngine; + } + + local_text = (pico_Char *) text ; + text_remaining = strlen((const char *) local_text) + 1; + + inp = (pico_Char *) local_text; + + size_t bufused = 0; + + picoos_Common common = (picoos_Common) pico_sysGetCommon(picoSystem); + + picoos_SDFile sdOutFile = NULL; + + picoos_bool done = TRUE; + if(TRUE != (done = picoos_sdfOpenOut(common, &sdOutFile, + (picoos_char *) wavefile, SAMPLE_FREQ_16KHZ, PICOOS_ENC_LIN))) + { + fprintf(stderr, "Cannot open output wave file\n"); + ret = 1; + goto disposeEngine; + } + + /* synthesis loop */ + while (text_remaining) { + /* Feed the text into the engine. */ + if((ret = pico_putTextUtf8( picoEngine, inp, text_remaining, &bytes_sent ))) { + pico_getSystemStatusMessage(picoSystem, ret, outMessage); + fprintf(stderr, "Cannot put Text (%i): %s\n", ret, outMessage); + goto disposeEngine; + } + + text_remaining -= bytes_sent; + inp += bytes_sent; + + do { + if (picoSynthAbort) { + goto disposeEngine; + } + /* Retrieve the samples and add them to the buffer. */ + getstatus = pico_getData( picoEngine, (void *) outbuf, + MAX_OUTBUF_SIZE, &bytes_recv, &out_data_type ); + if((getstatus !=PICO_STEP_BUSY) && (getstatus !=PICO_STEP_IDLE)){ + pico_getSystemStatusMessage(picoSystem, getstatus, outMessage); + fprintf(stderr, "Cannot get Data (%i): %s\n", getstatus, outMessage); + goto disposeEngine; + } + if (bytes_recv) { + if ((bufused + bytes_recv) <= bufferSize) { + memcpy(buffer+bufused, (int8_t *) outbuf, bytes_recv); + bufused += bytes_recv; + } else { + done = picoos_sdfPutSamples( + sdOutFile, + bufused / 2, + (picoos_int16*) (buffer)); + bufused = 0; + memcpy(buffer, (int8_t *) outbuf, bytes_recv); + bufused += bytes_recv; + } + } + } while (PICO_STEP_BUSY == getstatus); + /* This chunk of synthesis is finished; pass the remaining samples. */ + if (!picoSynthAbort) { + done = picoos_sdfPutSamples( + sdOutFile, + bufused / 2, + (picoos_int16*) (buffer)); + } + picoSynthAbort = 0; + } + + if(TRUE != (done = picoos_sdfCloseOut(common, &sdOutFile))) + { + fprintf(stderr, "Cannot close output wave file\n"); + ret = 1; + goto disposeEngine; + } + +disposeEngine: + if (picoEngine) { + pico_disposeEngine( picoSystem, &picoEngine ); + pico_releaseVoiceDefinition( picoSystem, (pico_Char *) PICO_VOICE_NAME ); + picoEngine = NULL; + } +unloadUtppResource: + if (picoUtppResource) { + pico_unloadResource( picoSystem, &picoUtppResource ); + picoUtppResource = NULL; + } +unloadSgResource: + if (picoSgResource) { + pico_unloadResource( picoSystem, &picoSgResource ); + picoSgResource = NULL; + } +unloadTaResource: + if (picoTaResource) { + pico_unloadResource( picoSystem, &picoTaResource ); + picoTaResource = NULL; + } +terminate: + if (picoSystem) { + pico_terminate(&picoSystem); + picoSystem = NULL; + } + exit(ret); +} + diff --git a/pico/configure.in b/pico/configure.in index 0afb56d..349eb1d 100644 --- a/pico/configure.in +++ b/pico/configure.in @@ -14,3 +14,6 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_CONFIG_MACRO_DIR([m4]) + +AC_CHECK_LIB(popt, poptGetContext) + -- 1.7.1 debian/patches/series0000664000000000000000000000044012240462215012030 0ustar 0001-autoconf-building-of-library-using-libtool.patch 0002-gitignore-for-autotools-files.patch 0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch 0004-add-header-files.patch 0005-Install-lang-files.patch 0006-Set-picolangdir.patch 0008-64bits.patch 0009-Fix-link-order.patch debian/patches/0008-64bits.patch0000664000000000000000000000244112240462106013336 0ustar Description: fix execution on 64bit archs Bug: http://code.google.com/p/android/issues/detail?id=12224 Author: Samuel Thibault Index: svox-1.0+git20130326/pico/lib/picoapi.c =================================================================== --- svox-1.0+git20130326.orig/pico/lib/picoapi.c 2013-11-12 12:24:10.881842607 -0500 +++ svox-1.0+git20130326/pico/lib/picoapi.c 2013-11-12 12:24:13.394146172 -0500 @@ -90,7 +90,7 @@ status = PICO_ERR_NULLPTR_ACCESS; } else { byte_ptr_t rest_mem; - picoos_uint32 rest_mem_size; + picoos_objsize_t rest_mem_size; pico_System sys; picoos_MemoryManager sysMM; picoos_ExceptionManager sysEM; Index: svox-1.0+git20130326/pico/lib/picosig2.c =================================================================== --- svox-1.0+git20130326.orig/pico/lib/picosig2.c 2013-11-12 12:24:10.893844107 -0500 +++ svox-1.0+git20130326/pico/lib/picosig2.c 2013-11-12 12:24:13.394146172 -0500 @@ -552,7 +552,7 @@ for (nI = 1; nI < m1; nI++) { XXr[nI] = c1[nI] << shift; } - i = sizeof(picoos_int32) * (PICODSP_FFTSIZE + 1 - m1); + i = sizeof(picoos_int32) * (PICODSP_FFTSIZE - m1); picoos_mem_set(XXr + m1, 0, i); dfct_nmf(m4, XXr); /* DFCT directly in fixed point */ debian/patches/0001-autoconf-building-of-library-using-libtool.patch0000664000000000000000000000500412174160016022455 0ustar From 9fe1aa475b2667446b081623abc5c6f6083a76e6 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Sat, 24 Oct 2009 17:03:37 +0200 Subject: [PATCH 1/7] autoconf building of library (using libtool) --- pico/Makefile.am | 36 ++++++++++++++++++++++++++++++++++++ pico/autogen.sh | 36 ++++++++++++++++++++++++++++++++++++ pico/configure.in | 16 ++++++++++++++++ 3 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 pico/Makefile.am create mode 100755 pico/autogen.sh create mode 100644 pico/configure.in diff --git a/pico/Makefile.am b/pico/Makefile.am new file mode 100644 index 0000000..6d8a10c --- /dev/null +++ b/pico/Makefile.am @@ -0,0 +1,36 @@ +## Makefile.am -- Process this file with automake to produce Makefile.in + +ACLOCAL_AMFLAGS = -I m4 + +lib_LTLIBRARIES = libttspico.la +libttspico_la_SOURCES = \ + lib/picoacph.c \ + lib/picoapi.c \ + lib/picobase.c \ + lib/picocep.c \ + lib/picoctrl.c \ + lib/picodata.c \ + lib/picodbg.c \ + lib/picoextapi.c \ + lib/picofftsg.c \ + lib/picokdbg.c \ + lib/picokdt.c \ + lib/picokfst.c \ + lib/picoklex.c \ + lib/picoknow.c \ + lib/picokpdf.c \ + lib/picokpr.c \ + lib/picoktab.c \ + lib/picoos.c \ + lib/picopal.c \ + lib/picopam.c \ + lib/picopr.c \ + lib/picorsrc.c \ + lib/picosa.c \ + lib/picosig.c \ + lib/picosig2.c \ + lib/picospho.c \ + lib/picotok.c \ + lib/picotrns.c \ + lib/picowa.c + diff --git a/pico/autogen.sh b/pico/autogen.sh new file mode 100755 index 0000000..a2f757c --- /dev/null +++ b/pico/autogen.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +#created by aclocal +rm -rf autom4te.cache +rm -f aclocal.m4 + +#created by libtoolize +rm -rf m4 +rm -f ltmain.sh + +#created by autoconf +rm -f configure + +#created by automake +rm -f install-sh missing depcomp Makefile.in config.guess config.sub + +#created by ./configure +rm -rf .deps +rm -f Makefile config.log config.status libtool + +if [ "$1" = "clean" ]; then + exit +fi + +IPATHS="-I lib" + +aclocal $IPATHS +libtoolize +autoconf $IPATHS +automake --add-missing + +rm -rf autom4te.cache + +echo "Now run ./configure and then make." +exit 0 + diff --git a/pico/configure.in b/pico/configure.in new file mode 100644 index 0000000..0afb56d --- /dev/null +++ b/pico/configure.in @@ -0,0 +1,16 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) + +AC_INIT([svox], [1.0], [math.parent@gmail.com]) + +AM_INIT_AUTOMAKE([1.9 foreign]) + +AC_PROG_CC +LT_INIT +AC_PROG_LIBTOOL + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + +AC_CONFIG_MACRO_DIR([m4]) -- 1.7.1 debian/patches/0006-Set-picolangdir.patch0000664000000000000000000000213312174160016015244 0ustar From 0102d423b79de7af982c8d4619d816f95a9b9278 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Thu, 29 Oct 2009 23:55:19 +0100 Subject: [PATCH 6/7] Set picolangdir --- pico/Makefile.am | 2 +- pico/bin/pico2wave.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/pico/Makefile.am b/pico/Makefile.am index 8898050..a19c42a 100644 --- a/pico/Makefile.am +++ b/pico/Makefile.am @@ -84,5 +84,5 @@ pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ libttspico.la -lm -lpopt -pico2wave_CFLAGS = -Wall -I lib +pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c index 0c035a7..ec7ab79 100644 --- a/pico/bin/pico2wave.c +++ b/pico/bin/pico2wave.c @@ -35,7 +35,11 @@ /* string constants */ #define MAX_OUTBUF_SIZE 128 +#ifdef picolangdir +const char * PICO_LINGWARE_PATH = picolangdir "/"; +#else const char * PICO_LINGWARE_PATH = "./lang/"; +#endif const char * PICO_VOICE_NAME = "PicoVoice"; /* supported voices -- 1.7.1 debian/patches/0004-add-header-files.patch0000664000000000000000000000252712174160016015303 0ustar From 0866cb3f7cfe4b8bae1edc8d0dbf18c85e9ca74f Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Tue, 27 Oct 2009 18:29:45 +0100 Subject: [PATCH 4/7] add header files --- pico/Makefile.am | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/pico/Makefile.am b/pico/Makefile.am index 0d9472d..9151042 100644 --- a/pico/Makefile.am +++ b/pico/Makefile.am @@ -34,6 +34,42 @@ libttspico_la_SOURCES = \ lib/picotrns.c \ lib/picowa.c +libttspico_ladir = $(includedir) +libttspico_la_HEADERS = \ + lib/picoacph.h \ + lib/picoapid.h \ + lib/picoapi.h \ + lib/picobase.h \ + lib/picocep.h \ + lib/picoctrl.h \ + lib/picodata.h \ + lib/picodbg.h \ + lib/picodefs.h \ + lib/picodsp.h \ + lib/picoextapi.h \ + lib/picofftsg.h \ + lib/picokdbg.h \ + lib/picokdt.h \ + lib/picokfst.h \ + lib/picoklex.h \ + lib/picoknow.h \ + lib/picokpdf.h \ + lib/picokpr.h \ + lib/picoktab.h \ + lib/picoos.h \ + lib/picopal.h \ + lib/picopam.h \ + lib/picopltf.h \ + lib/picopr.h \ + lib/picorsrc.h \ + lib/picosa.h \ + lib/picosig2.h \ + lib/picosig.h \ + lib/picospho.h \ + lib/picotok.h \ + lib/picotrns.h \ + lib/picowa.h + bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c -- 1.7.1 debian/libttspico-utils.manpages0000664000000000000000000000002312174160016014210 0ustar ./pico/pico2wave.1 debian/control0000664000000000000000000000506012240464252010575 0ustar Source: svox Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Accessibility Team Uploaders: Mathieu Parent , Samuel Thibault Build-Depends: debhelper (>= 9~), automake1.9, autoconf, libtool, help2man, libpopt-dev, hardening-wrapper Standards-Version: 3.9.4 Section: non-free/sound Homepage: http://www.android.com/ Vcs-Git: git://anonscm.debian.org/collab-maint/svox.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/svox.git;a=summary XS-Autobuild: yes Package: libttspico-dev Section: non-free/libdevel Architecture: any Multi-Arch: same Depends: libttspico0 (= ${binary:Version}), ${misc:Depends} Description: Small Footprint TTS (development files) The SVOX Pico engine is a software speech synthesizer for German, English (GB and US), Spanish, French and Italian. . SVOX produces a clear and distinct speech output made possible by the use of Hidden Markov Model (HMM) algorithms. . This package contains the files required for development. Package: libttspico-data Architecture: all Multi-Arch: foreign Depends: ${misc:Depends} Recommends: libttspico0 Description: Small Footprint TTS (lingware) The SVOX Pico engine is a software speech synthesizer for German, English (GB and US), Spanish, French and Italian. . SVOX produces a clear and distinct speech output made possible by the use of Hidden Markov Model (HMM) algorithms. . This package contains the language files (lingware). Package: libttspico0 Section: non-free/libs Architecture: any Multi-arch: same Depends: ${shlibs:Depends}, ${misc:Depends}, libttspico-data Pre-Depends: multiarch-support Description: Small Footprint TTS (library) The SVOX Pico engine is a software speech synthesizer for German, English (GB and US), Spanish, French and Italian. . SVOX produces a clear and distinct speech output made possible by the use of Hidden Markov Model (HMM) algorithms. . This package contains the library. Package: libttspico-utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libttspico-data Breaks: libttspico0 (<< 1.0+git20100205-2) Replaces: libttspico0 (<< 1.0+git20100205-2) Description: Small Footprint TTS (binaries) The SVOX Pico engine is a software speech synthesizer for German, English (GB and US), Spanish, French and Italian. . SVOX produces a clear and distinct speech output made possible by the use of Hidden Markov Model (HMM) algorithms. . This package contains binary files including pico2wave. debian/source/0000775000000000000000000000000012174160016010466 5ustar debian/source/format0000664000000000000000000000001412174160016011674 0ustar 3.0 (quilt) debian/libttspico-data.install0000664000000000000000000000002612174160016013637 0ustar usr/share/pico/lang/* debian/.pc/0000775000000000000000000000000012240461734007653 5ustar debian/.pc/0002-gitignore-for-autotools-files.patch/0000775000000000000000000000000012240461723017230 5ustar debian/.pc/0002-gitignore-for-autotools-files.patch/pico/0000775000000000000000000000000012240461723020162 5ustar debian/.pc/0002-gitignore-for-autotools-files.patch/.timestamp0000664000000000000000000000000012240461723021222 0ustar debian/.pc/.version0000664000000000000000000000000212240461622011325 0ustar 2 debian/.pc/0005-Install-lang-files.patch/0000775000000000000000000000000012240461732014756 5ustar debian/.pc/0005-Install-lang-files.patch/pico/0000775000000000000000000000000012240461732015710 5ustar debian/.pc/0005-Install-lang-files.patch/pico/Makefile.am0000664000000000000000000000300712240461730017742 0ustar ## Makefile.am -- Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libttspico.la libttspico_la_SOURCES = \ lib/picoacph.c \ lib/picoapi.c \ lib/picobase.c \ lib/picocep.c \ lib/picoctrl.c \ lib/picodata.c \ lib/picodbg.c \ lib/picoextapi.c \ lib/picofftsg.c \ lib/picokdbg.c \ lib/picokdt.c \ lib/picokfst.c \ lib/picoklex.c \ lib/picoknow.c \ lib/picokpdf.c \ lib/picokpr.c \ lib/picoktab.c \ lib/picoos.c \ lib/picopal.c \ lib/picopam.c \ lib/picopr.c \ lib/picorsrc.c \ lib/picosa.c \ lib/picosig.c \ lib/picosig2.c \ lib/picospho.c \ lib/picotok.c \ lib/picotrns.c \ lib/picowa.c libttspico_ladir = $(includedir) libttspico_la_HEADERS = \ lib/picoacph.h \ lib/picoapid.h \ lib/picoapi.h \ lib/picobase.h \ lib/picocep.h \ lib/picoctrl.h \ lib/picodata.h \ lib/picodbg.h \ lib/picodefs.h \ lib/picodsp.h \ lib/picoextapi.h \ lib/picofftsg.h \ lib/picokdbg.h \ lib/picokdt.h \ lib/picokfst.h \ lib/picoklex.h \ lib/picoknow.h \ lib/picokpdf.h \ lib/picokpr.h \ lib/picoktab.h \ lib/picoos.h \ lib/picopal.h \ lib/picopam.h \ lib/picopltf.h \ lib/picopr.h \ lib/picorsrc.h \ lib/picosa.h \ lib/picosig2.h \ lib/picosig.h \ lib/picospho.h \ lib/picotok.h \ lib/picotrns.h \ lib/picowa.h bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ libttspico.la -lm -lpopt pico2wave_CFLAGS = -Wall -I lib debian/.pc/0005-Install-lang-files.patch/.timestamp0000664000000000000000000000000012240461732016750 0ustar debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/0000775000000000000000000000000012240461726023264 5ustar debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/pico/0000775000000000000000000000000012240461726024216 5ustar debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/pico/bin/0000775000000000000000000000000012240461726024766 5ustar debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/pico/bin/pico2wave.c0000664000000000000000000000000012240461726027017 0ustar debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/pico/configure.in0000664000000000000000000000041412240461720026520 0ustar dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([svox], [1.0], [math.parent@gmail.com]) AM_INIT_AUTOMAKE([1.9 foreign]) AC_PROG_CC LT_INIT AC_PROG_LIBTOOL AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_CONFIG_MACRO_DIR([m4]) debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/pico/Makefile.am0000664000000000000000000000123012240461720026240 0ustar ## Makefile.am -- Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libttspico.la libttspico_la_SOURCES = \ lib/picoacph.c \ lib/picoapi.c \ lib/picobase.c \ lib/picocep.c \ lib/picoctrl.c \ lib/picodata.c \ lib/picodbg.c \ lib/picoextapi.c \ lib/picofftsg.c \ lib/picokdbg.c \ lib/picokdt.c \ lib/picokfst.c \ lib/picoklex.c \ lib/picoknow.c \ lib/picokpdf.c \ lib/picokpr.c \ lib/picoktab.c \ lib/picoos.c \ lib/picopal.c \ lib/picopam.c \ lib/picopr.c \ lib/picorsrc.c \ lib/picosa.c \ lib/picosig.c \ lib/picosig2.c \ lib/picospho.c \ lib/picotok.c \ lib/picotrns.c \ lib/picowa.c debian/.pc/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch/.timestamp0000664000000000000000000000000012240461726025256 0ustar debian/.pc/.quilt_patches0000664000000000000000000000001012240461622012504 0ustar patches debian/.pc/applied-patches0000664000000000000000000000036412240461734012644 0ustar 0001-autoconf-building-of-library-using-libtool.patch 0002-gitignore-for-autotools-files.patch 0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch 0004-add-header-files.patch 0005-Install-lang-files.patch 0006-Set-picolangdir.patch debian/.pc/.quilt_series0000664000000000000000000000000712240461622012355 0ustar series debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/0000775000000000000000000000000012240461720021564 5ustar debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/pico/0000775000000000000000000000000012240461720022516 5ustar debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/pico/configure.in0000664000000000000000000000000012240461720025015 0ustar debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/pico/autogen.sh0000664000000000000000000000000012240461720024502 0ustar debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/pico/Makefile.am0000664000000000000000000000000012240461720024540 0ustar debian/.pc/0001-autoconf-building-of-library-using-libtool.patch/.timestamp0000664000000000000000000000000012240461720023556 0ustar debian/.pc/0006-Set-picolangdir.patch/0000775000000000000000000000000012240461734014360 5ustar debian/.pc/0006-Set-picolangdir.patch/pico/0000775000000000000000000000000012240461734015312 5ustar debian/.pc/0006-Set-picolangdir.patch/pico/bin/0000775000000000000000000000000012240461734016062 5ustar debian/.pc/0006-Set-picolangdir.patch/pico/bin/pico2wave.c0000664000000000000000000003245712240461726020141 0ustar /* pico2wave.c * Copyright (C) 2009 Mathieu Parent * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Convert text to .wav using svox text-to-speech system. * */ #include #include #include #include #include #include #include /* adaptation layer defines */ #define PICO_MEM_SIZE 2500000 #define DummyLen 100000000 /* string constants */ #define MAX_OUTBUF_SIZE 128 const char * PICO_LINGWARE_PATH = "./lang/"; const char * PICO_VOICE_NAME = "PicoVoice"; /* supported voices Pico does not seperately specify the voice and locale. */ const char * picoSupportedLangIso3[] = { "eng", "eng", "deu", "spa", "fra", "ita" }; const char * picoSupportedCountryIso3[] = { "USA", "GBR", "DEU", "ESP", "FRA", "ITA" }; const char * picoSupportedLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; const char * picoInternalLang[] = { "en-US", "en-GB", "de-DE", "es-ES", "fr-FR", "it-IT" }; const char * picoInternalTaLingware[] = { "en-US_ta.bin", "en-GB_ta.bin", "de-DE_ta.bin", "es-ES_ta.bin", "fr-FR_ta.bin", "it-IT_ta.bin" }; const char * picoInternalSgLingware[] = { "en-US_lh0_sg.bin", "en-GB_kh0_sg.bin", "de-DE_gl0_sg.bin", "es-ES_zl0_sg.bin", "fr-FR_nk0_sg.bin", "it-IT_cm0_sg.bin" }; const char * picoInternalUtppLingware[] = { "en-US_utpp.bin", "en-GB_utpp.bin", "de-DE_utpp.bin", "es-ES_utpp.bin", "fr-FR_utpp.bin", "it-IT_utpp.bin" }; const int picoNumSupportedVocs = 6; /* adapation layer global variables */ void * picoMemArea = NULL; pico_System picoSystem = NULL; pico_Resource picoTaResource = NULL; pico_Resource picoSgResource = NULL; pico_Resource picoUtppResource = NULL; pico_Engine picoEngine = NULL; pico_Char * picoTaFileName = NULL; pico_Char * picoSgFileName = NULL; pico_Char * picoUtppFileName = NULL; pico_Char * picoTaResourceName = NULL; pico_Char * picoSgResourceName = NULL; pico_Char * picoUtppResourceName = NULL; int picoSynthAbort = 0; int main(int argc, const char *argv[]) { char * wavefile = NULL; char * lang = "en-US"; int langIndex = -1, langIndexTmp = -1; char * text; int8_t * buffer; size_t bufferSize = 256; /* Parsing options */ poptContext optCon; /* context for parsing command-line options */ int opt; /* used for argument parsing */ struct poptOption optionsTable[] = { { "wave", 'w', POPT_ARG_STRING, &wavefile, 0, "Write output to this WAV file (extension SHOULD be .wav)", "filename.wav" }, { "lang", 'l', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &lang, 0, "Language", "lang" }, POPT_AUTOHELP POPT_TABLEEND }; optCon = poptGetContext(NULL, argc, argv, optionsTable, POPT_CONTEXT_POSIXMEHARDER); poptSetOtherOptionHelp(optCon, ""); /* Reporting about invalid extra options */ while ((opt = poptGetNextOpt(optCon)) != -1) { switch (opt) { default: fprintf(stderr, "Invalid option %s: %s\n", poptBadOption(optCon, 0), poptStrerror(opt)); poptPrintHelp(optCon, stderr, 0); exit(1); } } /* Mandatory option: --wave */ if(!wavefile) { fprintf(stderr, "Mandatory option: %s\n\n", "--wave=filename.wav"); poptPrintHelp(optCon, stderr, 0); exit(1); } /* option: --lang */ for(langIndexTmp =0; langIndexTmp */ const char **extra_argv; extra_argv = poptGetArgs(optCon); if(extra_argv) { text = (char *) &(*extra_argv)[0]; } else { //TODO: stdin not supported yet. fprintf(stderr, "Missing argument: %s\n\n", ""); poptPrintHelp(optCon, stderr, 0); exit(1); } poptFreeContext(optCon); buffer = malloc( bufferSize ); int ret, getstatus; pico_Char * inp = NULL; pico_Char * local_text = NULL; short outbuf[MAX_OUTBUF_SIZE/2]; pico_Int16 bytes_sent, bytes_recv, text_remaining, out_data_type; pico_Retstring outMessage; picoSynthAbort = 0; picoMemArea = malloc( PICO_MEM_SIZE ); if((ret = pico_initialize( picoMemArea, PICO_MEM_SIZE, &picoSystem ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot initialize pico (%i): %s\n", ret, outMessage); goto terminate; } /* Load the text analysis Lingware resource file. */ picoTaFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoTaFileName, PICO_LINGWARE_PATH); strcat((char *) picoTaFileName, (const char *) picoInternalTaLingware[langIndex]); if((ret = pico_loadResource( picoSystem, picoTaFileName, &picoTaResource ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot load text analysis resource file (%i): %s\n", ret, outMessage); goto unloadTaResource; } /* Load the signal generation Lingware resource file. */ picoSgFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoSgFileName, PICO_LINGWARE_PATH); strcat((char *) picoSgFileName, (const char *) picoInternalSgLingware[langIndex]); if((ret = pico_loadResource( picoSystem, picoSgFileName, &picoSgResource ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot load signal generation Lingware resource file (%i): %s\n", ret, outMessage); goto unloadSgResource; } /* Load the utpp Lingware resource file if exists - NOTE: this file is optional and is currently not used. Loading is only attempted for future compatibility. If this file is not present the loading will still succeed. // picoUtppFileName = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE ); strcpy((char *) picoUtppFileName, PICO_LINGWARE_PATH); strcat((char *) picoUtppFileName, (const char *) picoInternalUtppLingware[langIndex]); ret = pico_loadResource( picoSystem, picoUtppFileName, &picoUtppResource ); pico_getSystemStatusMessage(picoSystem, ret, outMessage); printf("pico_loadResource: %i: %s\n", ret, outMessage); */ /* Get the text analysis resource name. */ picoTaResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); if((ret = pico_getResourceName( picoSystem, picoTaResource, (char *) picoTaResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot get the text analysis resource name (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Get the signal generation resource name. */ picoSgResourceName = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE ); if((ret = pico_getResourceName( picoSystem, picoSgResource, (char *) picoSgResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot get the signal generation resource name (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Create a voice definition. */ if((ret = pico_createVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot create voice definition (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Add the text analysis resource to the voice. */ if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoTaResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot add the text analysis resource to the voice (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Add the signal generation resource to the voice. */ if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoSgResourceName ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot add the signal generation resource to the voice (%i): %s\n", ret, outMessage); goto unloadUtppResource; } /* Create a new Pico engine. */ if((ret = pico_newEngine( picoSystem, (const pico_Char *) PICO_VOICE_NAME, &picoEngine ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot create a new pico engine (%i): %s\n", ret, outMessage); goto disposeEngine; } local_text = (pico_Char *) text ; text_remaining = strlen((const char *) local_text) + 1; inp = (pico_Char *) local_text; size_t bufused = 0; picoos_Common common = (picoos_Common) pico_sysGetCommon(picoSystem); picoos_SDFile sdOutFile = NULL; picoos_bool done = TRUE; if(TRUE != (done = picoos_sdfOpenOut(common, &sdOutFile, (picoos_char *) wavefile, SAMPLE_FREQ_16KHZ, PICOOS_ENC_LIN))) { fprintf(stderr, "Cannot open output wave file\n"); ret = 1; goto disposeEngine; } /* synthesis loop */ while (text_remaining) { /* Feed the text into the engine. */ if((ret = pico_putTextUtf8( picoEngine, inp, text_remaining, &bytes_sent ))) { pico_getSystemStatusMessage(picoSystem, ret, outMessage); fprintf(stderr, "Cannot put Text (%i): %s\n", ret, outMessage); goto disposeEngine; } text_remaining -= bytes_sent; inp += bytes_sent; do { if (picoSynthAbort) { goto disposeEngine; } /* Retrieve the samples and add them to the buffer. */ getstatus = pico_getData( picoEngine, (void *) outbuf, MAX_OUTBUF_SIZE, &bytes_recv, &out_data_type ); if((getstatus !=PICO_STEP_BUSY) && (getstatus !=PICO_STEP_IDLE)){ pico_getSystemStatusMessage(picoSystem, getstatus, outMessage); fprintf(stderr, "Cannot get Data (%i): %s\n", getstatus, outMessage); goto disposeEngine; } if (bytes_recv) { if ((bufused + bytes_recv) <= bufferSize) { memcpy(buffer+bufused, (int8_t *) outbuf, bytes_recv); bufused += bytes_recv; } else { done = picoos_sdfPutSamples( sdOutFile, bufused / 2, (picoos_int16*) (buffer)); bufused = 0; memcpy(buffer, (int8_t *) outbuf, bytes_recv); bufused += bytes_recv; } } } while (PICO_STEP_BUSY == getstatus); /* This chunk of synthesis is finished; pass the remaining samples. */ if (!picoSynthAbort) { done = picoos_sdfPutSamples( sdOutFile, bufused / 2, (picoos_int16*) (buffer)); } picoSynthAbort = 0; } if(TRUE != (done = picoos_sdfCloseOut(common, &sdOutFile))) { fprintf(stderr, "Cannot close output wave file\n"); ret = 1; goto disposeEngine; } disposeEngine: if (picoEngine) { pico_disposeEngine( picoSystem, &picoEngine ); pico_releaseVoiceDefinition( picoSystem, (pico_Char *) PICO_VOICE_NAME ); picoEngine = NULL; } unloadUtppResource: if (picoUtppResource) { pico_unloadResource( picoSystem, &picoUtppResource ); picoUtppResource = NULL; } unloadSgResource: if (picoSgResource) { pico_unloadResource( picoSystem, &picoSgResource ); picoSgResource = NULL; } unloadTaResource: if (picoTaResource) { pico_unloadResource( picoSystem, &picoTaResource ); picoTaResource = NULL; } terminate: if (picoSystem) { pico_terminate(&picoSystem); picoSystem = NULL; } exit(ret); } debian/.pc/0006-Set-picolangdir.patch/pico/Makefile.am0000664000000000000000000000327712240461732017355 0ustar ## Makefile.am -- Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libttspico.la libttspico_la_SOURCES = \ lib/picoacph.c \ lib/picoapi.c \ lib/picobase.c \ lib/picocep.c \ lib/picoctrl.c \ lib/picodata.c \ lib/picodbg.c \ lib/picoextapi.c \ lib/picofftsg.c \ lib/picokdbg.c \ lib/picokdt.c \ lib/picokfst.c \ lib/picoklex.c \ lib/picoknow.c \ lib/picokpdf.c \ lib/picokpr.c \ lib/picoktab.c \ lib/picoos.c \ lib/picopal.c \ lib/picopam.c \ lib/picopr.c \ lib/picorsrc.c \ lib/picosa.c \ lib/picosig.c \ lib/picosig2.c \ lib/picospho.c \ lib/picotok.c \ lib/picotrns.c \ lib/picowa.c libttspico_ladir = $(includedir) libttspico_la_HEADERS = \ lib/picoacph.h \ lib/picoapid.h \ lib/picoapi.h \ lib/picobase.h \ lib/picocep.h \ lib/picoctrl.h \ lib/picodata.h \ lib/picodbg.h \ lib/picodefs.h \ lib/picodsp.h \ lib/picoextapi.h \ lib/picofftsg.h \ lib/picokdbg.h \ lib/picokdt.h \ lib/picokfst.h \ lib/picoklex.h \ lib/picoknow.h \ lib/picokpdf.h \ lib/picokpr.h \ lib/picoktab.h \ lib/picoos.h \ lib/picopal.h \ lib/picopam.h \ lib/picopltf.h \ lib/picopr.h \ lib/picorsrc.h \ lib/picosa.h \ lib/picosig2.h \ lib/picosig.h \ lib/picospho.h \ lib/picotok.h \ lib/picotrns.h \ lib/picowa.h picolangdir = $(datadir)/pico/lang picolang_DATA = \ lang/de-DE*.bin \ lang/en-GB*.bin \ lang/en-US*.bin \ lang/es-ES*.bin \ lang/fr-FR*.bin \ lang/it-IT*.bin bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ libttspico.la -lm -lpopt pico2wave_CFLAGS = -Wall -I lib debian/.pc/0006-Set-picolangdir.patch/.timestamp0000664000000000000000000000000012240461734016352 0ustar debian/.pc/0004-add-header-files.patch/0000775000000000000000000000000012240461730014404 5ustar debian/.pc/0004-add-header-files.patch/pico/0000775000000000000000000000000012240461730015336 5ustar debian/.pc/0004-add-header-files.patch/pico/Makefile.am0000664000000000000000000000144712240461726017405 0ustar ## Makefile.am -- Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libttspico.la libttspico_la_SOURCES = \ lib/picoacph.c \ lib/picoapi.c \ lib/picobase.c \ lib/picocep.c \ lib/picoctrl.c \ lib/picodata.c \ lib/picodbg.c \ lib/picoextapi.c \ lib/picofftsg.c \ lib/picokdbg.c \ lib/picokdt.c \ lib/picokfst.c \ lib/picoklex.c \ lib/picoknow.c \ lib/picokpdf.c \ lib/picokpr.c \ lib/picoktab.c \ lib/picoos.c \ lib/picopal.c \ lib/picopam.c \ lib/picopr.c \ lib/picorsrc.c \ lib/picosa.c \ lib/picosig.c \ lib/picosig2.c \ lib/picospho.c \ lib/picotok.c \ lib/picotrns.c \ lib/picowa.c bin_PROGRAMS = pico2wave pico2wave_SOURCES = \ bin/pico2wave.c pico2wave_LDADD = \ libttspico.la -lm -lpopt pico2wave_CFLAGS = -Wall -I lib debian/.pc/0004-add-header-files.patch/.timestamp0000664000000000000000000000000012240461730016376 0ustar debian/compat0000664000000000000000000000000212174160016010364 0ustar 9 debian/libttspico-dev.dirs0000664000000000000000000000002412174160016012775 0ustar usr/lib usr/include debian/rules0000775000000000000000000000206212174160016010246 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DESTDIR=$(CURDIR)/debian/svox export DEB_BUILD_HARDENING=1 %: dh $@ --sourcedirectory=pico override_dh_auto_configure: chmod +x ./pico/autogen.sh cd pico && ./autogen.sh cd pico && ./configure --prefix=/usr --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) override_dh_auto_build: dh_auto_build help2man --name 'Small Footprint TTS' --version-string ' ' --no-info \ ./pico/pico2wave > ./pico/pico2wave.1 override_dh_auto_clean: rm pico/pico2wave.1 ||: cd pico && test -f Makefile && make clean ||: chmod +x ./pico/autogen.sh cd pico && ./autogen.sh clean debian/gbp.conf0000664000000000000000000000020512174160016010602 0ustar [DEFAULT] upstream-branch = upstream debian-branch = debian-sid #pristine-tar = True [git-buildpackage] export-dir = ../build-area/