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