1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017, 2019 Pierre Langlois <pierre.langlois@gmx.com>
8 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages mp3)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages gcc)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages cdrom)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages ghostscript)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages pcre)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages python-web)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages xiph)
47 #:use-module (gnu packages pulseaudio)
48 #:use-module (gnu packages linux) ;alsa-lib
49 #:use-module (gnu packages video) ;ffmpeg
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix utils)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system python)
55 #:use-module (guix build-system cmake))
63 (uri (string-append "mirror://sourceforge/mad/libmad/"
68 "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
69 (patches (search-patches "libmad-armv7-thumb-pt1.patch"
70 "libmad-armv7-thumb-pt2.patch"
71 "libmad-md_size.patch"
72 "libmad-length-check.patch"
73 "libmad-mips-newgcc.patch"))))
74 (build-system gnu-build-system)
77 (modify-phases %standard-phases
78 (add-before 'configure 'remove-unsupported-gcc-flags
80 ;; remove option that is not supported by gcc any more
81 (substitute* "configure" ((" -fforce-mem") ""))
83 (synopsis "MPEG audio decoder")
85 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
86 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
87 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
90 This package contains the library.")
91 (license license:gpl2+)
92 (home-page "https://www.underbit.com/products/mad/")))
94 (define-public libid3tag
100 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
101 version "/libid3tag-"
105 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
106 (build-system gnu-build-system)
107 (inputs `(("zlib" ,zlib)))
108 (synopsis "Library for reading ID3 tags")
110 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
112 (license license:gpl2+)
113 (home-page "https://www.underbit.com/products/mad/")))
115 (define-public id3lib
121 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
122 version "/id3lib-" version ".tar.gz"))
125 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
126 (modules '((guix build utils)))
127 ;; Don't use bundled zlib
128 (snippet '(begin (delete-file-recursively "zlib") #t))
129 (patches (search-patches "id3lib-CVE-2007-4460.patch"
130 "id3lib-UTF16-writing-bug.patch"))))
131 (build-system gnu-build-system)
132 (inputs `(("zlib" ,zlib)))
135 (modify-phases %standard-phases
136 (add-before 'configure 'apply-patches
137 ;; TODO: create a patch for origin instead?
139 (substitute* "configure"
140 (("iomanip.h") "")) ; drop check for unused header
141 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
142 (substitute* "include/id3/id3lib_strings.h"
143 (("include <string>") "include <cstring>\n#include <string>"))
144 (substitute* "include/id3/writers.h"
145 (("//\\#include <string.h>") "#include <cstring>"))
146 (substitute* "examples/test_io.cpp"
147 (("dami;") "dami;\nusing namespace std;"))
149 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
151 "Id3lib is a cross-platform software development library for reading,
152 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
153 whose primary goals are full compliance with the ID3v2 standard, portability
154 across several platforms, and providing a powerful and feature-rich API with
155 a highly stable and efficient implementation.")
156 (license license:lgpl2.0+)
157 (home-page "http://id3lib.sourceforge.net/")))
159 (define-public taglib
165 (uri (string-append "http://taglib.github.io/releases/taglib-"
169 "0ssjcdjv4qf9liph5ry1kngam1y7zp8fzr9xv4wzzrma22kabldn"))))
170 (build-system cmake-build-system)
172 '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
173 #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")))
174 (inputs `(("zlib" ,zlib)))
175 (home-page "http://taglib.org")
176 (synopsis "Library to access audio file meta-data")
178 "TagLib is a C++ library for reading and editing the meta-data of several
179 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
180 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
181 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
183 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
184 (license (list license:lgpl2.1 license:mpl1.1))))
186 (define-public mp3info
193 "https://ibiblio.org"
194 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
198 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
199 (modules '((guix build utils)))
202 (substitute* "Makefile"
204 (("/usr/bin/install") "install")
205 (("man/man1") "share/man/man1"))
207 (build-system gnu-build-system)
208 (outputs '("out" "gui")) ;GTK+ interface in "gui"
211 (modify-phases %standard-phases
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let ((out (assoc-ref outputs "out")))
215 (substitute* "Makefile"
217 (string-append "prefix := " out "\n"))))
219 (add-before 'install 'pre-install
220 (lambda* (#:key outputs #:allow-other-keys)
221 (let ((out (assoc-ref outputs "out")))
222 (mkdir-p (string-append out "/bin"))
223 (mkdir-p (string-append out "/share/man/man1")))
225 (add-after 'install 'post-install
226 (lambda* (#:key outputs #:allow-other-keys)
227 ;; Move the GTK+ interface to "gui".
228 (let ((out (assoc-ref outputs "out"))
229 (gui (assoc-ref outputs "gui")))
230 (mkdir-p (string-append gui "/bin"))
231 (rename-file (string-append out "/bin/gmp3info")
232 (string-append gui "/bin/gmp3info")))
236 `(("pkg-config" ,pkg-config)))
239 ("ncurses" ,ncurses)))
240 (home-page "https://www.ibiblio.org/mp3info/")
241 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
243 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
244 files. MP3Info can also display various technical aspects of an MP3 file
245 including playing time, bit-rate, sampling frequency and other attributes in a
246 pre-defined or user-specifiable output format.")
247 (license license:gpl2+)))
249 (define-public libmp3splt
255 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
256 version "/libmp3splt-"
260 "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
261 (build-system gnu-build-system)
262 (inputs `(("libid3tag" ,libid3tag)
266 ("libvorbis" ,libvorbis)
269 `(("pkg-config" ,pkg-config)))
270 (synopsis "Library for splitting mp3 and ogg vorbis files")
272 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
273 and an end time position, without decoding. For splitting an album, one may
274 select split points and file names manually or obtain them automatically from
275 CDDB (internet or a local file) or from .cue files. The tool also supports
276 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
278 This package contains the library.")
279 (license license:gpl2+)
280 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
282 (define-public mp3splt
288 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
293 "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
294 (build-system gnu-build-system)
295 (native-inputs `(("pkg-config" ,pkg-config)))
296 (inputs `(("libmp3splt" ,libmp3splt)))
297 (synopsis "Utility for splitting mp3 and ogg vorbis files")
299 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
300 and an end time position, without decoding. For splitting an album, one may
301 select split points and file names manually or obtain them automatically from
302 CDDB (internet or a local file) or from .cue files. The tool also supports
303 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
305 This package contains the binary.")
306 (license license:gpl2+)
307 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
309 (define-public mpg123
315 (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
316 version "/mpg123-" version ".tar.bz2")
318 "https://www.mpg123.org/download/mpg123-"
319 version ".tar.bz2")))
322 "02l915jq0ymndb082g6w89bpf66z04ifa1lr7ga3yycw6m46hc4h"))))
323 (build-system gnu-build-system)
324 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
325 (native-inputs `(("pkg-config" ,pkg-config)))
326 (inputs `(("pulseaudio" ,pulseaudio)
327 ("alsa-lib" ,alsa-lib)))
328 (home-page "https://www.mpg123.org/")
329 (synopsis "Console MP3 player and decoder library")
331 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
332 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
333 command-line tool as well as a C library, libmpg123.")
334 (license license:lgpl2.1)))
336 (define-public mpg321
342 (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
343 version "/mpg321-" version ".tar.gz"))
346 "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))))
347 (build-system gnu-build-system)
348 (arguments '(#:configure-flags '("--disable-alsa")))
352 ("libid3tag" ,libid3tag)
354 (home-page "http://mpg321.sourceforge.net/")
355 (synopsis "Command-line MP3 player")
356 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
357 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
358 use with CD-recording software).")
359 (license license:gpl2)))
367 (uri (string-append "mirror://sourceforge/lame/lame/"
368 (version-major+minor version) "/lame-"
372 "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
373 (build-system gnu-build-system)
374 (home-page "http://lame.sourceforge.net/")
375 (synopsis "MPEG Audio Layer III (MP3) encoder")
376 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
377 (license license:lgpl2.0)))
379 (define-public ripperx
385 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
390 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
391 (patches (search-patches "ripperx-missing-file.patch"))))
392 (build-system gnu-build-system)
394 `(("gs-fonts" ,gs-fonts)
395 ("cdparanoia" ,cdparanoia)
398 ("vorbis-tools" ,vorbis-tools)))
405 `(("pkg-config" ,pkg-config)))
406 (synopsis "GTK program to rip and encode CD audio tracks")
408 "RipperX is a GTK program to rip CD audio tracks and encode them to the
409 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
410 a few mouse clicks to convert an entire album. It supports CDDB lookups
411 for album and track information.")
412 (license license:gpl2)
413 (home-page "https://sourceforge.net/projects/ripperx/")))
415 (define-public libmpcdec
422 "https://files.musepack.net/source/libmpcdec-"
426 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
427 (build-system gnu-build-system)
428 (synopsis "Decoding library for the Musepack audio format")
430 "This library supports decoding of the Musepack (MPC) audio compression
432 (license license:bsd-3)
433 (home-page "https://musepack.net")))
435 (define-public mpc123
441 (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
442 version "/mpc123-" version ".tar.gz")
443 (string-append "mirror://debian/pool/main/m/" name
444 "/" name "_" version ".orig.tar.gz")))
447 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
448 (patches (search-patches "mpc123-initialize-ao.patch"))))
449 (build-system gnu-build-system)
452 (modify-phases %standard-phases
455 (substitute* "Makefile"
456 (("CC[[:blank:]]*:=.*")
459 (lambda* (#:key outputs #:allow-other-keys)
460 (let* ((out (assoc-ref outputs "out"))
461 (bin (string-append out "/bin")))
462 (install-file "mpc123" bin)))))
465 `(("gettext" ,gettext-minimal)))
468 ("libmpcdec" ,libmpcdec)))
469 (home-page "https://github.com/bucciarati/mpc123")
470 (synopsis "Audio player for Musepack-formatted files")
472 "Mpc123 is a command-line player for files in the Musepack audio
473 compression format (.mpc files).")
474 (license license:gpl2+)))
483 (uri (pypi-uri "eyeD3" version))
485 (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
486 (build-system python-build-system)
488 `(#:tests? #f)) ; the required test data contains copyrighted material
490 `(("python-grako" ,python-grako)
491 ("python-magic" ,python-magic)
492 ("python-pathlib" ,python-pathlib)
493 ("python-six" ,python-six)))
494 (synopsis "MP3 tag ID3 metadata editor")
495 (description "eyeD3 is a Python tool for working with audio files,
496 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
497 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
498 to write your own applications or plugins that are callable from the
500 (home-page "https://eyed3.readthedocs.io/en/latest/")
501 (license license:gpl2+)))
503 (define-public chromaprint
510 "https://github.com/acoustid/chromaprint/releases/download/v"
511 version "/chromaprint-" version ".tar.gz"))
514 "10kz8lncal4s2rp2rqpgc6xyjp0jzcrihgkx7chf127vfs5n067a"))))
515 (build-system cmake-build-system)
517 `(#:tests? #f ; tests require googletest *sources*
518 ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
519 #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
520 #:test-target "check"))
522 ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
523 ;; use the same ffmpeg version as for acoustid-fingerprinter
526 (home-page "https://acoustid.org/chromaprint")
527 (synopsis "Audio fingerprinting library")
528 (description "Chromaprint is a library for calculating audio
529 fingerprints which are used by the Acoustid service. Its main purpose
530 is to provide an accurate identifier for record tracks.")
531 (license license:lgpl2.1+)))
533 (define-public python-audioread
535 (name "python-audioread")
540 (uri (pypi-uri "audioread" version))
543 "0s6iilb8ca6j6nv5a5hbyxi5alr3crvsbr6kggh82a44pkx08f87"))))
544 (build-system python-build-system)
545 (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
547 `(("python-pytest" ,python-pytest)
548 ("python-pytest-runner" ,python-pytest-runner)))
549 (home-page "https://github.com/sampsyo/audioread")
550 (synopsis "Decode audio files using whichever backend is available")
552 "This package provides a Python library for audo decoding. It uses
553 whatever audio backend is available, such as GStreamer, Core Audio, MAD,
555 (license license:expat)))
557 (define-public python-pyacoustid
559 (name "python-pyacoustid")
564 (uri (pypi-uri "pyacoustid" version))
567 "1zan6c22ca6sjy0g9ajwjp6mkzw7jv8r3n7jzska09a6x254lf87"))))
568 (build-system python-build-system)
570 `(("python-audioread" ,python-audioread)
571 ("python-requests" ,python-requests)))
572 (home-page "https://github.com/sampsyo/pyacoustid")
573 (synopsis "Bindings for Chromaprint acoustic fingerprinting")
575 "This package provides bindings for the Chromaprint acoustic
576 fingerprinting library and the Acoustid API.")
577 (license license:expat)))