pulseaudio.scm 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
  5. ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
  6. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  7. ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
  8. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  9. ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
  11. ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
  12. ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
  13. ;;; Copyright © 2020 Amin Bandali <bandali@gnu.org>
  14. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  15. ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  16. ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
  17. ;;;
  18. ;;; This file is part of GNU Guix.
  19. ;;;
  20. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  21. ;;; under the terms of the GNU General Public License as published by
  22. ;;; the Free Software Foundation; either version 3 of the License, or (at
  23. ;;; your option) any later version.
  24. ;;;
  25. ;;; GNU Guix is distributed in the hope that it will be useful, but
  26. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  27. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. ;;; GNU General Public License for more details.
  29. ;;;
  30. ;;; You should have received a copy of the GNU General Public License
  31. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  32. (define-module (gnu packages pulseaudio)
  33. #:use-module (guix packages)
  34. #:use-module (guix download)
  35. #:use-module (guix git-download)
  36. #:use-module (guix utils)
  37. #:use-module ((guix licenses) #:prefix l:)
  38. #:use-module (guix build-system cmake)
  39. #:use-module (guix build-system glib-or-gtk)
  40. #:use-module (guix build-system gnu)
  41. #:use-module (guix build-system go)
  42. #:use-module (guix build-system meson)
  43. #:use-module (guix build-system python)
  44. #:use-module (gnu packages)
  45. #:use-module (gnu packages algebra)
  46. #:use-module (gnu packages audio)
  47. #:use-module (gnu packages autotools)
  48. #:use-module (gnu packages avahi)
  49. #:use-module (gnu packages boost)
  50. #:use-module (gnu packages check)
  51. #:use-module (gnu packages dbm)
  52. #:use-module (gnu packages glib)
  53. #:use-module (gnu packages gettext)
  54. #:use-module (gnu packages gnome)
  55. #:use-module (gnu packages gtk)
  56. #:use-module (gnu packages libcanberra)
  57. #:use-module (gnu packages web)
  58. #:use-module (gnu packages linux)
  59. #:use-module (gnu packages m4)
  60. #:use-module (gnu packages perl)
  61. #:use-module (gnu packages protobuf)
  62. #:use-module (gnu packages python)
  63. #:use-module (gnu packages python-xyz)
  64. #:use-module (gnu packages python-web)
  65. #:use-module (gnu packages pkg-config)
  66. #:use-module (gnu packages xiph)
  67. #:use-module (gnu packages xml)
  68. #:use-module (gnu packages xorg))
  69. (define-public libsndfile
  70. (package
  71. (name "libsndfile")
  72. (version "1.0.30")
  73. (source (origin
  74. (method url-fetch)
  75. (uri (string-append "https://github.com/erikd/libsndfile"
  76. "/releases/download/v" version
  77. "/libsndfile-" version ".tar.bz2"))
  78. (sha256
  79. (base32
  80. "06k1wj3lwm7vf21s8yqy51k6nrkn9z610bj1gxb618ag5hq77wlx"))
  81. (modules '((ice-9 textual-ports) (guix build utils)))
  82. (snippet
  83. '(begin
  84. ;; Remove carriage returns (CRLF) to prevent bogus
  85. ;; errors from bash like "$'\r': command not found".
  86. (let ((data (call-with-input-file
  87. "tests/pedantic-header-test.sh.in"
  88. (lambda (port)
  89. (string-join
  90. (string-split (get-string-all port)
  91. #\return))))))
  92. (call-with-output-file "tests/pedantic-header-test.sh.in"
  93. (lambda (port) (format port data))))
  94. ;; While at it, fix hard coded executable name.
  95. (substitute* "tests/test_wrapper.sh.in"
  96. (("^/usr/bin/env") "env"))
  97. #t))))
  98. (build-system gnu-build-system)
  99. (propagated-inputs
  100. `(("flac" ,flac)
  101. ("libogg" ,libogg)
  102. ("libvorbis" ,libvorbis)
  103. ("opus" ,opus)))
  104. (native-inputs
  105. `(("pkg-config" ,pkg-config)
  106. ("python" ,python)))
  107. (home-page "http://www.mega-nerd.com/libsndfile/")
  108. (synopsis "Reading and writing files containing sampled sound")
  109. (description
  110. "Libsndfile is a C library for reading and writing files containing
  111. sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
  112. one standard library interface.
  113. It was designed to handle both little-endian (such as WAV) and
  114. big-endian (such as AIFF) data, and to compile and run correctly on
  115. little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
  116. as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
  117. SPARC. Hopefully the design of the library will also make it easy to extend
  118. for reading and writing new sound file formats.")
  119. (license l:gpl2+)))
  120. ;; Remove this on core-updates
  121. (define-public libsndfile/fixed
  122. (package
  123. (inherit libsndfile)
  124. (inputs '())
  125. (propagated-inputs
  126. `(("libvorbis" ,libvorbis)
  127. ("libogg" ,libogg)
  128. ("flac" ,flac)
  129. ("opus" ,opus)))))
  130. (define-public libsamplerate
  131. (package
  132. (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
  133. (version "0.1.9")
  134. (source (origin
  135. (method url-fetch)
  136. (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
  137. version ".tar.gz"))
  138. (sha256
  139. (base32
  140. "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
  141. (build-system gnu-build-system)
  142. (native-inputs
  143. `(("pkg-config" ,pkg-config)
  144. ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
  145. (propagated-inputs
  146. `(("libsndfile" ,libsndfile)
  147. ("fftw" ,fftw)))
  148. (arguments
  149. `(#:phases
  150. (modify-phases %standard-phases
  151. (add-after 'unpack 'fix-configure
  152. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  153. ;; Replace outdated config.sub and config.guess:
  154. (with-directory-excursion "Cfg"
  155. (for-each (lambda (file)
  156. (install-file (string-append
  157. (assoc-ref
  158. (or native-inputs inputs) "automake")
  159. "/share/automake-"
  160. ,(version-major+minor
  161. (package-version automake))
  162. "/" file) "."))
  163. '("config.sub" "config.guess")))
  164. #t)))))
  165. (home-page "http://www.mega-nerd.com/SRC/index.html")
  166. (synopsis "Audio sample rate conversion library")
  167. (description
  168. "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
  169. audio. One example of where such a thing would be useful is converting audio
  170. from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
  171. players.
  172. SRC is capable of arbitrary and time varying conversions; from downsampling by
  173. a factor of 256 to upsampling by the same factor. Arbitrary in this case means
  174. that the ratio of input and output sample rates can be an irrational
  175. number. The conversion ratio can also vary with time for speeding up and
  176. slowing down effects.
  177. SRC provides a small set of converters to allow quality to be traded off
  178. against computation cost. The current best converter provides a
  179. signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
  180. the theoretical best bandwidth for a given pair of input and output sample
  181. rates.")
  182. (license l:bsd-2)))
  183. (define-public pulseaudio
  184. (package
  185. (name "pulseaudio")
  186. (version "14.0")
  187. (source (origin
  188. (method url-fetch)
  189. (uri (string-append
  190. "https://freedesktop.org/software/pulseaudio/releases/"
  191. name "-" version ".tar.xz"))
  192. (sha256
  193. (base32
  194. "0qf20rgg0ysrnvg3359j56ndls07qmfn5rsy9r85bc42jdfpfd58"))
  195. (modules '((guix build utils)))
  196. (snippet
  197. ;; Disable console-kit support by default since it's deprecated
  198. ;; anyway.
  199. '(begin
  200. (substitute* "src/daemon/default.pa.in"
  201. (("load-module module-console-kit" all)
  202. (string-append "#" all "\n")))
  203. #t))
  204. (patches (search-patches
  205. "pulseaudio-fix-mult-test.patch"
  206. "pulseaudio-longer-test-timeout.patch"))))
  207. (build-system gnu-build-system)
  208. (arguments
  209. `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
  210. "--disable-oss-output"
  211. "--enable-bluez5"
  212. (string-append "--with-udev-rules-dir="
  213. (assoc-ref %outputs "out")
  214. "/lib/udev/rules.d"))
  215. #:phases (modify-phases %standard-phases
  216. (add-before 'check 'pre-check
  217. (lambda _
  218. ;; 'tests/lock-autospawn-test.c' wants to create a file
  219. ;; under ~/.config/pulse.
  220. (setenv "HOME" (getcwd))
  221. ;; 'thread-test' needs more time on hydra and on slower
  222. ;; machines, so we set the default timeout to 120 seconds.
  223. (setenv "CK_DEFAULT_TIMEOUT" "120")
  224. #t)))))
  225. (inputs
  226. ;; TODO: Add optional inputs (GTK+?).
  227. `(("alsa-lib" ,alsa-lib)
  228. ("bluez" ,bluez)
  229. ("sbc" ,sbc)
  230. ("speexdsp" ,speexdsp)
  231. ("libsndfile" ,libsndfile)
  232. ("jack" ,jack-1) ; For routing the output to jack.
  233. ("dbus" ,dbus)
  234. ("glib" ,glib)
  235. ("libltdl" ,libltdl)
  236. ("fftwf" ,fftwf)
  237. ("avahi" ,avahi)
  238. ("webrtc-audio-processing", webrtc-audio-processing)
  239. ;; For the optional X11 modules.
  240. ("libice" ,libice)
  241. ("libsm" ,libsm)
  242. ("libxcb" ,libxcb)
  243. ("libxtst" ,libxtst)
  244. ("eudev" ,eudev))) ;for the detection of hardware audio devices
  245. (native-inputs
  246. `(("check" ,check)
  247. ("gettext" ,gettext-minimal)
  248. ("glib:bin" ,glib "bin")
  249. ("m4" ,m4)
  250. ("perl" ,perl)
  251. ("perl-xml-parser" ,perl-xml-parser)
  252. ("pkg-config" ,pkg-config)))
  253. (propagated-inputs
  254. ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
  255. `(("libcap" ,libcap)
  256. ("gdbm" ,gdbm)))
  257. (home-page "http://www.pulseaudio.org/")
  258. (synopsis "Sound server")
  259. (description
  260. "PulseAudio is a sound server. It is basically a proxy for your sound
  261. applications. It allows you to do advanced operations on your sound data as
  262. it passes between your application and your hardware. Things like
  263. transferring the audio to a different machine, changing the sample format or
  264. channel count and mixing several sounds into one are easily achieved using a
  265. sound server.")
  266. ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
  267. ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
  268. ;; 'LICENSE' for details.
  269. (license l:gpl2+)))
  270. (define-public pavucontrol
  271. (package
  272. (name "pavucontrol")
  273. (version "4.0")
  274. (source (origin
  275. (method url-fetch)
  276. (uri (string-append
  277. "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
  278. version
  279. ".tar.xz"))
  280. (sha256
  281. (base32
  282. "1qhlkl3g8d7h72xjskii3g1l7la2cavwp69909pzmbi2jyn5pi4g"))))
  283. (build-system glib-or-gtk-build-system)
  284. (inputs
  285. `(("adwaita-icon-theme" ,adwaita-icon-theme) ;hard-coded theme
  286. ("gtkmm" ,gtkmm-3)
  287. ("libcanberra" ,libcanberra)
  288. ("pulseaudio" ,pulseaudio)))
  289. (native-inputs
  290. `(("intltool" ,intltool)
  291. ("pkg-config" ,pkg-config)))
  292. (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
  293. (synopsis "PulseAudio volume control")
  294. (description
  295. "PulseAudio Volume Control (pavucontrol) provides a GTK+
  296. graphical user interface to connect to a PulseAudio server and
  297. easily control the volume of all clients, sinks, etc.")
  298. (license l:gpl2+)))
  299. (define-public ponymix
  300. (package
  301. (name "ponymix")
  302. (version "5")
  303. (source (origin
  304. (method git-fetch)
  305. (uri (git-reference
  306. (url "https://github.com/falconindy/ponymix/")
  307. (commit version)))
  308. (file-name (git-file-name name version))
  309. (sha256
  310. (base32
  311. "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
  312. (build-system gnu-build-system)
  313. (arguments
  314. `(#:tests? #f ; There is no test suite.
  315. #:make-flags (let ((out (assoc-ref %outputs "out")))
  316. (list (string-append "DESTDIR=" out)))
  317. #:phases
  318. (modify-phases %standard-phases
  319. (add-after 'unpack 'patch-paths
  320. (lambda _
  321. (substitute* "Makefile"
  322. (("/usr") ""))))
  323. (delete 'configure)))) ; There's no configure phase.
  324. (inputs
  325. `(("pulseaudio" ,pulseaudio)))
  326. (native-inputs
  327. `(("pkg-config" ,pkg-config)))
  328. (home-page "https://github.com/falconindy/ponymix")
  329. (synopsis "Console-based PulseAudio mixer")
  330. (description "Ponymix is a PulseAudio mixer and volume controller with a
  331. command-line interface. In addition, it is possible to use named sources and
  332. sinks.")
  333. (license l:expat)))
  334. (define-public pulsemixer
  335. (package
  336. (name "pulsemixer")
  337. (version "1.5.1")
  338. (source (origin
  339. (method git-fetch)
  340. (uri (git-reference
  341. (url "https://github.com/GeorgeFilipkin/pulsemixer")
  342. (commit version)))
  343. (file-name (git-file-name name version))
  344. (sha256
  345. (base32
  346. "1jagx9zmz5pfsld8y2rj2kqg6ww9f6vqiawfy3vhqc49x3xx92p4"))))
  347. (build-system python-build-system)
  348. (arguments
  349. `(#:phases
  350. (modify-phases %standard-phases
  351. (add-after 'unpack 'patch-path
  352. (lambda* (#:key inputs #:allow-other-keys)
  353. (let ((pulse (assoc-ref inputs "pulseaudio")))
  354. (substitute* "pulsemixer"
  355. (("libpulse.so.0")
  356. (string-append pulse "/lib/libpulse.so.0")))
  357. #t))))))
  358. (inputs
  359. `(("pulseaudio" ,pulseaudio)))
  360. (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
  361. (synopsis "Command-line and curses mixer for PulseAudio")
  362. (description "Pulsemixer is a PulseAudio mixer with command-line and
  363. curses-style interfaces.")
  364. (license l:expat)))
  365. (define-public pulseaudio-dlna
  366. ;; The last release was in 2016; use a more recent commit.
  367. (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
  368. (revision "1"))
  369. (package
  370. (name "pulseaudio-dlna")
  371. (version (git-version "0.5.2" revision commit))
  372. (source
  373. (origin
  374. (method git-fetch)
  375. (uri (git-reference
  376. (url "https://github.com/masmu/pulseaudio-dlna")
  377. (commit commit)))
  378. (file-name (git-file-name name version))
  379. (sha256
  380. (base32
  381. "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
  382. (build-system python-build-system)
  383. (arguments `(#:python ,python-2))
  384. (inputs
  385. `(("python2-chardet" ,python2-chardet)
  386. ("python2-dbus" ,python2-dbus)
  387. ("python2-docopt" ,python2-docopt)
  388. ("python2-futures" ,python2-futures)
  389. ("python2-pygobject" ,python2-pygobject)
  390. ("python2-lxml" ,python2-lxml)
  391. ("python2-netifaces" ,python2-netifaces)
  392. ("python2-notify2" ,python2-notify2)
  393. ("python2-protobuf" ,python2-protobuf)
  394. ("python2-psutil" ,python2-psutil)
  395. ("python2-requests" ,python2-requests)
  396. ("python2-pyroute2" ,python2-pyroute2)
  397. ("python2-setproctitle" ,python2-setproctitle)
  398. ("python2-zeroconf" ,python2-zeroconf)))
  399. (home-page "https://github.com/masmu/pulseaudio-dlna")
  400. (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
  401. (description "This lightweight streaming server brings DLNA/UPnP and
  402. Chromecast support to PulseAudio. It can stream your current PulseAudio
  403. playback to different UPnP devices (UPnP Media Renderers, including Sonos
  404. devices and some Smart TVs) or Chromecasts in your network. You should also
  405. install one or more of the following packages alongside pulseaudio-dlna:
  406. @itemize
  407. @item ffmpeg - transcoding support for multiple codecs
  408. @item flac - FLAC transcoding support
  409. @item lame - MP3 transcoding support
  410. @item opus-tools - Opus transcoding support
  411. @item sox - WAV transcoding support
  412. @item vorbis-tools - Vorbis transcoding support
  413. @end itemize")
  414. (license l:gpl3+))))
  415. (define-public pamixer
  416. (package
  417. (name "pamixer")
  418. (version "1.4")
  419. (source
  420. (origin
  421. (method git-fetch)
  422. (uri (git-reference
  423. (url "https://github.com/cdemoulins/pamixer")
  424. (commit version)))
  425. (file-name (git-file-name name version))
  426. (sha256
  427. (base32 "1i14550n8paijwwnhksv5izgfqm3s5q2773bdfp6vyqybkll55f7"))))
  428. (build-system gnu-build-system)
  429. (arguments
  430. `(#:tests? #f ; There is no test suite.
  431. #:make-flags
  432. (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
  433. #:phases
  434. (modify-phases %standard-phases
  435. (delete 'configure) ; There's no configure phase.
  436. (add-before 'install 'mkdir-bin
  437. (lambda _
  438. (mkdir-p (string-append (assoc-ref %outputs "out") "/bin"))
  439. #t)))))
  440. (inputs
  441. `(("boost" ,boost)
  442. ("pulseaudio" ,pulseaudio)))
  443. (home-page "https://github.com/cdemoulins/pamixer")
  444. (synopsis "PulseAudio command line mixer")
  445. (description
  446. "pamixer is like amixer but for PulseAudio, allowing easy control of the
  447. volume levels of the sinks (get, set, decrease, increase, toggle mute, etc).")
  448. (license l:gpl3+)))
  449. (define-public pasystray
  450. (package
  451. (name "pasystray")
  452. (version "0.7.1")
  453. (source
  454. (origin
  455. (method git-fetch)
  456. (uri (git-reference
  457. (url "https://github.com/christophgysin/pasystray")
  458. (commit (string-append name "-" version))))
  459. (file-name (git-file-name name version))
  460. (sha256
  461. (base32 "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"))))
  462. (build-system gnu-build-system)
  463. (arguments
  464. `(#:phases
  465. (modify-phases %standard-phases
  466. (add-before 'bootstrap 'remove-bootstrap.sh
  467. (lambda _
  468. ;; Interferes with the bootstrap phase.
  469. (delete-file "bootstrap.sh")
  470. #t)))))
  471. (native-inputs
  472. `(("autoconf" ,autoconf)
  473. ("automake" ,automake)
  474. ("pkg-config" ,pkg-config)))
  475. (inputs
  476. `(("avahi" ,avahi)
  477. ("gtk+" ,gtk+)
  478. ("libnotify" ,libnotify)
  479. ("libx11" ,libx11)
  480. ("pulseaudio" ,pulseaudio)))
  481. (home-page "https://github.com/christophgysin/pasystray")
  482. (synopsis "PulseAudio controller for the system tray")
  483. (description "@command{pasystray} enables control of various
  484. PulseAudio server settings from the X11 system tray. See the project
  485. README.md for a detailed list of features.")
  486. (license l:lgpl2.1+)))
  487. (define-public paprefs
  488. (package
  489. (name "paprefs")
  490. (version "1.1")
  491. (source
  492. (origin
  493. (method url-fetch)
  494. (uri (string-append "https://www.freedesktop.org/software/pulseaudio/"
  495. name "/" name "-" version ".tar.xz"))
  496. (sha256
  497. (base32
  498. "189z5p20hk0xv9vwvym293503j4pwl03xqk9hl7cl6dwgv0l7wkf"))))
  499. (build-system meson-build-system)
  500. (native-inputs
  501. `(("gettext" ,gettext-minimal)
  502. ("pkg-config" ,pkg-config)))
  503. (inputs
  504. `(("gtkmm" ,gtkmm-3)
  505. ("pulseaudio" ,pulseaudio)))
  506. (home-page "https://freedesktop.org/software/pulseaudio/paprefs/")
  507. (synopsis "Simple GTK based configuration dialog for the PulseAudio sound
  508. server")
  509. (description "@command{paprefs} is a simple GTK based configuration
  510. dialog for the PulseAudio sound server. Note that this program can
  511. only configure local servers, and requires that a special module
  512. module-gsettings is loaded in the sound server.")
  513. (license l:gpl2)))
  514. (define-public rnnoise
  515. (package
  516. (name "rnnoise")
  517. (version "0.91")
  518. (source
  519. (origin
  520. (method git-fetch)
  521. (uri (git-reference
  522. (url "https://github.com/werman/noise-suppression-for-voice")
  523. (commit (string-append "v" version))))
  524. (file-name (git-file-name name version))
  525. (sha256
  526. (base32 "11pwisbcks7g0mdgcrrv49v3ci1l6m26bbb7f67xz4pr1hai5dwc"))))
  527. (build-system cmake-build-system)
  528. (arguments
  529. ;; No tests.
  530. '(#:tests? #f))
  531. (inputs
  532. `(;; TODO: Package VST to build the corresponding plugin.
  533. ("pulseaudio" ,pulseaudio)))
  534. (home-page "https://github.com/werman/noise-suppression-for-voice")
  535. (synopsis "Real-time Noise suppression plugin based on Xiph's RNNoise")
  536. (description "The plugin is meant to suppress a wide range of noise
  537. origins: computer fans, office, crowd, airplane, car, train, construction.
  538. Mild background noise is always suppressed, loud sounds, like
  539. clicking of mechanical keyboard, are suppressed while there is no voice
  540. however they are only reduced in volume when voice is present.
  541. The plugin is made to work with 1 or 2 channels (ladspa plugin),
  542. 16 bit, 48000 Hz audio input.")
  543. (license l:gpl3)))
  544. (define-public noisetorch
  545. (package
  546. (name "noisetorch")
  547. (version "0.8.3")
  548. (source
  549. (origin
  550. (method git-fetch)
  551. (uri (git-reference
  552. (url "https://github.com/lawl/NoiseTorch")
  553. (commit version)))
  554. (file-name (git-file-name name version))
  555. (sha256
  556. (base32 "115sq4waq048bv82lnq5sblf62m50yvyakx7x06qq359v7qf5ji1"))))
  557. (build-system go-build-system)
  558. (arguments
  559. `(#:import-path "github.com/lawl/NoiseTorch"
  560. #:install-source? #f
  561. #:phases
  562. (modify-phases %standard-phases
  563. (add-after 'unpack 'symlink-rnnoise
  564. (lambda* (#:key inputs #:allow-other-keys)
  565. (with-directory-excursion "src/github.com/lawl/NoiseTorch"
  566. (let ((dir "librnnoise_ladspa/bin/ladspa")
  567. (rnnoise (assoc-ref inputs "rnnoise")))
  568. (mkdir-p dir)
  569. (symlink (string-append rnnoise "/lib/ladspa/librnnoise_ladspa.so")
  570. (string-append dir "/librnnoise_ladspa.so"))))
  571. #t))
  572. (add-after 'unpack 'gen-version.go
  573. (lambda _
  574. (with-directory-excursion "src/github.com/lawl/NoiseTorch"
  575. (substitute* "main.go"
  576. (("//go:generate go run scripts/embedversion\\.go") ""))
  577. (with-output-to-file "version.go"
  578. (lambda ()
  579. (format #t "package main~%~%var version=~s~&" ,version))))
  580. #t))
  581. (add-after 'unpack 'disable-update-check.go
  582. (lambda _
  583. (with-directory-excursion "src/github.com/lawl/NoiseTorch"
  584. (substitute* "main.go"
  585. ((".*updateCheck.*") "")))
  586. #t))
  587. (add-before 'build 'go-generate
  588. (lambda _
  589. (with-directory-excursion "src/github.com/lawl/NoiseTorch"
  590. (invoke "go" "generate")))))))
  591. (inputs
  592. `(("rnnoise" ,rnnoise)))
  593. (home-page "https://github.com/lawl/NoiseTorch")
  594. (synopsis "Real-time microphone noise suppression")
  595. (description "NoiseTorch creates a virtual PulseAudio microphone that
  596. suppresses noise, in any application. Use whichever conferencing or VOIP
  597. application you like and simply select the NoiseTorch Virtual Microphone as
  598. input to torch the sound of your mechanical keyboard, computer fans, trains
  599. and the likes.")
  600. (license l:gpl3)))