speech.scm 28 KB

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