speech.scm 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  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, 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. (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-and-patch-speech-tools 'set-fcommon
  360. (lambda _
  361. (substitute* "../speech_tools/config/rules/defaults.mak"
  362. (("\\(CFLAGS\\)") "(CFLAGS) -fcommon")
  363. (("\\(CXXFLAGS\\)") "(CXXFLAGS) -fcommon"))))
  364. (add-after 'unpack 'patch-/bin/sh
  365. (lambda _
  366. (substitute* '("config/test_make_rules"
  367. "config/make_system.mak")
  368. (("/bin/sh") (which "sh")))
  369. #t))
  370. (add-before 'build 'build-speech-tools
  371. (lambda* (#:key configure-flags make-flags #:allow-other-keys)
  372. (with-directory-excursion "../speech_tools"
  373. (apply invoke "sh" "configure"
  374. (string-append "CONFIG_SHELL=" (which "sh"))
  375. (string-append "SHELL=" (which "sh"))
  376. configure-flags)
  377. (apply invoke "make" make-flags))))
  378. (add-after 'build 'build-documentation
  379. (lambda _
  380. (with-directory-excursion "doc"
  381. (invoke "make" "festival.info"))))
  382. (add-after 'unpack 'set-installation-directories
  383. (lambda* (#:key outputs #:allow-other-keys)
  384. (let ((out (assoc-ref outputs "out")))
  385. (substitute* "config/project.mak"
  386. (("^FTLIBDIR.*")
  387. (string-append "FTLIBDIR=" out "/share/festival/lib")))
  388. (substitute* "config/systems/default.mak"
  389. (("^INSTALL_PREFIX.*")
  390. (string-append "INSTALL_PREFIX=" out)))
  391. #t)))
  392. (add-after 'install 'actually-install
  393. (lambda* (#:key inputs outputs #:allow-other-keys)
  394. (let ((out (assoc-ref outputs "out")))
  395. ;; Install Speech Tools first
  396. (with-directory-excursion "../speech_tools"
  397. ;; Target directories
  398. (for-each (lambda (dir)
  399. (mkdir-p (string-append out dir)))
  400. '("/bin"
  401. "/lib"
  402. "/include/speech_tools/"
  403. "/include/speech_tools/instantiate"
  404. "/include/speech_tools/ling_class"
  405. "/include/speech_tools/rxp"
  406. "/include/speech_tools/sigpr"
  407. "/include/speech_tools/unix"))
  408. ;; Install binaries
  409. (for-each (lambda (file)
  410. (install-file file (string-append out "/bin")))
  411. (find-files "bin" ".*"))
  412. (for-each (lambda (file)
  413. (delete-file (string-append out "/bin/" file)))
  414. '("est_gdb" "est_examples" "est_program"))
  415. ;; Install libraries
  416. (for-each (lambda (file)
  417. (install-file file (string-append out "/lib")))
  418. (find-files "lib" "lib.*\\.so.*"))
  419. ;; Install headers
  420. (for-each
  421. (lambda (dir)
  422. (for-each
  423. (lambda (header)
  424. (install-file header
  425. (string-append out "/include/speech_tools/" dir)))
  426. (find-files (string-append "include/" dir)
  427. "\\.h$")))
  428. '("." "instantiate" "ling_class" "rxp" "sigpr" "unix")))
  429. ;; Unpack files that will be installed together with the
  430. ;; Festival libraries.
  431. (invoke "tar" "--strip-components=1"
  432. "-xvf" (assoc-ref inputs "festvox-cmu"))
  433. (invoke "tar" "--strip-components=1"
  434. "-xvf" (assoc-ref inputs "festvox-poslex"))
  435. (invoke "tar" "--strip-components=1"
  436. "-xvf" (assoc-ref inputs "default-voice"))
  437. ;; Install Festival
  438. (let ((bin (string-append out "/bin"))
  439. (incdir (string-append out "/include/festival"))
  440. (share (string-append out "/share/festival"))
  441. (info (string-append out "/share/info")))
  442. (for-each (lambda (executable)
  443. (install-file executable bin))
  444. '("src/main/festival"
  445. "src/main/festival_client"
  446. "examples/benchmark"))
  447. (let ((scripts '("examples/dumpfeats"
  448. "examples/durmeanstd"
  449. "examples/latest"
  450. "examples/make_utts"
  451. "examples/powmeanstd"
  452. "examples/run-festival-script"
  453. "examples/saytime"
  454. "examples/scfg_parse_text"
  455. "examples/text2pos"
  456. "examples/text2wave")))
  457. (substitute* scripts
  458. (("exec /tmp/guix-build.*/bin/festival")
  459. (string-append "exec " bin "/festival")))
  460. (for-each (lambda (script)
  461. (install-file script bin))
  462. scripts))
  463. ;; Documentation
  464. (for-each (lambda (file)
  465. (install-file file info))
  466. (find-files "doc/info/" "festival.info.*"))
  467. ;; Headers
  468. (mkdir-p incdir)
  469. (for-each (lambda (header)
  470. (install-file header
  471. (string-append incdir "/"
  472. (dirname header))))
  473. (find-files "src/include" "\\.h$"))
  474. ;; Data
  475. (mkdir-p share)
  476. (for-each (lambda (file)
  477. (install-file file
  478. (string-append share "/"
  479. (dirname file))))
  480. (find-files "lib" ".*"))
  481. (for-each delete-file
  482. (append (find-files share "Makefile")
  483. (find-files bin "Makefile")))))
  484. #t))
  485. (add-after 'actually-install 'install-emacs-mode
  486. (lambda* (#:key outputs #:allow-other-keys)
  487. (let ((emacs-dir (string-append (assoc-ref outputs "out")
  488. "/share/emacs/site-lisp")))
  489. (install-file "lib/festival.el" emacs-dir)
  490. (emacs-generate-autoloads ,name emacs-dir)
  491. #t)))
  492. ;; Rebuild the very old configure script that is confused by extra
  493. ;; arguments.
  494. (add-before 'configure 'bootstrap
  495. (lambda _ (invoke "autoreconf" "-vif"))))))
  496. (inputs
  497. `(("ncurses" ,ncurses)))
  498. (native-inputs
  499. `(("autoconf" ,autoconf)
  500. ("automake" ,automake)
  501. ("texinfo" ,texinfo)
  502. ("emacs" ,emacs-minimal)
  503. ("festvox-cmu"
  504. ,(origin
  505. (method url-fetch)
  506. (uri (string-append "http://festvox.org/packed/festival/"
  507. (version-major+minor version)
  508. "/festlex_CMU.tar.gz"))
  509. (sha256
  510. (base32
  511. "01vwidqhhg2zifvk1gby91mckg1z2pv2mj6lihvdaifakf8k1561"))))
  512. ("festvox-poslex"
  513. ,(origin
  514. (method url-fetch)
  515. (uri (string-append "http://festvox.org/packed/festival/"
  516. (version-major+minor version)
  517. "/festlex_POSLEX.tar.gz"))
  518. (sha256
  519. (base32
  520. "18wywilxaqwy63lc47p5g5529mpxhslibh1bjij0snxx5mjf7ip7"))))
  521. ("default-voice"
  522. ,(origin
  523. (method url-fetch)
  524. (uri (string-append "http://festvox.org/packed/festival/"
  525. (version-major+minor version)
  526. "/voices/festvox_kallpc16k.tar.gz"))
  527. (sha256
  528. (base32
  529. "136hmsyiwnlg2qwa508dy0imf19mzrb5r3dmb2kg8kcyxnslm740"))))
  530. ("speech-tools"
  531. ,(origin
  532. (method url-fetch)
  533. (uri (string-append "http://festvox.org/packed/festival/"
  534. (version-major+minor version)
  535. "/speech_tools-" version "-release.tar.gz"))
  536. (sha256
  537. (base32
  538. "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4"))))))
  539. (home-page "https://www.cstr.ed.ac.uk/projects/festival/")
  540. (synopsis "Speech synthesis system")
  541. (description "Festival offers a general framework for building speech
  542. synthesis systems as well as including examples of various modules. As a
  543. whole it offers full text to speech through a number APIs: from shell level,
  544. though a Scheme command interpreter, as a C++ library, from Java, and an Emacs
  545. interface. Festival is multi-lingual though English is the most advanced.
  546. The system is written in C++ and uses the Edinburgh Speech Tools Library for
  547. low level architecture and has a Scheme (SIOD) based command interpreter for
  548. control.")
  549. (license (license:non-copyleft "file://COPYING"))))
  550. (define-public ekho
  551. (package
  552. (name "ekho")
  553. (version "8.4")
  554. (source
  555. (origin
  556. (method url-fetch)
  557. (uri
  558. (string-append "mirror://sourceforge/e-guidedog/Ekho/"
  559. version "/ekho-" version ".tar.xz"))
  560. (sha256
  561. (base32 "1v476kpw09ljj8mavasj4hya2w11jwlx7q22rh1lsn9jkkam5i2a"))))
  562. (native-inputs
  563. `(("pkg-config" ,pkg-config)))
  564. (inputs
  565. `(("alsa-lib" ,alsa-lib)
  566. ("espeak-ng" ,espeak-ng)
  567. ("libsndfile" ,libsndfile)
  568. ("pulseaudio" ,pulseaudio)))
  569. (build-system gnu-build-system)
  570. (native-search-paths
  571. (list (search-path-specification
  572. (variable "EKHO_DATA_PATH")
  573. (files '("share/ekho-data")))))
  574. (home-page "https://eguidedog.net/ekho.php")
  575. (synopsis "Chinese text-to-speech software")
  576. (description
  577. "Ehko is a Text-To-Speech (TTS) software. It supports Cantonese,
  578. Mandarin, Toisanese, Zhaoan Hakka, Tibetan, Ngangien and Korean (in trial).
  579. It can also speak English through eSpeak or Festival.")
  580. (license (list license:gpl2+
  581. ;; libmusicxml
  582. license:mpl2.0))))
  583. (define-public sphinxbase
  584. (package
  585. (name "sphinxbase")
  586. (version "5prealpha")
  587. (source
  588. (origin
  589. (method url-fetch)
  590. (uri (string-append "mirror://sourceforge/cmusphinx/"
  591. "sphinxbase/" version "/"
  592. "sphinxbase-" version ".tar.gz"))
  593. (sha256
  594. (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp"))
  595. (patches (search-patches "sphinxbase-fix-doxygen.patch"))))
  596. (build-system gnu-build-system)
  597. (arguments
  598. `(#:parallel-tests? #f)) ;tests fail otherwise
  599. (native-inputs
  600. `(("bison" ,bison)
  601. ("doxygen" ,doxygen)
  602. ("perl" ,perl) ;for tests
  603. ("python" ,python)
  604. ("swig" ,swig)))
  605. (inputs
  606. `(("pulseaudio" ,pulseaudio)))
  607. (home-page "https://cmusphinx.github.io/")
  608. (synopsis "Support library required by Pocketsphinx and Sphinxtrain")
  609. (description "This package contains the basic libraries shared by
  610. the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II,
  611. Sphinx-III, and PocketSphinx), as well as some common utilities for
  612. manipulating acoustic feature and audio files.")
  613. (license license:bsd-4)))
  614. (define-public pocketsphinx
  615. (package
  616. (name "pocketsphinx")
  617. (version "5prealpha")
  618. (source
  619. (origin
  620. (method url-fetch)
  621. (uri (string-append "mirror://sourceforge/cmusphinx/"
  622. "pocketsphinx/" version "/"
  623. "pocketsphinx-" version ".tar.gz"))
  624. (sha256
  625. (base32 "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg"))))
  626. (build-system gnu-build-system)
  627. (native-inputs
  628. `(("pkg-config" ,pkg-config)
  629. ("perl" ,perl) ;for tests
  630. ("python" ,python)
  631. ("swig" ,swig)))
  632. (inputs
  633. `(("gstreamer" ,gstreamer)
  634. ("libcap" ,libcap)
  635. ("pulseaudio" ,pulseaudio)
  636. ("sphinxbase" ,sphinxbase)))
  637. (home-page "https://cmusphinx.github.io/")
  638. (synopsis "Recognizer library written in C")
  639. (description "PocketSphinx is one of Carnegie Mellon University's
  640. large vocabulary, speaker-independent continuous speech recognition
  641. engine.")
  642. (license license:bsd-2)))