Pārlūkot izejas kodu

svox: add package

Signed-off-by: Alessandro Di Marco <dmr@ethzero.com>
Alessandro Di Marco 10 gadus atpakaļ
vecāks
revīzija
1a82f58f8e

+ 60
- 0
sound/svox/Makefile Parādīt failu

@@ -0,0 +1,60 @@
1
+#
2
+# Copyright (C) 2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=svox
11
+PKG_VERSION:=1.0+git20130326
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
15
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/s/svox
16
+PKG_MD5SUM:=df4bf610ff4273b420e80ff64af93130
17
+
18
+PKG_MAINTAINER:=Alessandro Di Marco <dmr@ethzero.com>
19
+PKG_LICENSE:=Apache-2.0
20
+PKG_LICENSE_FILES:=
21
+
22
+PKG_FIXUP:=autoreconf
23
+PKG_INSTALL:=1
24
+
25
+include $(INCLUDE_DIR)/package.mk
26
+
27
+define Package/svox
28
+  TITLE:=SVOX PicoTTS text-to-speech engine
29
+  SECTION:=sound
30
+  CATEGORY:=Sound
31
+  URL:=https://android.googlesource.com/platform/external/svox/
32
+  DEPENDS:=+libpopt
33
+endef
34
+
35
+define Package/svox/description
36
+  SVOX is an embedded speech technology company founded in 2000 and
37
+  headquartered in Zurich, Switzerland. SVOX was acquired by Nuance
38
+  Communications in 2011. Company's products included Automated Speech
39
+  Recognition (ASR), Text-to-Speech (TTS) and Speech Dialog systems,
40
+  with customers mostly being manufacturers and system integrators in
41
+  automotive and mobile device industries.
42
+  SVOX TTS technology is characterized by natural and clear sound as well
43
+  as unique polyglot capability - the same voice can speak multiple
44
+  languages like a native speaker.
45
+endef
46
+
47
+define Build/Prepare
48
+	$(call Build/Prepare/Default)
49
+	mv $(PKG_BUILD_DIR)/pico/* $(PKG_BUILD_DIR)
50
+endef
51
+
52
+define Build/Configure
53
+	$(call Build/Configure/Default)
54
+endef
55
+
56
+define Package/svox/install
57
+	$(call Build/Install/Default)
58
+endef
59
+
60
+$(eval $(call BuildPackage,svox))

+ 113
- 0
sound/svox/patches/0001-autoconf-building-of-library-using-libtool.patch Parādīt failu

@@ -0,0 +1,113 @@
1
+From 9fe1aa475b2667446b081623abc5c6f6083a76e6 Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Sat, 24 Oct 2009 17:03:37 +0200
4
+Subject: [PATCH 1/7] autoconf building of library (using libtool)
5
+
6
+---
7
+ pico/Makefile.am  |   36 ++++++++++++++++++++++++++++++++++++
8
+ pico/autogen.sh   |   36 ++++++++++++++++++++++++++++++++++++
9
+ pico/configure.in |   16 ++++++++++++++++
10
+ 3 files changed, 88 insertions(+), 0 deletions(-)
11
+ create mode 100644 pico/Makefile.am
12
+ create mode 100755 pico/autogen.sh
13
+ create mode 100644 pico/configure.in
14
+
15
+--- /dev/null
16
++++ b/pico/Makefile.am
17
+@@ -0,0 +1,36 @@
18
++## Makefile.am -- Process this file with automake to produce Makefile.in
19
++
20
++ACLOCAL_AMFLAGS = -I m4
21
++
22
++lib_LTLIBRARIES = libttspico.la
23
++libttspico_la_SOURCES = \
24
++	lib/picoacph.c \
25
++	lib/picoapi.c \
26
++	lib/picobase.c \
27
++	lib/picocep.c \
28
++	lib/picoctrl.c \
29
++	lib/picodata.c \
30
++	lib/picodbg.c \
31
++	lib/picoextapi.c \
32
++	lib/picofftsg.c \
33
++	lib/picokdbg.c \
34
++	lib/picokdt.c \
35
++	lib/picokfst.c \
36
++	lib/picoklex.c \
37
++	lib/picoknow.c \
38
++	lib/picokpdf.c \
39
++	lib/picokpr.c \
40
++	lib/picoktab.c \
41
++	lib/picoos.c \
42
++	lib/picopal.c \
43
++	lib/picopam.c \
44
++	lib/picopr.c \
45
++	lib/picorsrc.c \
46
++	lib/picosa.c \
47
++	lib/picosig.c \
48
++	lib/picosig2.c \
49
++	lib/picospho.c \
50
++	lib/picotok.c \
51
++	lib/picotrns.c \
52
++	lib/picowa.c
53
++
54
+--- /dev/null
55
++++ b/pico/autogen.sh
56
+@@ -0,0 +1,38 @@
57
++#!/bin/sh
58
++
59
++#created by aclocal
60
++rm -rf autom4te.cache
61
++rm -f aclocal.m4
62
++
63
++#created by libtoolize
64
++rm -rf m4
65
++mkdir m4
66
++rm -f ltmain.sh
67
++
68
++#created by autoconf
69
++rm -f configure
70
++
71
++#created by automake
72
++rm -f install-sh missing depcomp Makefile.in config.guess config.sub
73
++rm -f INSTALL COPYING compile
74
++
75
++#created by ./configure
76
++rm -rf .deps
77
++rm -f Makefile config.log config.status libtool
78
++
79
++if [ "$1" = "clean" ]; then
80
++    exit
81
++fi
82
++
83
++IPATHS="-I lib"
84
++
85
++libtoolize
86
++aclocal $IPATHS
87
++automake --add-missing
88
++autoconf $IPATHS
89
++
90
++rm -rf autom4te.cache
91
++
92
++echo "Now run ./configure and then make."
93
++exit 0
94
++
95
+--- /dev/null
96
++++ b/pico/configure.in
97
+@@ -0,0 +1,16 @@
98
++dnl Process this file with autoconf to produce a configure script.
99
++
100
++AC_PREREQ(2.59)
101
++
102
++AC_INIT([svox], [1.0], [math.parent@gmail.com])
103
++
104
++AM_INIT_AUTOMAKE([1.9 foreign])
105
++
106
++AC_PROG_CC
107
++LT_INIT
108
++AC_PROG_LIBTOOL
109
++
110
++AC_CONFIG_FILES([Makefile])
111
++AC_OUTPUT
112
++
113
++AC_CONFIG_MACRO_DIR([m4])

+ 51
- 0
sound/svox/patches/0002-gitignore-for-autotools-files.patch Parādīt failu

@@ -0,0 +1,51 @@
1
+From b56b0a4bdf3e11271caab744f532cb055c517b51 Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Sat, 24 Oct 2009 17:12:42 +0200
4
+Subject: [PATCH 2/7] gitignore for autotools files
5
+
6
+---
7
+ pico/.gitignore |   32 ++++++++++++++++++++++++++++++++
8
+ 1 files changed, 32 insertions(+), 0 deletions(-)
9
+ create mode 100644 pico/.gitignore
10
+
11
+diff --git a/pico/.gitignore b/pico/.gitignore
12
+new file mode 100644
13
+index 0000000..4235569
14
+--- /dev/null
15
++++ b/pico/.gitignore
16
+@@ -0,0 +1,32 @@
17
++#created by aclocal
18
++autom4te.cache
19
++aclocal.m4
20
++
21
++#created by libtoolize
22
++m4
23
++ltmain.sh
24
++
25
++#created by autoconf
26
++configure
27
++
28
++#created by automake
29
++install-sh
30
++missing
31
++depcomp
32
++Makefile.in
33
++config.guess
34
++config.sub
35
++
36
++#created by ./configure
37
++.deps
38
++Makefile
39
++config.log
40
++config.status
41
++libtool
42
++
43
++#created by make
44
++*.o
45
++*.lo
46
++.libs
47
++libttspico.la
48
++
49
+-- 
50
+1.7.1
51
+

+ 399
- 0
sound/svox/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch Parādīt failu

@@ -0,0 +1,399 @@
1
+From 8bec80dccc9f4fe147a500486813f4e89a0d56d8 Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Sun, 25 Oct 2009 15:19:01 +0100
4
+Subject: [PATCH 3/7] pico2wave: Convert text to .wav using svox text-to-speech system.
5
+
6
+---
7
+ pico/.gitignore      |    1 +
8
+ pico/Makefile.am     |    7 +
9
+ pico/bin/pico2wave.c |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++
10
+ pico/configure.in    |    3 +
11
+ 4 files changed, 352 insertions(+), 0 deletions(-)
12
+ create mode 100644 pico/bin/pico2wave.c
13
+
14
+diff --git a/pico/.gitignore b/pico/.gitignore
15
+index 4235569..a110298 100644
16
+--- a/pico/.gitignore
17
++++ b/pico/.gitignore
18
+@@ -29,4 +29,5 @@ libtool
19
+ *.lo
20
+ .libs
21
+ libttspico.la
22
++pico2wave
23
+ 
24
+diff --git a/pico/Makefile.am b/pico/Makefile.am
25
+index 6d8a10c..0d9472d 100644
26
+--- a/pico/Makefile.am
27
++++ b/pico/Makefile.am
28
+@@ -34,3 +34,10 @@ libttspico_la_SOURCES = \
29
+ 	lib/picotrns.c \
30
+ 	lib/picowa.c
31
+ 
32
++bin_PROGRAMS = pico2wave
33
++pico2wave_SOURCES = \
34
++	bin/pico2wave.c
35
++pico2wave_LDADD = \
36
++	libttspico.la -lm -lpopt
37
++pico2wave_CFLAGS = -Wall -I lib
38
++
39
+diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c
40
+new file mode 100644
41
+index 0000000..0c035a7
42
+--- /dev/null
43
++++ b/pico/bin/pico2wave.c
44
+@@ -0,0 +1,341 @@
45
++/* pico2wave.c
46
++
47
++ * Copyright (C) 2009 Mathieu Parent <math.parent@gmail.com>
48
++ *
49
++ * Licensed under the Apache License, Version 2.0 (the "License");
50
++ * you may not use this file except in compliance with the License.
51
++ * You may obtain a copy of the License at
52
++ *
53
++ *     http://www.apache.org/licenses/LICENSE-2.0
54
++ *
55
++ * Unless required by applicable law or agreed to in writing, software
56
++ * distributed under the License is distributed on an "AS IS" BASIS,
57
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
58
++ * See the License for the specific language governing permissions and
59
++ * limitations under the License.
60
++ *
61
++ *   Convert text to .wav using svox text-to-speech system.
62
++ *
63
++ */
64
++
65
++
66
++#include <popt.h>
67
++#include <stdio.h>
68
++#include <stdlib.h>
69
++#include <string.h>
70
++
71
++#include <picoapi.h>
72
++#include <picoapid.h>
73
++#include <picoos.h>
74
++
75
++
76
++/* adaptation layer defines */
77
++#define PICO_MEM_SIZE       2500000
78
++#define DummyLen 100000000
79
++
80
++/* string constants */
81
++#define MAX_OUTBUF_SIZE     128
82
++const char * PICO_LINGWARE_PATH             = "./lang/";
83
++const char * PICO_VOICE_NAME                = "PicoVoice";
84
++
85
++/* supported voices
86
++   Pico does not seperately specify the voice and locale.   */
87
++const char * picoSupportedLangIso3[]        = { "eng",              "eng",              "deu",              "spa",              "fra",              "ita" };
88
++const char * picoSupportedCountryIso3[]     = { "USA",              "GBR",              "DEU",              "ESP",              "FRA",              "ITA" };
89
++const char * picoSupportedLang[]            = { "en-US",            "en-GB",            "de-DE",            "es-ES",            "fr-FR",            "it-IT" };
90
++const char * picoInternalLang[]             = { "en-US",            "en-GB",            "de-DE",            "es-ES",            "fr-FR",            "it-IT" };
91
++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" };
92
++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" };
93
++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" };
94
++const int picoNumSupportedVocs              = 6;
95
++
96
++/* adapation layer global variables */
97
++void *          picoMemArea         = NULL;
98
++pico_System     picoSystem          = NULL;
99
++pico_Resource   picoTaResource      = NULL;
100
++pico_Resource   picoSgResource      = NULL;
101
++pico_Resource   picoUtppResource    = NULL;
102
++pico_Engine     picoEngine          = NULL;
103
++pico_Char *     picoTaFileName      = NULL;
104
++pico_Char *     picoSgFileName      = NULL;
105
++pico_Char *     picoUtppFileName    = NULL;
106
++pico_Char *     picoTaResourceName  = NULL;
107
++pico_Char *     picoSgResourceName  = NULL;
108
++pico_Char *     picoUtppResourceName = NULL;
109
++int     picoSynthAbort = 0;
110
++
111
++
112
++int main(int argc, const char *argv[]) {
113
++    char * wavefile = NULL;
114
++    char * lang = "en-US";
115
++    int langIndex = -1, langIndexTmp = -1;
116
++    char * text;
117
++    int8_t * buffer;
118
++    size_t bufferSize = 256;
119
++    
120
++    /* Parsing options */
121
++	poptContext optCon; /* context for parsing command-line options */
122
++	int opt; /* used for argument parsing */
123
++
124
++	struct poptOption optionsTable[] = {
125
++		{ "wave", 'w', POPT_ARG_STRING, &wavefile, 0,
126
++		  "Write output to this WAV file (extension SHOULD be .wav)", "filename.wav" },
127
++		{ "lang", 'l', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &lang, 0,
128
++		  "Language", "lang" },
129
++		POPT_AUTOHELP
130
++		POPT_TABLEEND
131
++	};
132
++	optCon = poptGetContext(NULL, argc, argv, optionsTable, POPT_CONTEXT_POSIXMEHARDER);
133
++    poptSetOtherOptionHelp(optCon, "<words>");
134
++
135
++    /* Reporting about invalid extra options */
136
++	while ((opt = poptGetNextOpt(optCon)) != -1) {
137
++		switch (opt) {
138
++		default:
139
++			fprintf(stderr, "Invalid option %s: %s\n", 
140
++				poptBadOption(optCon, 0), poptStrerror(opt));
141
++			poptPrintHelp(optCon, stderr, 0);
142
++			exit(1);
143
++		}
144
++	}
145
++
146
++    /* Mandatory option: --wave */
147
++	if(!wavefile) {
148
++		fprintf(stderr, "Mandatory option: %s\n\n", 
149
++			"--wave=filename.wav");
150
++		poptPrintHelp(optCon, stderr, 0);
151
++		exit(1);
152
++	}
153
++	/* option: --lang */
154
++	for(langIndexTmp =0; langIndexTmp<picoNumSupportedVocs; langIndexTmp++) {
155
++	    if(!strcmp(picoSupportedLang[langIndexTmp], lang)) {
156
++	        langIndex = langIndexTmp;
157
++	        break;
158
++	    }
159
++	}
160
++	if(langIndex == -1) {
161
++		fprintf(stderr, "Unknown language: %s\nValid languages:\n", 
162
++			lang);
163
++	    for(langIndexTmp =0; langIndexTmp<picoNumSupportedVocs; langIndexTmp++) {
164
++	        fprintf(stderr, "%s\n", picoSupportedLang[langIndexTmp]);
165
++	    }
166
++	    lang = "en-US";
167
++		fprintf(stderr, "\n");
168
++		poptPrintHelp(optCon, stderr, 0);
169
++		exit(1);
170
++	}
171
++
172
++	/* Remaining argument is <words> */
173
++	const char **extra_argv;
174
++	extra_argv = poptGetArgs(optCon);
175
++    if(extra_argv) {
176
++		text = (char *) &(*extra_argv)[0];
177
++    } else {
178
++        //TODO: stdin not supported yet.
179
++		fprintf(stderr, "Missing argument: %s\n\n", 
180
++			"<words>");
181
++		poptPrintHelp(optCon, stderr, 0);
182
++		exit(1);
183
++    }
184
++
185
++    poptFreeContext(optCon);
186
++    
187
++    buffer = malloc( bufferSize );
188
++    
189
++    int ret, getstatus;
190
++    pico_Char * inp = NULL;
191
++    pico_Char * local_text = NULL;
192
++    short       outbuf[MAX_OUTBUF_SIZE/2];
193
++    pico_Int16  bytes_sent, bytes_recv, text_remaining, out_data_type;
194
++    pico_Retstring outMessage;
195
++    
196
++    picoSynthAbort = 0;
197
++
198
++    picoMemArea = malloc( PICO_MEM_SIZE );
199
++    if((ret = pico_initialize( picoMemArea, PICO_MEM_SIZE, &picoSystem ))) {
200
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
201
++        fprintf(stderr, "Cannot initialize pico (%i): %s\n", ret, outMessage);
202
++        goto terminate;
203
++    }
204
++    
205
++    /* Load the text analysis Lingware resource file.   */
206
++    picoTaFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
207
++    strcpy((char *) picoTaFileName,   PICO_LINGWARE_PATH);
208
++    strcat((char *) picoTaFileName,   (const char *) picoInternalTaLingware[langIndex]);
209
++    if((ret = pico_loadResource( picoSystem, picoTaFileName, &picoTaResource ))) {
210
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
211
++        fprintf(stderr, "Cannot load text analysis resource file (%i): %s\n", ret, outMessage);
212
++        goto unloadTaResource;
213
++    }
214
++    
215
++    /* Load the signal generation Lingware resource file.   */
216
++    picoSgFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
217
++    strcpy((char *) picoSgFileName,   PICO_LINGWARE_PATH);
218
++    strcat((char *) picoSgFileName,   (const char *) picoInternalSgLingware[langIndex]);
219
++    if((ret = pico_loadResource( picoSystem, picoSgFileName, &picoSgResource ))) {
220
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
221
++        fprintf(stderr, "Cannot load signal generation Lingware resource file (%i): %s\n", ret, outMessage);
222
++        goto unloadSgResource;
223
++    }
224
++ 
225
++    /* Load the utpp Lingware resource file if exists - NOTE: this file is optional
226
++       and is currently not used. Loading is only attempted for future compatibility.
227
++       If this file is not present the loading will still succeed.                      //
228
++    picoUtppFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
229
++    strcpy((char *) picoUtppFileName,   PICO_LINGWARE_PATH);
230
++    strcat((char *) picoUtppFileName,   (const char *) picoInternalUtppLingware[langIndex]);
231
++    ret = pico_loadResource( picoSystem, picoUtppFileName, &picoUtppResource );
232
++    pico_getSystemStatusMessage(picoSystem, ret, outMessage);
233
++    printf("pico_loadResource: %i: %s\n", ret, outMessage);
234
++    */
235
++    
236
++    /* Get the text analysis resource name.     */
237
++    picoTaResourceName  = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE );
238
++    if((ret = pico_getResourceName( picoSystem, picoTaResource, (char *) picoTaResourceName ))) {
239
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
240
++        fprintf(stderr, "Cannot get the text analysis resource name (%i): %s\n", ret, outMessage);
241
++        goto unloadUtppResource;
242
++    }
243
++
244
++    /* Get the signal generation resource name. */
245
++    picoSgResourceName  = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE );
246
++    if((ret = pico_getResourceName( picoSystem, picoSgResource, (char *) picoSgResourceName ))) {
247
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
248
++        fprintf(stderr, "Cannot get the signal generation resource name (%i): %s\n", ret, outMessage);
249
++        goto unloadUtppResource;
250
++    }
251
++
252
++
253
++    /* Create a voice definition.   */
254
++    if((ret = pico_createVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME ))) {
255
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
256
++        fprintf(stderr, "Cannot create voice definition (%i): %s\n", ret, outMessage);
257
++        goto unloadUtppResource;
258
++    }
259
++
260
++    /* Add the text analysis resource to the voice. */
261
++    if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoTaResourceName ))) {
262
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
263
++        fprintf(stderr, "Cannot add the text analysis resource to the voice (%i): %s\n", ret, outMessage);
264
++        goto unloadUtppResource;
265
++    }
266
++    
267
++    /* Add the signal generation resource to the voice. */
268
++    if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoSgResourceName ))) {
269
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
270
++        fprintf(stderr, "Cannot add the signal generation resource to the voice (%i): %s\n", ret, outMessage);
271
++        goto unloadUtppResource;
272
++    }
273
++
274
++    /* Create a new Pico engine. */
275
++    if((ret = pico_newEngine( picoSystem, (const pico_Char *) PICO_VOICE_NAME, &picoEngine ))) {
276
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
277
++        fprintf(stderr, "Cannot create a new pico engine (%i): %s\n", ret, outMessage);
278
++        goto disposeEngine;
279
++    }
280
++    
281
++    local_text = (pico_Char *) text ;
282
++    text_remaining = strlen((const char *) local_text) + 1;
283
++
284
++    inp = (pico_Char *) local_text;
285
++    
286
++    size_t bufused = 0;
287
++    
288
++    picoos_Common common = (picoos_Common) pico_sysGetCommon(picoSystem);
289
++
290
++    picoos_SDFile sdOutFile = NULL;
291
++
292
++    picoos_bool done = TRUE;
293
++    if(TRUE != (done = picoos_sdfOpenOut(common, &sdOutFile,
294
++        (picoos_char *) wavefile, SAMPLE_FREQ_16KHZ, PICOOS_ENC_LIN)))
295
++    {
296
++        fprintf(stderr, "Cannot open output wave file\n");
297
++        ret = 1;
298
++        goto disposeEngine;
299
++    }
300
++    
301
++    /* synthesis loop   */
302
++    while (text_remaining) {
303
++        /* Feed the text into the engine.   */
304
++        if((ret = pico_putTextUtf8( picoEngine, inp, text_remaining, &bytes_sent ))) {
305
++            pico_getSystemStatusMessage(picoSystem, ret, outMessage);
306
++            fprintf(stderr, "Cannot put Text (%i): %s\n", ret, outMessage);
307
++            goto disposeEngine;
308
++        }
309
++    
310
++        text_remaining -= bytes_sent;
311
++        inp += bytes_sent;
312
++
313
++        do {
314
++            if (picoSynthAbort) {
315
++                goto disposeEngine;
316
++            }
317
++            /* Retrieve the samples and add them to the buffer. */
318
++            getstatus = pico_getData( picoEngine, (void *) outbuf,
319
++                      MAX_OUTBUF_SIZE, &bytes_recv, &out_data_type );
320
++            if((getstatus !=PICO_STEP_BUSY) && (getstatus !=PICO_STEP_IDLE)){
321
++                pico_getSystemStatusMessage(picoSystem, getstatus, outMessage);
322
++                fprintf(stderr, "Cannot get Data (%i): %s\n", getstatus, outMessage);
323
++                goto disposeEngine;
324
++            }
325
++            if (bytes_recv) {
326
++                if ((bufused + bytes_recv) <= bufferSize) {
327
++                    memcpy(buffer+bufused, (int8_t *) outbuf, bytes_recv);
328
++                    bufused += bytes_recv;
329
++                } else {
330
++                    done = picoos_sdfPutSamples(
331
++                                        sdOutFile,
332
++                                        bufused / 2,
333
++                                        (picoos_int16*) (buffer));
334
++                    bufused = 0;
335
++                    memcpy(buffer, (int8_t *) outbuf, bytes_recv);
336
++                    bufused += bytes_recv;
337
++                }
338
++            }
339
++        } while (PICO_STEP_BUSY == getstatus);
340
++        /* This chunk of synthesis is finished; pass the remaining samples. */
341
++        if (!picoSynthAbort) {
342
++                    done = picoos_sdfPutSamples(
343
++                                        sdOutFile,
344
++                                        bufused / 2,
345
++                                        (picoos_int16*) (buffer));
346
++        }
347
++        picoSynthAbort = 0;
348
++    }
349
++    
350
++    if(TRUE != (done = picoos_sdfCloseOut(common, &sdOutFile)))
351
++    {
352
++        fprintf(stderr, "Cannot close output wave file\n");
353
++        ret = 1;
354
++        goto disposeEngine;
355
++    }
356
++
357
++disposeEngine:
358
++    if (picoEngine) {
359
++        pico_disposeEngine( picoSystem, &picoEngine );
360
++        pico_releaseVoiceDefinition( picoSystem, (pico_Char *) PICO_VOICE_NAME );
361
++        picoEngine = NULL;
362
++    }
363
++unloadUtppResource:
364
++    if (picoUtppResource) {
365
++        pico_unloadResource( picoSystem, &picoUtppResource );
366
++        picoUtppResource = NULL;
367
++    }
368
++unloadSgResource:
369
++    if (picoSgResource) {
370
++        pico_unloadResource( picoSystem, &picoSgResource );
371
++        picoSgResource = NULL;
372
++    }
373
++unloadTaResource:
374
++    if (picoTaResource) {
375
++        pico_unloadResource( picoSystem, &picoTaResource );
376
++        picoTaResource = NULL;
377
++    }
378
++terminate:
379
++    if (picoSystem) {
380
++        pico_terminate(&picoSystem);
381
++        picoSystem = NULL;
382
++    }
383
++    exit(ret);
384
++}
385
++
386
+diff --git a/pico/configure.in b/pico/configure.in
387
+index 0afb56d..349eb1d 100644
388
+--- a/pico/configure.in
389
++++ b/pico/configure.in
390
+@@ -14,3 +14,6 @@ AC_CONFIG_FILES([Makefile])
391
+ AC_OUTPUT
392
+ 
393
+ AC_CONFIG_MACRO_DIR([m4])
394
++
395
++AC_CHECK_LIB(popt, poptGetContext)
396
++
397
+-- 
398
+1.7.1
399
+

