gnu: f-seq: Use HTTPS home page URI.
[jackhill/guix/guix.git] / gnu / packages / speech.scm
CommitLineData
9698f4b7
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Thompson <davet@gnu.org>
f175fa49 3;;; Copyright © 2016, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
b3e2ea8d 4;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
5acea98e 5;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
b8098cc6 6;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
34583ec6 7;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
337fc722 8;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
eb9f726d 9;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
65286113 10;;; Copyright © 2021 qblade <qblade@protonmail.com>
9698f4b7
DT
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27(define-module (gnu packages speech)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
520cca28 31 #:use-module (guix git-download)
b8098cc6 32 #:use-module (guix utils)
9698f4b7
DT
33 #:use-module (guix build-system gnu)
34 #:use-module (gnu packages)
904f8a31 35 #:use-module (gnu packages audio)
b3df4d7e 36 #:use-module (gnu packages autotools)
f175fa49 37 #:use-module (gnu packages base) ;for 'which'
337fc722 38 #:use-module (gnu packages bison)
b8098cc6 39 #:use-module (gnu packages compression)
337fc722 40 #:use-module (gnu packages documentation)
34583ec6 41 #:use-module (gnu packages emacs)
b3df4d7e
MB
42 #:use-module (gnu packages gcc)
43 #:use-module (gnu packages glib)
9e9dd409 44 #:use-module (gnu packages gstreamer)
7566afb1 45 #:use-module (gnu packages linux)
34583ec6 46 #:use-module (gnu packages ncurses)
337fc722 47 #:use-module (gnu packages perl)
b3df4d7e
MB
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages pulseaudio)
904f8a31 50 #:use-module (gnu packages python)
337fc722 51 #:use-module (gnu packages swig)
34583ec6 52 #:use-module (gnu packages texinfo)
b3df4d7e 53 #:use-module (gnu packages textutils))
9698f4b7 54
8dde7a86
RG
55(define-public flite
56 (package
57 (name "flite")
58 (version "2.1")
59 (source
60 (origin
61 (method url-fetch)
62 (uri
63 (string-append "http://www.festvox.org/" name "/packed/" name
64 "-" version "/" name "-" version "-release.tar.bz2"))
65 (sha256
66 (base32 "119b7l7pjb1l5raqq24p8rmhdqni49vjh2mgdryrfr575rm3yg67"))))
67 (build-system gnu-build-system)
68 (arguments
69 ;; XXX:
70 ;; There numerous issues with the testsuite.
71 ;; Enable all of them once they are fixed in upstream.
72 `(#:tests? #f
73 #:configure-flags
74 (list
75 "--enable-shared"
76 (string-append "LDFLAGS=-Wl,-rpath="
77 (assoc-ref %outputs "out")
78 "/lib"))
79 #:phases
80 (modify-phases %standard-phases
81 (add-after 'unpack 'patch-rpath
82 (lambda _
83 (substitute* "main/Makefile"
84 (("flite_LIBS_flags \\+= -Wl,-rpath [^ ]*")
85 "flite_LIBS_flags +="))
86 #t))
87 (delete 'check)
88 ;; Modifying testsuite/Makefile is not done in favor of
89 ;; overriding 'check.
90 ;; The path not taken would be:
91 ;; test:\n\t$(foreach x,$(subst tris1,,$(subst dcoffset_wave,,$(subst flite_test,,$(subst by_word,,$(subst bin2ascii,,$(subst lpc_resynth,,$(subst rfc,,$(subst compare_wave,,$(subst record_in_noise,,$(subst combine_waves,,$(patsubst play_%,,$(subst record_wave,,$(subst lex_lookup,,$(patsubst lpc_test%,,$(patsubst asciiS2U%,,$(patsubst asciiU2S%,,$(ALL))))))))))))))))),echo TEST $x && ./$x data.one && ) true
92 (add-after 'install 'check
93 (lambda _
94 (invoke "make" "-C" "testsuite")
95 (with-directory-excursion "testsuite"
96 (invoke "./token_test")
97 (invoke "./hrg_test")
98 (invoke "./regex_test")
99 (invoke "./nums_test")
100 (invoke "./lex_test")
101 (invoke "./utt_test")
102 (invoke "./multi_thread"))
103 #t))
104 (add-after 'install 'remove-static-libs
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let* ((out (assoc-ref outputs "out")))
107 (for-each delete-file
108 (find-files out "\\.a$"))
109 #t))))))
110 (native-inputs
111 `(("perl" ,perl)))
112 (inputs
113 `(("alsa" ,alsa-lib)))
114 (synopsis "Speech synthesis system")
115 (description "Flite (festival-lite) is a small, fast run-time text to speech
116synthesis engine developed at CMU and primarily designed for small embedded
117machines and/or large servers. It is designed as an alternative text to speech
118synthesis engine to Festival for voices built using the FestVox suite of voice
119building tools.")
120 (home-page "http://www.festvox.org/flite/index.html")
121 (license (license:non-copyleft "file:///COPYING"))))
122
b8098cc6
MB
123(define-public espeak
124 (package
125 (name "espeak")
126 (version "1.48.04")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append "mirror://sourceforge/espeak/espeak/"
130 "espeak-" (version-major+minor version)
131 "/espeak-" version "-source.zip"))
132 (sha256
133 (base32
134 "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz"))
135 (modules '((guix build utils)))
136 (snippet
137 ;; remove prebuilt binaries
138 '(begin
139 (delete-file-recursively "linux_32bit")
140 #t))))
141 (build-system gnu-build-system)
142 (arguments
143 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
144 (string-append "DATADIR="
145 (assoc-ref %outputs "out")
146 "/share/espeak-data")
147 (string-append "LDFLAGS=-Wl,-rpath="
148 (assoc-ref %outputs "out")
149 "/lib")
636037fd
MB
150 ;; The package fails to build with newer C++ standards.
151 "CXXFLAGS=-std=c++98"
b8098cc6
MB
152 "AUDIO=pulseaudio")
153 #:tests? #f ; no check target
154 #:phases
155 (modify-phases %standard-phases
156 (replace 'configure
157 (lambda _
158 (chdir "src")
159 ;; We use version 19 of the PortAudio library, so we must copy the
160 ;; corresponding file to be sure that espeak compiles correctly.
161 (copy-file "portaudio19.h" "portaudio.h")
162 (substitute* "Makefile"
163 (("/bin/ln") "ln"))
164 #t)))))
165 (inputs
166 `(("portaudio" ,portaudio)
167 ("pulseaudio" ,pulseaudio)))
168 (native-inputs `(("unzip" ,unzip)))
169 (home-page "http://espeak.sourceforge.net/")
170 (synopsis "Software speech synthesizer")
171 (description "eSpeak is a software speech synthesizer for English and
172other languages. eSpeak uses a \"formant synthesis\" method. This allows many
173languages to be provided in a small size. The speech is clear, and can be used
174at high speeds, but is not as natural or smooth as larger synthesizers which are
175based on human speech recordings.")
176 (license license:gpl3+)))
177
7566afb1
MB
178(define-public espeak-ng
179 (package
180 (name "espeak-ng")
f175fa49 181 (version "1.50")
7566afb1 182 (home-page "https://github.com/espeak-ng/espeak-ng")
f175fa49
MB
183 ;; Note: eSpeak NG publishes release tarballs, but the 1.50 tarball is
184 ;; broken: <https://github.com/espeak-ng/espeak-ng/issues/683>.
185 ;; Download the raw repository to work around it; remove 'native-inputs'
186 ;; below when switching back to the release tarball.
7566afb1 187 (source (origin
f175fa49
MB
188 (method git-fetch)
189 (uri (git-reference (url home-page) (commit version)))
190 (file-name (git-file-name name version))
7566afb1 191 (sha256
f175fa49 192 (base32 "0jkqhf2h94vbqq7mg7mmm23bq372fa7mdk941my18c3vkldcir1b"))))
7566afb1
MB
193 (build-system gnu-build-system)
194 (arguments
195 `(#:configure-flags '("--disable-static")
196 ;; Building in parallel triggers a race condition in 1.49.2.
197 #:parallel-build? #f
198 ;; XXX: Some tests require an audio device.
199 #:tests? #f))
f175fa49
MB
200 (native-inputs
201 `(("autoconf" ,autoconf)
202 ("automake" ,automake)
203 ("libtool" ,libtool)
204 ("which" ,which)))
7566afb1
MB
205 (inputs
206 `(("libcap" ,libcap)
207 ("pcaudiolib" ,pcaudiolib)))
208 (synopsis "Software speech synthesizer")
209 (description
210 "eSpeak NG is a software speech synthesizer for more than 100 languages.
211It is based on the eSpeak engine and supports spectral and Klatt formant
212synthesis, and the ability to use MBROLA voices.")
213 (license license:gpl3+)))
214
9698f4b7
DT
215(define-public mitlm
216 (package
217 (name "mitlm")
075972d1 218 (version "0.4.2")
9698f4b7
DT
219 (source (origin
220 (method url-fetch)
075972d1
TGR
221 (uri (string-append "https://github.com/mitlm/mitlm/releases/"
222 "download/v" version "/"
223 name "-" version ".tar.xz"))
9698f4b7
DT
224 (sha256
225 (base32
075972d1 226 "09fv4fcpmw9g1j0zml0k5kk1lgjw2spr8gn51llbkaaph6v8d62a"))))
9698f4b7
DT
227 (build-system gnu-build-system)
228 (native-inputs
229 `(("gfortran" ,gfortran)))
230 (synopsis "The MIT Language Modeling toolkit")
231 (description "The MIT Language Modeling (MITLM) toolkit is a set of
232tools designed for the efficient estimation of statistical n-gram language
233models involving iterative parameter estimation. It achieves much of its
234efficiency through the use of a compact vector representation of n-grams.")
235 (home-page "https://github.com/mitlm/mitlm")
236 (license license:expat)))
b3df4d7e
MB
237
238(define-public speech-dispatcher
239 (package
240 (name "speech-dispatcher")
6ced4433 241 (version "0.9.1")
b3df4d7e
MB
242 (source (origin
243 (method url-fetch)
5d04ce48
MB
244 (uri (string-append "https://github.com/brailcom/speechd/releases"
245 "/download/" version "/speech-dispatcher-"
b3df4d7e
MB
246 version ".tar.gz"))
247 (sha256
248 (base32
6ced4433 249 "16bg52hnkrsrs7kgbzanb34b9zb6fqxwj0a9bmsxmj1skkil1h1p"))))
b3df4d7e 250 (build-system gnu-build-system)
2422b1b4 251 (arguments
5d04ce48 252 `(#:configure-flags '("--disable-static"
6ced4433 253
5d04ce48 254 ;; Disable support for proprietary TTS engines.
6ced4433 255 "--with-ibmtts=no"
5d04ce48 256 "--with-kali=no" "--with-baratinoo=no")))
b3df4d7e
MB
257 (native-inputs
258 `(("intltool" ,intltool)
259 ("pkg-config" ,pkg-config)))
260 (inputs
261 `(("dotconf" ,dotconf)
c268c6a0 262 ("espeak" ,espeak-ng)
b3df4d7e
MB
263 ("glib" ,glib)
264 ("libltdl" ,libltdl)
904f8a31
SB
265 ("libsndfile" ,libsndfile)
266 ("pulseaudio" ,pulseaudio)
267 ("python" ,python)))
b3df4d7e
MB
268 (synopsis "Common interface to speech synthesizers")
269 (description "The Speech Dispatcher project provides a high-level
270device independent layer for access to speech synthesis through a simple,
271stable and well documented interface.")
272 (home-page "https://devel.freebsoft.org/speechd")
273 ;; The software is distributed under GPL2+, but includes a number
6ced4433
MB
274 ;; of files covered by other licenses. Note: in practice, this
275 ;; is linked against dotconf, which is LGPL 2.1 only.
b3df4d7e
MB
276 (license (list license:gpl2+
277 license:fdl1.2+ ; Most files in doc/ are dual gpl2+/fdl1.2+.
278 license:lgpl2.1+
b3df4d7e
MB
279 (license:non-copyleft
280 ;; festival_client.{c,h} carries an expat-style license.
281 "See src/modules/festival_client.c in the distribution.")
282 license:gpl3+)))) ; doc/texinfo.tex -- with TeX exception.
b3e2ea8d
LF
283
284(define-public sonic
285 (package
286 (name "sonic")
287 (version "0.2.0")
288 (source (origin
520cca28
EF
289 (method git-fetch)
290 (uri (git-reference
291 (url "https://github.com/waywardgeek/sonic")
292 (commit (string-append "release-" version))))
293 (file-name (git-file-name name version))
b3e2ea8d
LF
294 (sha256
295 (base32
520cca28 296 "08xwnpw9cnaix1n1i7gvpq5hrfrqc2z1snjhjapfam506hrc77g4"))))
b3e2ea8d
LF
297 (build-system gnu-build-system)
298 (arguments
5acea98e
TGR
299 `(#:tests? #f ; no test suite
300 #:make-flags
301 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
302 (string-append "LDFLAGS=-Wl,-rpath="
303 (assoc-ref %outputs "out") "/lib"))
304 #:phases
305 (modify-phases %standard-phases
306 (add-after 'unpack 'respect-LDFLAGS
307 (lambda _
308 (substitute* "Makefile"
309 ((" -o sonic " match)
310 (string-append " $(LDFLAGS)" match)))
311 #t))
312 (delete 'configure)))) ; no ./configure script
b3e2ea8d
LF
313 (synopsis "Speed up or slow down speech")
314 (description "Sonic implements a simple algorithm for speeding up or slowing
315down speech. However, it's optimized for speed ups of over 2X, unlike previous
316algorithms for changing speech rate. Sonic is a C library designed to be easily
317integrated into streaming voice applications such as text-to-speech (TTS) back
318ends.
319
320The primary motivation behind Sonic is to enable the blind and visually impaired
321to improve their productivity with speech engines, like eSpeak. Sonic can also
322be used by the sighted.")
323 (home-page "https://github.com/waywardgeek/sonic")
324 (license license:asl2.0)))
34583ec6
RW
325
326(define-public festival
327 (package
328 (name "festival")
329 (version "2.5.0")
330 (source (origin
331 (method url-fetch)
332 (uri (string-append "http://festvox.org/packed/festival/"
333 (version-major+minor version)
334 "/festival-" version "-release.tar.gz"))
335 (sha256
336 (base32
337 "1d5415nckiv19adxisxfm1l1xxfyw88g87ckkmcr0lhjdd10g42c"))))
338 (build-system gnu-build-system)
339 (arguments
340 `(#:tests? #f ; there is no test target
341 #:make-flags
342 (list (string-append "RM="
343 (assoc-ref %build-inputs "coreutils")
344 "/bin/rm")
345 (string-append "ECHO_N="
346 (assoc-ref %build-inputs "coreutils")
347 "/bin/printf \"%s\""))
348 #:parallel-build? #f ; not supported
349 #:modules ((guix build gnu-build-system)
350 (guix build utils)
351 (guix build emacs-utils))
352 #:imported-modules (,@%gnu-build-system-modules
353 (guix build emacs-utils))
354 #:phases
355 (modify-phases %standard-phases
356 (add-after 'unpack 'unpack-and-patch-speech-tools
357 (lambda* (#:key inputs #:allow-other-keys)
358 (invoke "tar" "-C" ".."
359 "-xf" (assoc-ref inputs "speech-tools"))
360 (with-directory-excursion "../speech_tools"
361 (substitute* '("config/rules/modules.mak"
362 "config/rules/test_make_rules.mak"
363 "config/make_system.mak")
364 (("/bin/sh") (which "sh"))))
365 #t))
366 (add-after 'unpack 'patch-/bin/sh
367 (lambda _
368 (substitute* '("config/test_make_rules"
369 "config/make_system.mak")
370 (("/bin/sh") (which "sh")))
371 #t))
372 (add-before 'build 'build-speech-tools
373 (lambda* (#:key configure-flags make-flags #:allow-other-keys)
374 (with-directory-excursion "../speech_tools"
375 (apply invoke "sh" "configure"
376 (string-append "CONFIG_SHELL=" (which "sh"))
377 (string-append "SHELL=" (which "sh"))
378 configure-flags)
379 (apply invoke "make" make-flags))))
380 (add-after 'build 'build-documentation
381 (lambda _
382 (with-directory-excursion "doc"
383 (invoke "make" "festival.info"))))
384 (add-after 'unpack 'set-installation-directories
385 (lambda* (#:key outputs #:allow-other-keys)
386 (let ((out (assoc-ref outputs "out")))
387 (substitute* "config/project.mak"
388 (("^FTLIBDIR.*")
389 (string-append "FTLIBDIR=" out "/share/festival/lib")))
390 (substitute* "config/systems/default.mak"
391 (("^INSTALL_PREFIX.*")
392 (string-append "INSTALL_PREFIX=" out)))
393 #t)))
394 (add-after 'install 'actually-install
395 (lambda* (#:key inputs outputs #:allow-other-keys)
396 (let ((out (assoc-ref outputs "out")))
397 ;; Install Speech Tools first
398 (with-directory-excursion "../speech_tools"
399 ;; Target directories
400 (for-each (lambda (dir)
401 (mkdir-p (string-append out dir)))
402 '("/bin"
403 "/lib"
404 "/include/speech_tools/"
405 "/include/speech_tools/instantiate"
406 "/include/speech_tools/ling_class"
407 "/include/speech_tools/rxp"
408 "/include/speech_tools/sigpr"
409 "/include/speech_tools/unix"))
410 ;; Install binaries
411 (for-each (lambda (file)
412 (install-file file (string-append out "/bin")))
413 (find-files "bin" ".*"))
414 (for-each (lambda (file)
415 (delete-file (string-append out "/bin/" file)))
416 '("est_gdb" "est_examples" "est_program"))
417 ;; Install libraries
418 (for-each (lambda (file)
419 (install-file file (string-append out "/lib")))
420 (find-files "lib" "lib.*\\.so.*"))
421
422 ;; Install headers
423 (for-each
424 (lambda (dir)
425 (for-each
426 (lambda (header)
427 (install-file header
428 (string-append out "/include/speech_tools/" dir)))
429 (find-files (string-append "include/" dir)
430 "\\.h$")))
431 '("." "instantiate" "ling_class" "rxp" "sigpr" "unix")))
432
433 ;; Unpack files that will be installed together with the
434 ;; Festival libraries.
435 (invoke "tar" "--strip-components=1"
436 "-xvf" (assoc-ref inputs "festvox-cmu"))
437 (invoke "tar" "--strip-components=1"
dfcf79ac
RW
438 "-xvf" (assoc-ref inputs "festvox-poslex"))
439 (invoke "tar" "--strip-components=1"
440 "-xvf" (assoc-ref inputs "default-voice"))
34583ec6
RW
441
442 ;; Install Festival
443 (let ((bin (string-append out "/bin"))
444 (incdir (string-append out "/include/festival"))
445 (share (string-append out "/share/festival"))
446 (info (string-append out "/share/info")))
447 (for-each (lambda (executable)
448 (install-file executable bin))
449 '("src/main/festival"
450 "src/main/festival_client"
a870b800
RW
451 "examples/benchmark"))
452 (let ((scripts '("examples/dumpfeats"
453 "examples/durmeanstd"
454 "examples/latest"
455 "examples/make_utts"
456 "examples/powmeanstd"
457 "examples/run-festival-script"
458 "examples/saytime"
459 "examples/scfg_parse_text"
460 "examples/text2pos"
461 "examples/text2wave")))
462 (substitute* scripts
463 (("exec /tmp/guix-build.*/bin/festival")
464 (string-append "exec " bin "/festival")))
465 (for-each (lambda (script)
466 (install-file script bin))
467 scripts))
34583ec6
RW
468
469 ;; Documentation
17bbd30d
RW
470 (for-each (lambda (file)
471 (install-file file info))
472 (find-files "doc/info/" "festival.info.*"))
34583ec6
RW
473
474 ;; Headers
475 (mkdir-p incdir)
476 (for-each (lambda (header)
477 (install-file header
478 (string-append incdir "/"
479 (dirname header))))
480 (find-files "src/include" "\\.h$"))
481
482 ;; Data
483 (mkdir-p share)
484 (for-each (lambda (file)
485 (install-file file
486 (string-append share "/"
487 (dirname file))))
488 (find-files "lib" ".*"))
489 (for-each delete-file
490 (append (find-files share "Makefile")
491 (find-files bin "Makefile")))))
492 #t))
493 (add-after 'actually-install 'install-emacs-mode
494 (lambda* (#:key outputs #:allow-other-keys)
495 (let ((emacs-dir (string-append (assoc-ref outputs "out")
496 "/share/emacs/site-lisp")))
497 (install-file "lib/festival.el" emacs-dir)
498 (emacs-generate-autoloads ,name emacs-dir)
499 #t)))
500 ;; Rebuild the very old configure script that is confused by extra
501 ;; arguments.
502 (add-before 'configure 'bootstrap
503 (lambda _ (invoke "autoreconf" "-vif"))))))
504 (inputs
505 `(("ncurses" ,ncurses)))
506 (native-inputs
507 `(("autoconf" ,autoconf)
508 ("automake" ,automake)
509 ("texinfo" ,texinfo)
510 ("emacs" ,emacs-minimal)
511 ("festvox-cmu"
512 ,(origin
513 (method url-fetch)
514 (uri (string-append "http://festvox.org/packed/festival/"
515 (version-major+minor version)
516 "/festlex_CMU.tar.gz"))
517 (sha256
518 (base32
519 "01vwidqhhg2zifvk1gby91mckg1z2pv2mj6lihvdaifakf8k1561"))))
520 ("festvox-poslex"
521 ,(origin
522 (method url-fetch)
523 (uri (string-append "http://festvox.org/packed/festival/"
524 (version-major+minor version)
525 "/festlex_POSLEX.tar.gz"))
526 (sha256
527 (base32
528 "18wywilxaqwy63lc47p5g5529mpxhslibh1bjij0snxx5mjf7ip7"))))
dfcf79ac
RW
529 ("default-voice"
530 ,(origin
531 (method url-fetch)
532 (uri (string-append "http://festvox.org/packed/festival/"
533 (version-major+minor version)
534 "/voices/festvox_kallpc16k.tar.gz"))
535 (sha256
536 (base32
537 "136hmsyiwnlg2qwa508dy0imf19mzrb5r3dmb2kg8kcyxnslm740"))))
34583ec6
RW
538 ("speech-tools"
539 ,(origin
540 (method url-fetch)
541 (uri (string-append "http://festvox.org/packed/festival/"
542 (version-major+minor version)
543 "/speech_tools-" version "-release.tar.gz"))
544 (sha256
545 (base32
546 "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4"))))))
547 (home-page "http://www.cstr.ed.ac.uk/projects/festival/")
548 (synopsis "Speech synthesis system")
549 (description "Festival offers a general framework for building speech
550synthesis systems as well as including examples of various modules. As a
551whole it offers full text to speech through a number APIs: from shell level,
552though a Scheme command interpreter, as a C++ library, from Java, and an Emacs
553interface. Festival is multi-lingual though English is the most advanced.
554The system is written in C++ and uses the Edinburgh Speech Tools Library for
555low level architecture and has a Scheme (SIOD) based command interpreter for
556control.")
557 (license (license:non-copyleft "file://COPYING"))))
337fc722 558
65286113 559(define-public ekho
560 (package
561 (name "ekho")
562 (version "8.4")
563 (source
564 (origin
565 (method url-fetch)
566 (uri
567 (string-append "mirror://sourceforge/e-guidedog/Ekho/"
568 version "/ekho-" version ".tar.xz"))
569 (sha256
570 (base32 "1v476kpw09ljj8mavasj4hya2w11jwlx7q22rh1lsn9jkkam5i2a"))))
571 (native-inputs
572 `(("pkg-config" ,pkg-config)))
573 (inputs
574 `(("alsa-lib" ,alsa-lib)
575 ("espeak-ng" ,espeak-ng)
576 ("libsndfile" ,libsndfile)
577 ("pulseaudio" ,pulseaudio)))
578 (build-system gnu-build-system)
579 (native-search-paths
580 (list (search-path-specification
581 (variable "EKHO_DATA_PATH")
582 (files '("share/ekho-data")))))
583 (home-page "https://eguidedog.net/ekho.php")
584 (synopsis "Chinese text-to-speech software")
585 (description
586 "Ehko is a Text-To-Speech (TTS) software. It supports Cantonese,
587Mandarin, Toisanese, Zhaoan Hakka, Tibetan, Ngangien and Korean (in trial).
588It can also speak English through eSpeak or Festival.")
589 (license (list license:gpl2+
590 ;; libmusicxml
591 license:mpl2.0))))
592
337fc722
NG
593(define-public sphinxbase
594 (package
595 (name "sphinxbase")
596 (version "5prealpha")
597 (source
598 (origin
599 (method url-fetch)
600 (uri (string-append "mirror://sourceforge/cmusphinx/"
601 "sphinxbase/" version "/"
602 "sphinxbase-" version ".tar.gz"))
603 (sha256
eb9f726d
EF
604 (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp"))
605 (patches (search-patches "sphinxbase-fix-doxygen.patch"))))
337fc722
NG
606 (build-system gnu-build-system)
607 (arguments
608 `(#:parallel-tests? #f)) ;tests fail otherwise
609 (native-inputs
610 `(("bison" ,bison)
611 ("doxygen" ,doxygen)
612 ("perl" ,perl) ;for tests
613 ("python" ,python)
614 ("swig" ,swig)))
615 (inputs
616 `(("pulseaudio" ,pulseaudio)))
617 (home-page "https://cmusphinx.github.io/")
618 (synopsis "Support library required by Pocketsphinx and Sphinxtrain")
619 (description "This package contains the basic libraries shared by
620the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II,
621Sphinx-III, and PocketSphinx), as well as some common utilities for
622manipulating acoustic feature and audio files.")
623 (license license:bsd-4)))
9e9dd409
NG
624
625(define-public pocketsphinx
626 (package
627 (name "pocketsphinx")
628 (version "5prealpha")
629 (source
630 (origin
631 (method url-fetch)
632 (uri (string-append "mirror://sourceforge/cmusphinx/"
633 "pocketsphinx/" version "/"
634 "pocketsphinx-" version ".tar.gz"))
635 (sha256
636 (base32 "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg"))))
637 (build-system gnu-build-system)
638 (native-inputs
639 `(("pkg-config" ,pkg-config)
640 ("perl" ,perl) ;for tests
641 ("python" ,python)
642 ("swig" ,swig)))
643 (inputs
644 `(("gstreamer" ,gstreamer)
645 ("libcap" ,libcap)
646 ("pulseaudio" ,pulseaudio)
647 ("sphinxbase" ,sphinxbase)))
648 (home-page "https://cmusphinx.github.io/")
649 (synopsis "Recognizer library written in C")
650 (description "PocketSphinx is one of Carnegie Mellon University's
651large vocabulary, speaker-independent continuous speech recognition
652engine.")
653 (license license:bsd-2)))