1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2016, 2019 Marius Bakke <mbakke@fastmail.com>
4 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages speech)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages audio)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages gcc)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages textutils))
47 (uri (string-append "mirror://sourceforge/espeak/espeak/"
48 "espeak-" (version-major+minor version)
49 "/espeak-" version "-source.zip"))
52 "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz"))
53 (modules '((guix build utils)))
55 ;; remove prebuilt binaries
57 (delete-file-recursively "linux_32bit")
59 (build-system gnu-build-system)
61 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
62 (string-append "DATADIR="
63 (assoc-ref %outputs "out")
65 (string-append "LDFLAGS=-Wl,-rpath="
66 (assoc-ref %outputs "out")
69 #:tests? #f ; no check target
71 (modify-phases %standard-phases
75 ;; We use version 19 of the PortAudio library, so we must copy the
76 ;; corresponding file to be sure that espeak compiles correctly.
77 (copy-file "portaudio19.h" "portaudio.h")
78 (substitute* "Makefile"
82 `(("portaudio" ,portaudio)
83 ("pulseaudio" ,pulseaudio)))
84 (native-inputs `(("unzip" ,unzip)))
85 (home-page "http://espeak.sourceforge.net/")
86 (synopsis "Software speech synthesizer")
87 (description "eSpeak is a software speech synthesizer for English and
88 other languages. eSpeak uses a \"formant synthesis\" method. This allows many
89 languages to be provided in a small size. The speech is clear, and can be used
90 at high speeds, but is not as natural or smooth as larger synthesizers which are
91 based on human speech recordings.")
92 (license license:gpl3+)))
94 (define-public espeak-ng
98 (home-page "https://github.com/espeak-ng/espeak-ng")
101 (uri (string-append home-page "/releases/download/" version
102 "/espeak-ng-" version ".tar.gz"))
104 (base32 "1d10x9rbvqi2zwcz65fxh04k0x0scnk7732l37laz6xra1ldhzng"))))
105 (build-system gnu-build-system)
107 `(#:configure-flags '("--disable-static")
108 ;; Building in parallel triggers a race condition in 1.49.2.
110 ;; XXX: Some tests require an audio device.
114 ("pcaudiolib" ,pcaudiolib)))
115 (synopsis "Software speech synthesizer")
117 "eSpeak NG is a software speech synthesizer for more than 100 languages.
118 It is based on the eSpeak engine and supports spectral and Klatt formant
119 synthesis, and the ability to use MBROLA voices.")
120 (license license:gpl3+)))
128 (uri (string-append "https://github.com/mitlm/mitlm/releases/"
129 "download/v" version "/"
130 name "-" version ".tar.xz"))
133 "09fv4fcpmw9g1j0zml0k5kk1lgjw2spr8gn51llbkaaph6v8d62a"))))
134 (build-system gnu-build-system)
136 `(("gfortran" ,gfortran)))
137 (synopsis "The MIT Language Modeling toolkit")
138 (description "The MIT Language Modeling (MITLM) toolkit is a set of
139 tools designed for the efficient estimation of statistical n-gram language
140 models involving iterative parameter estimation. It achieves much of its
141 efficiency through the use of a compact vector representation of n-grams.")
142 (home-page "https://github.com/mitlm/mitlm")
143 (license license:expat)))
145 (define-public speech-dispatcher
147 (name "speech-dispatcher")
151 (uri (string-append "https://github.com/brailcom/speechd/releases"
152 "/download/" version "/speech-dispatcher-"
156 "1yd2rb02565picga4gh2a0bvfxbhdyaj0cv9aaj5a8fc5zs29fbk"))))
157 (build-system gnu-build-system)
159 `(#:configure-flags '("--disable-static"
160 ;; Disable support for proprietary TTS engines.
161 "--with-kali=no" "--with-baratinoo=no")))
163 `(("intltool" ,intltool)
164 ("pkg-config" ,pkg-config)))
166 `(("dotconf" ,dotconf)
167 ("espeak" ,espeak-ng)
170 ("libsndfile" ,libsndfile)
171 ("pulseaudio" ,pulseaudio)
173 (synopsis "Common interface to speech synthesizers")
174 (description "The Speech Dispatcher project provides a high-level
175 device independent layer for access to speech synthesis through a simple,
176 stable and well documented interface.")
177 (home-page "https://devel.freebsoft.org/speechd")
178 ;; The software is distributed under GPL2+, but includes a number
179 ;; of files covered by other licenses.
180 (license (list license:gpl2+
181 license:fdl1.2+ ; Most files in doc/ are dual gpl2+/fdl1.2+.
184 (license:non-copyleft
185 ;; festival_client.{c,h} carries an expat-style license.
186 "See src/modules/festival_client.c in the distribution.")
187 license:gpl3+)))) ; doc/texinfo.tex -- with TeX exception.
195 (uri (string-append "https://github.com/waywardgeek/sonic/archive/"
196 "release-" version ".tar.gz"))
197 (file-name (string-append name "-" version ".tar.gz"))
200 "11a0q9wkgbb9ymf52v7dvybfhj8hprgr67zs1xcng143fvjpr0n7"))))
201 (build-system gnu-build-system)
203 `(#:tests? #f ; No test suite.
205 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
207 (modify-phases %standard-phases
208 (delete 'configure)))) ; No ./configure script.
209 (synopsis "Speed up or slow down speech")
210 (description "Sonic implements a simple algorithm for speeding up or slowing
211 down speech. However, it's optimized for speed ups of over 2X, unlike previous
212 algorithms for changing speech rate. Sonic is a C library designed to be easily
213 integrated into streaming voice applications such as text-to-speech (TTS) back
216 The primary motivation behind Sonic is to enable the blind and visually impaired
217 to improve their productivity with speech engines, like eSpeak. Sonic can also
218 be used by the sighted.")
219 (home-page "https://github.com/waywardgeek/sonic")
220 (license license:asl2.0)))