+ 59
- 0
sound/svox/patches/0004-add-header-files.patch Parādīt failu

@@ -0,0 +1,59 @@
1
+From 0866cb3f7cfe4b8bae1edc8d0dbf18c85e9ca74f Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Tue, 27 Oct 2009 18:29:45 +0100
4
+Subject: [PATCH 4/7] add header files
5
+
6
+---
7
+ pico/Makefile.am |   36 ++++++++++++++++++++++++++++++++++++
8
+ 1 files changed, 36 insertions(+), 0 deletions(-)
9
+
10
+diff --git a/pico/Makefile.am b/pico/Makefile.am
11
+index 0d9472d..9151042 100644
12
+--- a/pico/Makefile.am
13
++++ b/pico/Makefile.am
14
+@@ -34,6 +34,42 @@ libttspico_la_SOURCES = \
15
+ 	lib/picotrns.c \
16
+ 	lib/picowa.c
17
+ 
18
++libttspico_ladir = $(includedir)
19
++libttspico_la_HEADERS = \
20
++    lib/picoacph.h \
21
++    lib/picoapid.h \
22
++    lib/picoapi.h \
23
++    lib/picobase.h \
24
++    lib/picocep.h \
25
++    lib/picoctrl.h \
26
++    lib/picodata.h \
27
++    lib/picodbg.h \
28
++    lib/picodefs.h \
29
++    lib/picodsp.h \
30
++    lib/picoextapi.h \
31
++    lib/picofftsg.h \
32
++    lib/picokdbg.h \
33
++    lib/picokdt.h \
34
++    lib/picokfst.h \
35
++    lib/picoklex.h \
36
++    lib/picoknow.h \
37
++    lib/picokpdf.h \
38
++    lib/picokpr.h \
39
++    lib/picoktab.h \
40
++    lib/picoos.h \
41
++    lib/picopal.h \
42
++    lib/picopam.h \
43
++    lib/picopltf.h \
44
++    lib/picopr.h \
45
++    lib/picorsrc.h \
46
++    lib/picosa.h \
47
++    lib/picosig2.h \
48
++    lib/picosig.h \
49
++    lib/picospho.h \
50
++    lib/picotok.h \
51
++    lib/picotrns.h \
52
++    lib/picowa.h
53
++
54
+ bin_PROGRAMS = pico2wave
55
+ pico2wave_SOURCES = \
56
+ 	bin/pico2wave.c
57
+-- 
58
+1.7.1
59
+

