1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2017, 2020 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, 2019, 2020 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 (synopsis "MPEG audio decoder")
87 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
88 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
89 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
92 This package contains the library.")
93 (license license:gpl2+)
94 (home-page "https://www.underbit.com/products/mad/")))
96 (define-public libid3tag
102 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
103 version "/libid3tag-"
107 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
108 (build-system gnu-build-system)
109 (inputs `(("zlib" ,zlib)))
110 (synopsis "Library for reading ID3 tags")
112 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
114 (license license:gpl2+)
115 (home-page "https://www.underbit.com/products/mad/")))
117 (define-public id3lib
123 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
124 version "/id3lib-" version ".tar.gz"))
127 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
128 (modules '((guix build utils)))
129 ;; Don't use bundled zlib
130 (snippet '(begin (delete-file-recursively "zlib") #t))
131 (patches (search-patches "id3lib-CVE-2007-4460.patch"
132 "id3lib-UTF16-writing-bug.patch"))))
133 (build-system gnu-build-system)
134 (inputs `(("zlib" ,zlib)))
137 (modify-phases %standard-phases
138 (add-before 'configure 'apply-patches
139 ;; TODO: create a patch for origin instead?
141 (substitute* "configure"
142 (("iomanip.h") "")) ; drop check for unused header
143 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
144 (substitute* "include/id3/id3lib_strings.h"
145 (("include <string>") "include <cstring>\n#include <string>"))
146 (substitute* "include/id3/writers.h"
147 (("//\\#include <string.h>") "#include <cstring>"))
148 (substitute* "examples/test_io.cpp"
149 (("dami;") "dami;\nusing namespace std;"))
151 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
153 "Id3lib is a cross-platform software development library for reading,
154 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
155 whose primary goals are full compliance with the ID3v2 standard, portability
156 across several platforms, and providing a powerful and feature-rich API with
157 a highly stable and efficient implementation.")
158 (license license:lgpl2.0+)
159 (home-page "http://id3lib.sourceforge.net/")))
161 (define-public taglib
164 (version "1.12-beta-1")
168 (url "https://github.com/taglib/taglib")
169 (commit (string-append "v" version))))
170 (file-name (git-file-name name version))
173 "1mp6w2ikniw8w6d5wr0h20j0ijg8jw7s9dli5a8k9znpznvxpym4"))))
174 (build-system cmake-build-system)
176 '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
177 #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")
178 #:phases (modify-phases %standard-phases
179 (add-before 'configure 'adjust-zlib-ldflags
180 (lambda* (#:key inputs #:allow-other-keys)
181 ;; Make sure users of 'taglib-config --libs' get the -L
183 (substitute* "CMakeLists.txt"
184 (("set\\(ZLIB_LIBRARIES_FLAGS -lz\\)")
185 (string-append "set(ZLIB_LIBRARIES_FLAGS \"-L"
186 (assoc-ref inputs "zlib")
189 (inputs `(("zlib" ,zlib)))
190 (home-page "https://taglib.org")
191 (synopsis "Library to access audio file meta-data")
193 "TagLib is a C++ library for reading and editing the meta-data of several
194 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
195 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
196 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
198 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
199 (license (list license:lgpl2.1 license:mpl1.1))))
201 (define-public mp3info
208 "https://ibiblio.org"
209 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
213 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
214 (modules '((guix build utils)))
217 (substitute* "Makefile"
219 (("/usr/bin/install") "install")
220 (("man/man1") "share/man/man1"))
222 (build-system gnu-build-system)
223 (outputs '("out" "gui")) ;GTK+ interface in "gui"
226 (modify-phases %standard-phases
228 (lambda* (#:key outputs #:allow-other-keys)
229 (let ((out (assoc-ref outputs "out")))
230 (substitute* "Makefile"
232 (string-append "prefix := " out "\n"))))
234 (add-before 'install 'pre-install
235 (lambda* (#:key outputs #:allow-other-keys)
236 (let ((out (assoc-ref outputs "out")))
237 (mkdir-p (string-append out "/bin"))
238 (mkdir-p (string-append out "/share/man/man1")))
240 (add-after 'install 'post-install
241 (lambda* (#:key outputs #:allow-other-keys)
242 ;; Move the GTK+ interface to "gui".
243 (let ((out (assoc-ref outputs "out"))
244 (gui (assoc-ref outputs "gui")))
245 (mkdir-p (string-append gui "/bin"))
246 (rename-file (string-append out "/bin/gmp3info")
247 (string-append gui "/bin/gmp3info")))
251 `(("pkg-config" ,pkg-config)))
254 ("ncurses" ,ncurses)))
255 (home-page "https://www.ibiblio.org/mp3info/")
256 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
258 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
259 files. MP3Info can also display various technical aspects of an MP3 file
260 including playing time, bit-rate, sampling frequency and other attributes in a
261 pre-defined or user-specifiable output format.")
262 (license license:gpl2+)))
264 (define-public libmp3splt
270 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
271 version "/libmp3splt-"
275 "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
276 (build-system gnu-build-system)
277 (inputs `(("libid3tag" ,libid3tag)
281 ("libvorbis" ,libvorbis)
284 `(("pkg-config" ,pkg-config)))
285 (synopsis "Library for splitting mp3 and ogg vorbis files")
287 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
288 and an end time position, without decoding. For splitting an album, one may
289 select split points and file names manually or obtain them automatically from
290 CDDB (internet or a local file) or from .cue files. The tool also supports
291 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
293 This package contains the library.")
294 (license license:gpl2+)
295 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
297 (define-public mp3splt
303 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
308 "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
309 (build-system gnu-build-system)
310 (native-inputs `(("pkg-config" ,pkg-config)))
311 (inputs `(("libmp3splt" ,libmp3splt)))
312 (synopsis "Utility for splitting mp3 and ogg vorbis files")
314 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
315 and an end time position, without decoding. For splitting an album, one may
316 select split points and file names manually or obtain them automatically from
317 CDDB (internet or a local file) or from .cue files. The tool also supports
318 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
320 This package contains the binary.")
321 (license license:gpl2+)
322 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
324 (define-public mpg123
331 (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
332 version "/mpg123-" version ".tar.bz2")
334 "https://www.mpg123.org/download/mpg123-"
335 version ".tar.bz2")))
337 (base32 "0vkcfdx0mqq6lmpczsmpa2jsb0s6dryx3i7gvr32i3w9b9w9ij9h"))))
338 (build-system gnu-build-system)
339 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
341 `(("pkg-config" ,pkg-config)))
343 `(("alsa-lib" ,alsa-lib)
344 ("pulseaudio" ,pulseaudio)))
345 (home-page "https://www.mpg123.org/")
346 (synopsis "Console MP3 player and decoder library")
348 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
349 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
350 command-line tool as well as a C library, libmpg123.")
351 (license license:lgpl2.1)))
353 (define-public mpg321
359 (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
360 version "/mpg321-" version ".tar.gz"))
363 "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))))
364 (build-system gnu-build-system)
365 (arguments '(#:configure-flags '("--disable-alsa")))
369 ("libid3tag" ,libid3tag)
371 (home-page "http://mpg321.sourceforge.net/")
372 (synopsis "Command-line MP3 player")
373 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
374 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
375 use with CD-recording software).")
376 (license license:gpl2)))
384 (uri (string-append "mirror://sourceforge/lame/lame/"
385 (version-major+minor version) "/lame-"
389 "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
390 (build-system gnu-build-system)
391 (home-page "http://lame.sourceforge.net/")
392 (synopsis "MPEG Audio Layer III (MP3) encoder")
393 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
394 (license license:lgpl2.0)))
396 (define-public ripperx
402 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
407 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
408 (patches (search-patches "ripperx-missing-file.patch"))))
409 (build-system gnu-build-system)
411 `(("gs-fonts" ,gs-fonts)
412 ("cdparanoia" ,cdparanoia)
415 ("vorbis-tools" ,vorbis-tools)))
422 `(("pkg-config" ,pkg-config)))
423 (synopsis "GTK program to rip and encode CD audio tracks")
425 "RipperX is a GTK program to rip CD audio tracks and encode them to the
426 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
427 a few mouse clicks to convert an entire album. It supports CDDB lookups
428 for album and track information.")
429 (license license:gpl2)
430 (home-page "https://sourceforge.net/projects/ripperx/")))
432 (define-public libmpcdec
439 "https://files.musepack.net/source/libmpcdec-"
443 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
444 (build-system gnu-build-system)
445 (synopsis "Decoding library for the Musepack audio format")
447 "This library supports decoding of the Musepack (MPC) audio compression
449 (license license:bsd-3)
450 (home-page "https://musepack.net")))
452 (define-public mpc123
458 (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
459 version "/mpc123-" version ".tar.gz")
460 (string-append "mirror://debian/pool/main/m/" name
461 "/" name "_" version ".orig.tar.gz")))
464 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
465 (patches (search-patches "mpc123-initialize-ao.patch"))))
466 (build-system gnu-build-system)
469 (modify-phases %standard-phases
472 (substitute* "Makefile"
473 (("CC[[:blank:]]*:=.*")
476 (lambda* (#:key outputs #:allow-other-keys)
477 (let* ((out (assoc-ref outputs "out"))
478 (bin (string-append out "/bin")))
479 (install-file "mpc123" bin)))))
482 `(("gettext" ,gettext-minimal)))
485 ("libmpcdec" ,libmpcdec)))
486 (home-page "https://github.com/bucciarati/mpc123")
487 (synopsis "Audio player for Musepack-formatted files")
489 "Mpc123 is a command-line player for files in the Musepack audio
490 compression format (.mpc files).")
491 (license license:gpl2+)))
500 (uri (pypi-uri "eyeD3" version))
502 (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
503 (build-system python-build-system)
505 `(#:tests? #f)) ; the required test data contains copyrighted material
507 `(("python-grako" ,python-grako)
508 ("python-magic" ,python-magic)
509 ("python-pathlib" ,python-pathlib)
510 ("python-six" ,python-six)))
511 (synopsis "MP3 tag ID3 metadata editor")
512 (description "eyeD3 is a Python tool for working with audio files,
513 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
514 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
515 to write your own applications or plugins that are callable from the
517 (home-page "https://eyed3.readthedocs.io/en/latest/")
518 (license license:gpl2+)))
520 (define-public chromaprint
527 "https://github.com/acoustid/chromaprint/releases/download/v"
528 version "/chromaprint-" version ".tar.gz"))
531 "0sknmyl5254rc55bvkhfwpl4dfvz45xglk1rq8zq5crmwq058fjp"))))
532 (build-system cmake-build-system)
534 `(#:tests? #f ; tests require googletest *sources*
535 ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
536 #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
537 #:test-target "check"))
539 ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
540 ;; use the same ffmpeg version as for acoustid-fingerprinter
543 (home-page "https://acoustid.org/chromaprint")
544 (synopsis "Audio fingerprinting library")
545 (description "Chromaprint is a library for calculating audio
546 fingerprints which are used by the Acoustid service. Its main purpose
547 is to provide an accurate identifier for record tracks.")
548 (license license:lgpl2.1+)))
550 (define-public python-audioread
552 (name "python-audioread")
557 (uri (pypi-uri "audioread" version))
560 "0s6iilb8ca6j6nv5a5hbyxi5alr3crvsbr6kggh82a44pkx08f87"))))
561 (build-system python-build-system)
562 (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
564 `(("python-pytest" ,python-pytest)
565 ("python-pytest-runner" ,python-pytest-runner)))
566 (home-page "https://github.com/sampsyo/audioread")
567 (synopsis "Decode audio files using whichever backend is available")
569 "This package provides a Python library for audo decoding. It uses
570 whatever audio backend is available, such as GStreamer, Core Audio, MAD,
572 (license license:expat)))
574 (define-public python-pyacoustid
576 (name "python-pyacoustid")
581 (uri (pypi-uri "pyacoustid" version))
584 "1zan6c22ca6sjy0g9ajwjp6mkzw7jv8r3n7jzska09a6x254lf87"))))
585 (build-system python-build-system)
587 `(("python-audioread" ,python-audioread)
588 ("python-requests" ,python-requests)))
589 (home-page "https://github.com/sampsyo/pyacoustid")
590 (synopsis "Bindings for Chromaprint acoustic fingerprinting")
592 "This package provides bindings for the Chromaprint acoustic
593 fingerprinting library and the Acoustid API.")
594 (license license:expat)))