1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2017, 2020, 2021 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, 2020 Pierre Langlois <pierre.langlois@gmx.com>
8 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages mp3)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages gcc)
33 #:use-module (gnu packages boost)
34 #:use-module (gnu packages cdrom)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages ghostscript)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages pcre)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-web)
46 #:use-module (gnu packages python-xyz)
47 #:use-module (gnu packages xiph)
48 #:use-module (gnu packages pulseaudio)
49 #:use-module (gnu packages linux) ;alsa-lib
50 #:use-module (gnu packages video) ;ffmpeg
51 #:use-module (guix packages)
52 #:use-module (guix download)
53 #:use-module (guix git-download)
54 #:use-module (guix utils)
55 #:use-module (guix build-system gnu)
56 #:use-module (guix build-system python)
57 #:use-module (guix build-system cmake))
65 (uri (string-append "mirror://sourceforge/mad/libmad/"
70 "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
71 (patches (search-patches "libmad-armv7-thumb-pt1.patch"
72 "libmad-armv7-thumb-pt2.patch"
73 "libmad-md_size.patch"
74 "libmad-length-check.patch"
75 "libmad-mips-newgcc.patch"))))
76 (build-system gnu-build-system)
79 (modify-phases %standard-phases
80 (add-before 'configure 'remove-unsupported-gcc-flags
82 ;; remove option that is not supported by gcc any more
83 (substitute* "configure" ((" -fforce-mem") ""))
85 ;; Normally one should not add a pkg-config file if one is not provided
86 ;; by upstream developers, but Audacity expects a pkg-config file for
87 ;; this package, and other major GNU/Linux distributions already provide
89 (add-after 'install 'install-pkg-config
90 (lambda* (#:key outputs #:allow-other-keys)
91 (let* ((out (assoc-ref outputs "out"))
92 (pkg-config-dir (string-append out "/lib/pkgconfig")))
93 (mkdir-p pkg-config-dir)
94 (with-output-to-file (string-append pkg-config-dir "/mad.pc")
98 libdir=${prefix}/lib~@
99 includedir=${prefix}/include~@
104 Libs: -L${libdir} -lmad~@
105 Cflags: -I${includedir}~%"
106 out ,version)))))))))
107 (synopsis "MPEG audio decoder")
109 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
110 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
111 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
114 This package contains the library.")
115 (license license:gpl2+)
116 (home-page "https://www.underbit.com/products/mad/")))
118 (define-public libid3tag
124 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
125 version "/libid3tag-"
129 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
130 (build-system gnu-build-system)
133 (modify-phases %standard-phases
134 ;; Normally one should not add a pkg-config file if one is not provided
135 ;; by upstream developers, but Audacity expects a pkg-config file for
136 ;; this package, and other major GNU/Linux distributions already provide
138 (add-after 'install 'install-pkg-config
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let* ((out (assoc-ref outputs "out"))
141 (pkg-config-dir (string-append out "/lib/pkgconfig")))
142 (mkdir-p pkg-config-dir)
143 (with-output-to-file (string-append pkg-config-dir "/id3tag.pc")
147 libdir=${prefix}/lib~@
148 includedir=${prefix}/include~@
153 Libs: -L${libdir} -lid3tag -lz~@
154 Cflags: -I${includedir}~%"
155 out ,version)))))))))
156 (inputs `(("zlib" ,zlib)))
157 (synopsis "Library for reading ID3 tags")
159 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
161 (license license:gpl2+)
162 (home-page "https://www.underbit.com/products/mad/")))
164 (define-public id3lib
170 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
171 version "/id3lib-" version ".tar.gz"))
174 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
175 (modules '((guix build utils)))
176 ;; Don't use bundled zlib
177 (snippet '(begin (delete-file-recursively "zlib") #t))
178 (patches (search-patches "id3lib-CVE-2007-4460.patch"
179 "id3lib-UTF16-writing-bug.patch"))))
180 (build-system gnu-build-system)
181 (inputs `(("zlib" ,zlib)))
184 (modify-phases %standard-phases
185 (add-before 'configure 'apply-patches
186 ;; TODO: create a patch for origin instead?
188 (substitute* "configure"
189 (("iomanip.h") "")) ; drop check for unused header
190 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
191 (substitute* "include/id3/id3lib_strings.h"
192 (("include <string>") "include <cstring>\n#include <string>"))
193 (substitute* "include/id3/writers.h"
194 (("//\\#include <string.h>") "#include <cstring>"))
195 (substitute* "examples/test_io.cpp"
196 (("dami;") "dami;\nusing namespace std;"))
198 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
200 "Id3lib is a cross-platform software development library for reading,
201 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
202 whose primary goals are full compliance with the ID3v2 standard, portability
203 across several platforms, and providing a powerful and feature-rich API with
204 a highly stable and efficient implementation.")
205 (license license:lgpl2.0+)
206 (home-page "http://id3lib.sourceforge.net/")))
208 (define-public taglib
215 (url "https://github.com/taglib/taglib")
216 (commit (string-append "v" version))))
217 (file-name (git-file-name name version))
220 "0q7dkn5rh9v6b0scmcp2qmjv3iransafmpn6jvgid0yq75m2nqd2"))))
221 (build-system cmake-build-system)
223 '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
224 #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")
225 #:phases (modify-phases %standard-phases
226 (add-before 'configure 'adjust-zlib-ldflags
227 (lambda* (#:key inputs #:allow-other-keys)
228 ;; Make sure users of 'taglib-config --libs' get the -L
230 (substitute* "CMakeLists.txt"
231 (("set\\(ZLIB_LIBRARIES_FLAGS -lz\\)")
232 (string-append "set(ZLIB_LIBRARIES_FLAGS \"-L"
233 (assoc-ref inputs "zlib")
236 (inputs `(("zlib" ,zlib)))
237 (home-page "https://taglib.org")
238 (synopsis "Library to access audio file meta-data")
240 "TagLib is a C++ library for reading and editing the meta-data of several
241 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
242 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
243 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
245 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
246 (license (list license:lgpl2.1 license:mpl1.1))))
248 (define-public mp3info
255 "https://ibiblio.org"
256 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
260 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
261 (modules '((guix build utils)))
264 (substitute* "Makefile"
266 (("/usr/bin/install") "install")
267 (("man/man1") "share/man/man1"))
269 (build-system gnu-build-system)
270 (outputs '("out" "gui")) ;GTK+ interface in "gui"
273 (modify-phases %standard-phases
275 (lambda* (#:key outputs #:allow-other-keys)
276 (let ((out (assoc-ref outputs "out")))
277 (substitute* "Makefile"
279 (string-append "prefix := " out "\n"))))
281 (add-before 'install 'pre-install
282 (lambda* (#:key outputs #:allow-other-keys)
283 (let ((out (assoc-ref outputs "out")))
284 (mkdir-p (string-append out "/bin"))
285 (mkdir-p (string-append out "/share/man/man1")))
287 (add-after 'install 'post-install
288 (lambda* (#:key outputs #:allow-other-keys)
289 ;; Move the GTK+ interface to "gui".
290 (let ((out (assoc-ref outputs "out"))
291 (gui (assoc-ref outputs "gui")))
292 (mkdir-p (string-append gui "/bin"))
293 (rename-file (string-append out "/bin/gmp3info")
294 (string-append gui "/bin/gmp3info")))
298 `(("pkg-config" ,pkg-config)))
301 ("ncurses" ,ncurses)))
302 (home-page "https://www.ibiblio.org/mp3info/")
303 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
305 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
306 files. MP3Info can also display various technical aspects of an MP3 file
307 including playing time, bit-rate, sampling frequency and other attributes in a
308 pre-defined or user-specifiable output format.")
309 (license license:gpl2+)))
311 (define-public libmp3splt
317 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
318 version "/libmp3splt-"
322 "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
323 (build-system gnu-build-system)
324 (inputs `(("flac" ,flac)
325 ("libid3tag" ,libid3tag)
329 ("libvorbis" ,libvorbis)
332 `(("pkg-config" ,pkg-config)))
333 (synopsis "Library for splitting mp3 and ogg vorbis files")
335 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
336 and an end time position, without decoding. For splitting an album, one may
337 select split points and file names manually or obtain them automatically from
338 CDDB (internet or a local file) or from .cue files. The tool also supports
339 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
341 This package contains the library.")
342 (license license:gpl2+)
343 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
345 (define-public mp3splt
351 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
356 "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
357 (build-system gnu-build-system)
358 (native-inputs `(("pkg-config" ,pkg-config)))
359 (inputs `(("libmp3splt" ,libmp3splt)))
360 (synopsis "Utility for splitting mp3 and ogg vorbis files")
362 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
363 and an end time position, without decoding. For splitting an album, one may
364 select split points and file names manually or obtain them automatically from
365 CDDB (internet or a local file) or from .cue files. The tool also supports
366 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
368 This package contains the binary.")
369 (license license:gpl2+)
370 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
372 (define-public mpg123
379 (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
380 version "/mpg123-" version ".tar.bz2")
382 "https://www.mpg123.org/download/mpg123-"
383 version ".tar.bz2")))
385 (base32 "01pgcqjbbi2r7nlg5118bkivl0gkv0hq0cw7v4vpxgimv7h9fajh"))))
386 (build-system gnu-build-system)
387 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
389 `(("pkg-config" ,pkg-config)))
391 `(("alsa-lib" ,alsa-lib)
392 ("pulseaudio" ,pulseaudio)))
393 (home-page "https://www.mpg123.org/")
394 (synopsis "Console MP3 player and decoder library")
396 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
397 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
398 command-line tool as well as a C library, libmpg123.")
399 (license license:lgpl2.1)))
401 (define-public mpg321
407 (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
408 version "/mpg321_" version ".orig.tar.gz"))
409 (file-name (string-append "mpg321-" version ".tar.gz"))
412 "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))
414 (search-patches "mpg321-CVE-2019-14247.patch"))))
415 (build-system gnu-build-system)
416 (arguments '(#:configure-flags '("--disable-alsa")))
420 ("libid3tag" ,libid3tag)
422 (home-page "http://mpg321.sourceforge.net/")
423 (synopsis "Command-line MP3 player")
424 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
425 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
426 use with CD-recording software).")
427 (license license:gpl2)))
435 (uri (string-append "mirror://sourceforge/lame/lame/"
436 (version-major+minor version) "/lame-"
440 "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
441 (build-system gnu-build-system)
444 (modify-phases %standard-phases
445 (add-after 'install 'install-pkg-config
446 (lambda* (#:key outputs #:allow-other-keys)
447 (let* ((out (assoc-ref outputs "out"))
448 (pkg-config-dir (string-append out "/lib/pkgconfig")))
449 (mkdir-p pkg-config-dir)
450 (with-output-to-file (string-append pkg-config-dir "/lame.pc")
454 libdir=${prefix}/lib~@
455 includedir=${prefix}/include~@
460 Libs: -L${libdir} -lmp3lame~@
461 Cflags: -I${includedir}~%"
462 out ,version)))))))))
463 (home-page "http://lame.sourceforge.net/")
464 (synopsis "MPEG Audio Layer III (MP3) encoder")
465 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
466 (license license:lgpl2.0)))
468 (define-public ripperx
474 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
479 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
480 (patches (search-patches "ripperx-missing-file.patch"))))
481 (build-system gnu-build-system)
483 `(("gs-fonts" ,gs-fonts)
484 ("cdparanoia" ,cdparanoia)
487 ("vorbis-tools" ,vorbis-tools)))
494 `(("pkg-config" ,pkg-config)))
495 (synopsis "GTK program to rip and encode CD audio tracks")
497 "RipperX is a GTK program to rip CD audio tracks and encode them to the
498 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
499 a few mouse clicks to convert an entire album. It supports CDDB lookups
500 for album and track information.")
501 (license license:gpl2)
502 (home-page "https://sourceforge.net/projects/ripperx/")))
504 (define-public libmpcdec
511 "https://files.musepack.net/source/libmpcdec-"
515 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
516 (build-system gnu-build-system)
517 (synopsis "Decoding library for the Musepack audio format")
519 "This library supports decoding of the Musepack (MPC) audio compression
521 (license license:bsd-3)
522 (home-page "https://musepack.net")))
524 (define-public mpc123
530 (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
531 version "/mpc123-" version ".tar.gz")
532 (string-append "mirror://debian/pool/main/m/" name
533 "/" name "_" version ".orig.tar.gz")))
536 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
537 (patches (search-patches "mpc123-initialize-ao.patch"))))
538 (build-system gnu-build-system)
541 (modify-phases %standard-phases
544 (substitute* "Makefile"
545 (("CC[[:blank:]]*:=.*")
548 (lambda* (#:key outputs #:allow-other-keys)
549 (let* ((out (assoc-ref outputs "out"))
550 (bin (string-append out "/bin")))
551 (install-file "mpc123" bin)))))
554 `(("gettext" ,gettext-minimal)))
557 ("libmpcdec" ,libmpcdec)))
558 (home-page "https://github.com/bucciarati/mpc123")
559 (synopsis "Audio player for Musepack-formatted files")
561 "Mpc123 is a command-line player for files in the Musepack audio
562 compression format (.mpc files).")
563 (license license:gpl2+)))
572 (uri (pypi-uri "eyeD3" version))
574 (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
575 (build-system python-build-system)
577 `(#:tests? #f)) ; the required test data contains copyrighted material
579 `(("python-grako" ,python-grako)
580 ("python-magic" ,python-magic)
581 ("python-pathlib" ,python-pathlib)
582 ("python-six" ,python-six)))
583 (synopsis "MP3 tag ID3 metadata editor")
584 (description "eyeD3 is a Python tool for working with audio files,
585 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
586 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
587 to write your own applications or plugins that are callable from the
589 (home-page "https://eyed3.readthedocs.io/en/latest/")
590 (license license:gpl2+)))
592 (define-public chromaprint
599 "https://github.com/acoustid/chromaprint/releases/download/v"
600 version "/chromaprint-" version ".tar.gz"))
603 "0sknmyl5254rc55bvkhfwpl4dfvz45xglk1rq8zq5crmwq058fjp"))))
604 (build-system cmake-build-system)
606 `(#:tests? #f ; tests require googletest *sources*
607 ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
608 #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
609 #:test-target "check"))
611 ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
612 ;; use the same ffmpeg version as for acoustid-fingerprinter
615 (home-page "https://acoustid.org/chromaprint")
616 (synopsis "Audio fingerprinting library")
617 (description "Chromaprint is a library for calculating audio
618 fingerprints which are used by the Acoustid service. Its main purpose
619 is to provide an accurate identifier for record tracks.")
620 (license license:lgpl2.1+)))
622 (define-public python-audioread
624 (name "python-audioread")
629 (uri (pypi-uri "audioread" version))
631 (base32 "129hab8x9sb3plff2bkq4xnzc3i8k9rgcm1a36l813kc0m10wj53"))))
632 (build-system python-build-system)
633 (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
635 `(("python-pytest" ,python-pytest)
636 ("python-pytest-runner" ,python-pytest-runner)))
637 (home-page "https://github.com/sampsyo/audioread")
638 (synopsis "Decode audio files using whichever backend is available")
640 "This package provides a Python library for audo decoding. It uses
641 whatever audio backend is available, such as GStreamer, Core Audio, MAD,
643 (license license:expat)))
645 (define-public python-pyacoustid
647 (name "python-pyacoustid")
652 (uri (pypi-uri "pyacoustid" version))
655 "1zan6c22ca6sjy0g9ajwjp6mkzw7jv8r3n7jzska09a6x254lf87"))))
656 (build-system python-build-system)
658 `(("python-audioread" ,python-audioread)
659 ("python-requests" ,python-requests)))
660 (home-page "https://github.com/sampsyo/pyacoustid")
661 (synopsis "Bindings for Chromaprint acoustic fingerprinting")
663 "This package provides bindings for the Chromaprint acoustic
664 fingerprinting library and the Acoustid API.")
665 (license license:expat)))
667 (define-public python-pytaglib
669 (name "python-pytaglib")
674 (uri (pypi-uri "pytaglib" version))
677 "0li970qslfymz4vk1wrij2nfqw3l15cpc3fjjci48mpvg17gbnhn"))
678 ;; Delete file generated by Cython.
679 (modules '((guix build utils)))
682 (delete-file "src/taglib.cpp")))))
683 (build-system python-build-system)
686 (modify-phases %standard-phases
687 ;; Ensure that the Cython file is regenerated.
688 (add-after 'unpack 'setup-environment
690 (setenv "PYTAGLIB_CYTHONIZE" "1"))))))
692 `(("python-cython" ,python-cython)
693 ("python-pytest" ,python-pytest)))
695 `(("taglib" ,taglib)))
697 "https://github.com/supermihi/pytaglib")
699 "Python bindings for taglib")
701 "This package is a Python audio tagging library. It is
702 cross-platform, works with all Python versions, and is very
703 simple to use yet fully featured.")
704 (license license:gpl3)))