+ 32
- 0
sound/svox/patches/0005-Install-lang-files.patch Parādīt failu

@@ -0,0 +1,32 @@
1
+From 486b9f924bdf38f5f213feed2631060b44024c11 Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Tue, 27 Oct 2009 23:06:46 +0100
4
+Subject: [PATCH 5/7] Install lang files
5
+
6
+---
7
+ pico/Makefile.am |    9 +++++++++
8
+ 1 files changed, 9 insertions(+), 0 deletions(-)
9
+
10
+diff --git a/pico/Makefile.am b/pico/Makefile.am
11
+index 9151042..8898050 100644
12
+--- a/pico/Makefile.am
13
++++ b/pico/Makefile.am
14
+@@ -70,6 +70,15 @@ libttspico_la_HEADERS = \
15
+     lib/picotrns.h \
16
+     lib/picowa.h
17
+ 
18
++picolangdir = $(datadir)/pico/lang
19
++picolang_DATA = \
20
++    lang/de-DE*.bin \
21
++    lang/en-GB*.bin \
22
++    lang/en-US*.bin \
23
++    lang/es-ES*.bin \
24
++    lang/fr-FR*.bin \
25
++    lang/it-IT*.bin
26
++
27
+ bin_PROGRAMS = pico2wave
28
+ pico2wave_SOURCES = \
29
+ 	bin/pico2wave.c
30
+-- 
31
+1.7.1
32
+

