machine: Allow non-root users to deploy.
[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")
6ced4433 148 (version "0.9.1")
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
6ced4433 156 "16bg52hnkrsrs7kgbzanb34b9zb6fqxwj0a9bmsxmj1skkil1h1p"))))
b3df4d7e 157 (build-system gnu-build-system)
2422b1b4 158 (arguments
5d04ce48 159 `(#:configure-flags '("--disable-static"
6ced4433 160
5d04ce48 161 ;; Disable support for proprietary TTS engines.
6ced4433 162 "--with-ibmtts=no"
5d04ce48 163 "--with-kali=no" "--with-baratinoo=no")))
b3df4d7e
MB
164 (native-inputs
165 `(("intltool" ,intltool)
166 ("pkg-config" ,pkg-config)))
167 (inputs
168 `(("dotconf" ,dotconf)
c268c6a0 169 ("espeak" ,espeak-ng)
b3df4d7e
MB
170 ("glib" ,glib)
171 ("libltdl" ,libltdl)
904f8a31
SB
172 ("libsndfile" ,libsndfile)
173 ("pulseaudio" ,pulseaudio)
174 ("python" ,python)))
b3df4d7e
MB
175 (synopsis "Common interface to speech synthesizers")
176 (description "The Speech Dispatcher project provides a high-level
177device independent layer for access to speech synthesis through a simple,
178stable and well documented interface.")
179 (home-page "https://devel.freebsoft.org/speechd")
180 ;; The software is distributed under GPL2+, but includes a number
6ced4433
MB
181 ;; of files covered by other licenses. Note: in practice, this
182 ;; is linked against dotconf, which is LGPL 2.1 only.
b3df4d7e
MB
183 (license (list license:gpl2+
184 license:fdl1.2+ ; Most files in doc/ are dual gpl2+/fdl1.2+.
185 license:lgpl2.1+
b3df4d7e
MB
186 (license:non-copyleft
187 ;; festival_client.{c,h} carries an expat-style license.
188 "See src/modules/festival_client.c in the distribution.")
189 license:gpl3+)))) ; doc/texinfo.tex -- with TeX exception.
b3e2ea8d
LF
190
191(define-public sonic
192 (package
193 (name "sonic")
194 (version "0.2.0")
195 (source (origin
196 (method url-fetch)
197 (uri (string-append "https://github.com/waywardgeek/sonic/archive/"
198 "release-" version ".tar.gz"))
199 (file-name (string-append name "-" version ".tar.gz"))
200 (sha256
201 (base32
202 "11a0q9wkgbb9ymf52v7dvybfhj8hprgr67zs1xcng143fvjpr0n7"))))
203 (build-system gnu-build-system)
204 (arguments
205 `(#:tests? #f ; No test suite.
206 #:make-flags
207 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
208 #:phases
209 (modify-phases %standard-phases
210 (delete 'configure)))) ; No ./configure script.
211 (synopsis "Speed up or slow down speech")
212 (description "Sonic implements a simple algorithm for speeding up or slowing
213down speech. However, it's optimized for speed ups of over 2X, unlike previous
214algorithms for changing speech rate. Sonic is a C library designed to be easily
215integrated into streaming voice applications such as text-to-speech (TTS) back
216ends.
217
218The primary motivation behind Sonic is to enable the blind and visually impaired
219to improve their productivity with speech engines, like eSpeak. Sonic can also
220be used by the sighted.")
221 (home-page "https://github.com/waywardgeek/sonic")
222 (license license:asl2.0)))