gnu: Add eSpeak NG.
[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>
7566afb1 3;;; Copyright © 2016, 2019 Marius Bakke <mbakke@fastmail.com>
b3e2ea8d 4;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
075972d1 5;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
b8098cc6 6;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
9698f4b7
DT
7;;;
8;;; This file is part of GNU Guix.
9;;;
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.
14;;;
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.
19;;;
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/>.
22
23(define-module (gnu packages speech)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
b8098cc6 27 #:use-module (guix utils)
9698f4b7
DT
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
904f8a31 30 #:use-module (gnu packages audio)
b3df4d7e 31 #:use-module (gnu packages autotools)
b8098cc6 32 #:use-module (gnu packages compression)
b3df4d7e
MB
33 #:use-module (gnu packages gcc)
34 #:use-module (gnu packages glib)
7566afb1 35 #:use-module (gnu packages linux)
b3df4d7e
MB
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
904f8a31 38 #:use-module (gnu packages python)
b3df4d7e 39 #:use-module (gnu packages textutils))
9698f4b7 40
b8098cc6
MB
41(define-public espeak
42 (package
43 (name "espeak")
44 (version "1.48.04")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append "mirror://sourceforge/espeak/espeak/"
48 "espeak-" (version-major+minor version)
49 "/espeak-" version "-source.zip"))
50 (sha256
51 (base32
52 "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz"))
53 (modules '((guix build utils)))
54 (snippet
55 ;; remove prebuilt binaries
56 '(begin
57 (delete-file-recursively "linux_32bit")
58 #t))))
59 (build-system gnu-build-system)
60 (arguments
61 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
62 (string-append "DATADIR="
63 (assoc-ref %outputs "out")
64 "/share/espeak-data")
65 (string-append "LDFLAGS=-Wl,-rpath="
66 (assoc-ref %outputs "out")
67 "/lib")
68 "AUDIO=pulseaudio")
69 #:tests? #f ; no check target
70 #:phases
71 (modify-phases %standard-phases
72 (replace 'configure
73 (lambda _
74 (chdir "src")
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"
79 (("/bin/ln") "ln"))
80 #t)))))
81 (inputs
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
88other languages. eSpeak uses a \"formant synthesis\" method. This allows many
89languages to be provided in a small size. The speech is clear, and can be used
90at high speeds, but is not as natural or smooth as larger synthesizers which are
91based on human speech recordings.")
92 (license license:gpl3+)))
93
7566afb1
MB
94(define-public espeak-ng
95 (package
96 (name "espeak-ng")
97 (version "1.49.2")
98 (home-page "https://github.com/espeak-ng/espeak-ng")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append home-page "/releases/download/" version
102 "/espeak-ng-" version ".tar.gz"))
103 (sha256
104 (base32 "1d10x9rbvqi2zwcz65fxh04k0x0scnk7732l37laz6xra1ldhzng"))))
105 (build-system gnu-build-system)
106 (arguments
107 `(#:configure-flags '("--disable-static")
108 ;; Building in parallel triggers a race condition in 1.49.2.
109 #:parallel-build? #f
110 ;; XXX: Some tests require an audio device.
111 #:tests? #f))
112 (inputs
113 `(("libcap" ,libcap)
114 ("pcaudiolib" ,pcaudiolib)))
115 (synopsis "Software speech synthesizer")
116 (description
117 "eSpeak NG is a software speech synthesizer for more than 100 languages.
118It is based on the eSpeak engine and supports spectral and Klatt formant
119synthesis, and the ability to use MBROLA voices.")
120 (license license:gpl3+)))
121
9698f4b7
DT
122(define-public mitlm
123 (package
124 (name "mitlm")
075972d1 125 (version "0.4.2")
9698f4b7
DT
126 (source (origin
127 (method url-fetch)
075972d1
TGR
128 (uri (string-append "https://github.com/mitlm/mitlm/releases/"
129 "download/v" version "/"
130 name "-" version ".tar.xz"))
9698f4b7
DT
131 (sha256
132 (base32
075972d1 133 "09fv4fcpmw9g1j0zml0k5kk1lgjw2spr8gn51llbkaaph6v8d62a"))))
9698f4b7
DT
134 (build-system gnu-build-system)
135 (native-inputs
136 `(("gfortran" ,gfortran)))
137 (synopsis "The MIT Language Modeling toolkit")
138 (description "The MIT Language Modeling (MITLM) toolkit is a set of
139tools designed for the efficient estimation of statistical n-gram language
140models involving iterative parameter estimation. It achieves much of its
141efficiency through the use of a compact vector representation of n-grams.")
142 (home-page "https://github.com/mitlm/mitlm")
143 (license license:expat)))
b3df4d7e
MB
144
145(define-public speech-dispatcher
146 (package
147 (name "speech-dispatcher")
5d04ce48 148 (version "0.9.0")
b3df4d7e
MB
149 (source (origin
150 (method url-fetch)
5d04ce48
MB
151 (uri (string-append "https://github.com/brailcom/speechd/releases"
152 "/download/" version "/speech-dispatcher-"
b3df4d7e
MB
153 version ".tar.gz"))
154 (sha256
155 (base32
5d04ce48 156 "1yd2rb02565picga4gh2a0bvfxbhdyaj0cv9aaj5a8fc5zs29fbk"))))
b3df4d7e 157 (build-system gnu-build-system)
2422b1b4 158 (arguments
5d04ce48
MB
159 `(#:configure-flags '("--disable-static"
160 ;; Disable support for proprietary TTS engines.
161 "--with-kali=no" "--with-baratinoo=no")))
b3df4d7e
MB
162 (native-inputs
163 `(("intltool" ,intltool)
164 ("pkg-config" ,pkg-config)))
165 (inputs
166 `(("dotconf" ,dotconf)
904f8a31 167 ("espeak" ,espeak)
b3df4d7e
MB
168 ("glib" ,glib)
169 ("libltdl" ,libltdl)
904f8a31
SB
170 ("libsndfile" ,libsndfile)
171 ("pulseaudio" ,pulseaudio)
172 ("python" ,python)))
b3df4d7e
MB
173 (synopsis "Common interface to speech synthesizers")
174 (description "The Speech Dispatcher project provides a high-level
175device independent layer for access to speech synthesis through a simple,
176stable 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+.
182 license:lgpl2.1+
183 license:gpl2
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.
b3e2ea8d
LF
188
189(define-public sonic
190 (package
191 (name "sonic")
192 (version "0.2.0")
193 (source (origin
194 (method url-fetch)
195 (uri (string-append "https://github.com/waywardgeek/sonic/archive/"
196 "release-" version ".tar.gz"))
197 (file-name (string-append name "-" version ".tar.gz"))
198 (sha256
199 (base32
200 "11a0q9wkgbb9ymf52v7dvybfhj8hprgr67zs1xcng143fvjpr0n7"))))
201 (build-system gnu-build-system)
202 (arguments
203 `(#:tests? #f ; No test suite.
204 #:make-flags
205 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
206 #:phases
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
211down speech. However, it's optimized for speed ups of over 2X, unlike previous
212algorithms for changing speech rate. Sonic is a C library designed to be easily
213integrated into streaming voice applications such as text-to-speech (TTS) back
214ends.
215
216The primary motivation behind Sonic is to enable the blind and visually impaired
217to improve their productivity with speech engines, like eSpeak. Sonic can also
218be used by the sighted.")
219 (home-page "https://github.com/waywardgeek/sonic")
220 (license license:asl2.0)))