+ 40
- 0
sound/svox/patches/0006-Set-picolangdir.patch Parādīt failu

@@ -0,0 +1,40 @@
1
+From 0102d423b79de7af982c8d4619d816f95a9b9278 Mon Sep 17 00:00:00 2001
2
+From: Mathieu Parent <math.parent@gmail.com>
3
+Date: Thu, 29 Oct 2009 23:55:19 +0100
4
+Subject: [PATCH 6/7] Set picolangdir
5
+
6
+---
7
+ pico/Makefile.am     |    2 +-
8
+ pico/bin/pico2wave.c |    4 ++++
9
+ 2 files changed, 5 insertions(+), 1 deletions(-)
10
+
11
+diff --git a/pico/Makefile.am b/pico/Makefile.am
12
+index 8898050..a19c42a 100644
13
+--- a/pico/Makefile.am
14
++++ b/pico/Makefile.am
15
+@@ -84,5 +84,5 @@ pico2wave_SOURCES = \
16
+ 	bin/pico2wave.c
17
+ pico2wave_LDADD = \
18
+ 	libttspico.la -lm -lpopt
19
+-pico2wave_CFLAGS = -Wall -I lib
20
++pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib
21
+ 
22
+diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c
23
+index 0c035a7..ec7ab79 100644
24
+--- a/pico/bin/pico2wave.c
25
++++ b/pico/bin/pico2wave.c
26
+@@ -35,7 +35,11 @@
27
+ 
28
+ /* string constants */
29
+ #define MAX_OUTBUF_SIZE     128
30
++#ifdef picolangdir
31
++const char * PICO_LINGWARE_PATH             = picolangdir "/";
32
++#else
33
+ const char * PICO_LINGWARE_PATH             = "./lang/";
34
++#endif
35
+ const char * PICO_VOICE_NAME                = "PicoVoice";
36
+ 
37
+ /* supported voices
38
+-- 
39
+1.7.1
40
+

+ 26
- 0
sound/svox/patches/0008-64bits.patch Parādīt failu

@@ -0,0 +1,26 @@
1
+Description: fix execution on 64bit archs
2
+Bug: http://code.google.com/p/android/issues/detail?id=12224
3
+Author: Samuel Thibault <sthibault@debian.org>
4
+
5
+--- svox/pico/lib/picoapi.c.original	2010-10-25 19:06:57.000000000 +0200
6
++++ svox/pico/lib/picoapi.c	2010-10-25 19:07:18.000000000 +0200
7
+@@ -90,7 +90,7 @@
8
+         status = PICO_ERR_NULLPTR_ACCESS;
9
+     } else {
10
+         byte_ptr_t rest_mem;
11
+-        picoos_uint32 rest_mem_size;
12
++        picoos_objsize_t rest_mem_size;
13
+         pico_System sys;
14
+         picoos_MemoryManager sysMM;
15
+         picoos_ExceptionManager sysEM;
16
+--- svox/pico/lib/picosig2.c.original	2010-10-26 00:17:18.000000000 +0200
17
++++ svox/pico/lib/picosig2.c	2010-10-26 00:17:19.000000000 +0200
18
+@@ -568,7 +568,7 @@
19
+     for (nI = 1; nI < m1; nI++) {
20
+         XXr[nI] = c1[nI] << shift;
21
+     }
22
+-    i = sizeof(picoos_int32) * (PICODSP_FFTSIZE + 1 - m1);
23
++    i = sizeof(picoos_int32) * (PICODSP_FFTSIZE - m1);
24
+     picoos_mem_set(XXr + m1, 0, i);
25
+     dfct_nmf(m4, XXr); /* DFCT directly in fixed point */
26
+ 

+ 21
- 0
sound/svox/patches/0009-Fix-link-order.patch Parādīt failu

@@ -0,0 +1,21 @@
1
+Index: svox-1.0+git20130326/pico/Makefile.am
2
+===================================================================
3
+--- svox-1.0+git20130326.orig/pico/Makefile.am	2013-11-12 12:37:05.939979854 -0500
4
++++ svox-1.0+git20130326/pico/Makefile.am	2013-11-12 13:00:52.336945041 -0500
5
+@@ -70,6 +70,8 @@
6
+     lib/picotrns.h \
7
+     lib/picowa.h
8
+ 
9
++libttspico_la_LIBADD = -lm
10
++
11
+ picolangdir = $(datadir)/pico/lang
12
+ picolang_DATA = \
13
+     lang/de-DE*.bin \
14
+@@ -83,6 +85,6 @@
15
+ pico2wave_SOURCES = \
16
+ 	bin/pico2wave.c
17
+ pico2wave_LDADD = \
18
+-	libttspico.la -lm -lpopt
19
++	libttspico.la -lpopt
20
+ pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib
21
+ 

+ 30
- 0
sound/svox/patches/0010-platform.patch Parādīt failu

@@ -0,0 +1,30 @@
1
+--- a/pico/lib/picopltf.h
2
++++ b/pico/lib/picopltf.h
3
+@@ -39,6 +39,8 @@
4
+ #define PICO_MacOSX     5   /* Macintosh OS X */
5
+ #define PICO_Linux      7   /* Linux */
6
+ 
7
++#define PICO_GENERIC    99  /* Generic */
8
++
9
+ /* * definition of current platform ***/
10
+ #if !defined(PICO_PLATFORM)
11
+ #if defined(_WIN32)
12
+@@ -48,7 +50,7 @@
13
+ #elif defined(linux) || defined(__linux__) || defined(__linux)
14
+ #define PICO_PLATFORM    PICO_Linux
15
+ #else
16
+-#error PICO_PLATFORM not defined
17
++#define PICO_PLATFORM    PICO_GENERIC
18
+ #endif
19
+ #endif /* !defined(PICO_PLATFORM) */
20
+ 
21
+@@ -64,7 +66,8 @@
22
+ #define PICO_PLATFORM_STRING "UnknownPlatform"
23
+ #endif
24
+ 
25
+-#if (PICO_PLATFORM == PICO_MacOSX)
26
++#include <endian.h>
27
++#if __BYTE_ORDER == __BIG_ENDIAN
28
+ #define PICO_ENDIANNESS ENDIANNESS_BIG
29
+ #else
30
+ #define PICO_ENDIANNESS ENDIANNESS_LITTLE

+ 12
- 0
sound/svox/patches/0011-subdir.patch Parādīt failu

@@ -0,0 +1,12 @@
1
+diff -urN a/pico/configure.in b/pico/configure.in
2
+--- a/pico/configure.in	2015-01-21 18:59:39.604452795 +0100
3
++++ b/pico/configure.in	2015-01-21 19:00:53.288777298 +0100
4
+@@ -4,7 +4,7 @@
5
+ 
6
+ AC_INIT([svox], [1.0], [math.parent@gmail.com])
7
+ 
8
+-AM_INIT_AUTOMAKE([1.9 foreign])
9
++AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
10
+ 
11
+ AC_PROG_CC
12
+ LT_INIT

+ 46
- 0
sound/svox/patches/0012-no-headers.patch Parādīt failu

@@ -0,0 +1,46 @@
1
+diff -urN a/pico/Makefile.am b/pico/Makefile.am
2
+--- a/pico/Makefile.am	2015-01-22 01:33:21.470895431 +0100
3
++++ b/pico/Makefile.am	2015-01-22 01:36:03.042228475 +0100
4
+@@ -34,42 +34,6 @@
5
+ 	lib/picotrns.c \
6
+ 	lib/picowa.c
7
+ 
8
+-libttspico_ladir = $(includedir)
9
+-libttspico_la_HEADERS = \
10
+-    lib/picoacph.h \
11
+-    lib/picoapid.h \
12
+-    lib/picoapi.h \
13
+-    lib/picobase.h \
14
+-    lib/picocep.h \
15
+-    lib/picoctrl.h \
16
+-    lib/picodata.h \
17
+-    lib/picodbg.h \
18
+-    lib/picodefs.h \
19
+-    lib/picodsp.h \
20
+-    lib/picoextapi.h \
21
+-    lib/picofftsg.h \
22
+-    lib/picokdbg.h \
23
+-    lib/picokdt.h \
24
+-    lib/picokfst.h \
25
+-    lib/picoklex.h \
26
+-    lib/picoknow.h \
27
+-    lib/picokpdf.h \
28
+-    lib/picokpr.h \
29
+-    lib/picoktab.h \
30
+-    lib/picoos.h \
31
+-    lib/picopal.h \
32
+-    lib/picopam.h \
33
+-    lib/picopltf.h \
34
+-    lib/picopr.h \
35
+-    lib/picorsrc.h \
36
+-    lib/picosa.h \
37
+-    lib/picosig2.h \
38
+-    lib/picosig.h \
39
+-    lib/picospho.h \
40
+-    lib/picotok.h \
41
+-    lib/picotrns.h \
42
+-    lib/picowa.h
43
+-
44
+ libttspico_la_LIBADD = -lm
45
+ 
46
+ picolangdir = $(datadir)/pico/lang