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>
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 utils)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system python)
56 #:use-module (guix build-system cmake))
64 (uri (string-append "mirror://sourceforge/mad/libmad/"
69 "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
70 (patches (search-patches "libmad-armv7-thumb-pt1.patch"
71 "libmad-armv7-thumb-pt2.patch"
72 "libmad-md_size.patch"
73 "libmad-length-check.patch"
74 "libmad-mips-newgcc.patch"))))
75 (build-system gnu-build-system)
78 (modify-phases %standard-phases
79 (add-before 'configure 'remove-unsupported-gcc-flags
81 ;; remove option that is not supported by gcc any more
82 (substitute* "configure" ((" -fforce-mem") ""))
84 (synopsis "MPEG audio decoder")
86 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
87 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
88 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
91 This package contains the library.")
92 (license license:gpl2+)
93 (home-page "https://www.underbit.com/products/mad/")))
95 (define-public libid3tag
101 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
102 version "/libid3tag-"
106 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
107 (build-system gnu-build-system)
108 (inputs `(("zlib" ,zlib)))
109 (synopsis "Library for reading ID3 tags")
111 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
113 (license license:gpl2+)
114 (home-page "https://www.underbit.com/products/mad/")))
116 (define-public id3lib
122 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
123 version "/id3lib-" version ".tar.gz"))
126 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
127 (modules '((guix build utils)))
128 ;; Don't use bundled zlib
129 (snippet '(begin (delete-file-recursively "zlib") #t))
130 (patches (search-patches "id3lib-CVE-2007-4460.patch"
131 "id3lib-UTF16-writing-bug.patch"))))
132 (build-system gnu-build-system)
133 (inputs `(("zlib" ,zlib)))
136 (modify-phases %standard-phases
137 (add-before 'configure 'apply-patches
138 ;; TODO: create a patch for origin instead?
140 (substitute* "configure"
141 (("iomanip.h") "")) ; drop check for unused header
142 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
143 (substitute* "include/id3/id3lib_strings.h"
144 (("include <string>") "include <cstring>\n#include <string>"))
145 (substitute* "include/id3/writers.h"
146 (("//\\#include <string.h>") "#include <cstring>"))
147 (substitute* "examples/test_io.cpp"
148 (("dami;") "dami;\nusing namespace std;"))
150 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
152 "Id3lib is a cross-platform software development library for reading,
153 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
154 whose primary goals are full compliance with the ID3v2 standard, portability
155 across several platforms, and providing a powerful and feature-rich API with
156 a highly stable and efficient implementation.")
157 (license license:lgpl2.0+)
158 (home-page "http://id3lib.sourceforge.net/")))
160 (define-public taglib
166 (uri (string-append "http://taglib.github.io/releases/taglib-"
170 "0ssjcdjv4qf9liph5ry1kngam1y7zp8fzr9xv4wzzrma22kabldn"))))
171 (build-system cmake-build-system)
173 '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
174 #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")))
175 (inputs `(("zlib" ,zlib)))
176 (home-page "https://taglib.org")
177 (synopsis "Library to access audio file meta-data")
179 "TagLib is a C++ library for reading and editing the meta-data of several
180 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
181 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
182 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
184 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
185 (license (list license:lgpl2.1 license:mpl1.1))))
187 (define-public mp3info
194 "https://ibiblio.org"
195 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
199 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
200 (modules '((guix build utils)))
203 (substitute* "Makefile"
205 (("/usr/bin/install") "install")
206 (("man/man1") "share/man/man1"))
208 (build-system gnu-build-system)
209 (outputs '("out" "gui")) ;GTK+ interface in "gui"
212 (modify-phases %standard-phases
214 (lambda* (#:key outputs #:allow-other-keys)
215 (let ((out (assoc-ref outputs "out")))
216 (substitute* "Makefile"
218 (string-append "prefix := " out "\n"))))
220 (add-before 'install 'pre-install
221 (lambda* (#:key outputs #:allow-other-keys)
222 (let ((out (assoc-ref outputs "out")))
223 (mkdir-p (string-append out "/bin"))
224 (mkdir-p (string-append out "/share/man/man1")))
226 (add-after 'install 'post-install
227 (lambda* (#:key outputs #:allow-other-keys)
228 ;; Move the GTK+ interface to "gui".
229 (let ((out (assoc-ref outputs "out"))
230 (gui (assoc-ref outputs "gui")))
231 (mkdir-p (string-append gui "/bin"))
232 (rename-file (string-append out "/bin/gmp3info")
233 (string-append gui "/bin/gmp3info")))
237 `(("pkg-config" ,pkg-config)))
240 ("ncurses" ,ncurses)))
241 (home-page "https://www.ibiblio.org/mp3info/")
242 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
244 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
245 files. MP3Info can also display various technical aspects of an MP3 file
246 including playing time, bit-rate, sampling frequency and other attributes in a
247 pre-defined or user-specifiable output format.")
248 (license license:gpl2+)))
250 (define-public libmp3splt
256 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
257 version "/libmp3splt-"
261 "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
262 (build-system gnu-build-system)
263 (inputs `(("libid3tag" ,libid3tag)
267 ("libvorbis" ,libvorbis)
270 `(("pkg-config" ,pkg-config)))
271 (synopsis "Library for splitting mp3 and ogg vorbis files")
273 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
274 and an end time position, without decoding. For splitting an album, one may
275 select split points and file names manually or obtain them automatically from
276 CDDB (internet or a local file) or from .cue files. The tool also supports
277 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
279 This package contains the library.")
280 (license license:gpl2+)
281 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
283 (define-public mp3splt
289 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
294 "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
295 (build-system gnu-build-system)
296 (native-inputs `(("pkg-config" ,pkg-config)))
297 (inputs `(("libmp3splt" ,libmp3splt)))
298 (synopsis "Utility for splitting mp3 and ogg vorbis files")
300 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
301 and an end time position, without decoding. For splitting an album, one may
302 select split points and file names manually or obtain them automatically from
303 CDDB (internet or a local file) or from .cue files. The tool also supports
304 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
306 This package contains the binary.")
307 (license license:gpl2+)
308 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
310 (define-public mpg123
317 (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
318 version "/mpg123-" version ".tar.bz2")
320 "https://www.mpg123.org/download/mpg123-"
321 version ".tar.bz2")))
323 (base32 "0vkcfdx0mqq6lmpczsmpa2jsb0s6dryx3i7gvr32i3w9b9w9ij9h"))))
324 (build-system gnu-build-system)
325 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
327 `(("pkg-config" ,pkg-config)))
329 `(("alsa-lib" ,alsa-lib)
330 ("pulseaudio" ,pulseaudio)))
331 (home-page "https://www.mpg123.org/")
332 (synopsis "Console MP3 player and decoder library")
334 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
335 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
336 command-line tool as well as a C library, libmpg123.")
337 (license license:lgpl2.1)))
339 (define-public mpg321
345 (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
346 version "/mpg321-" version ".tar.gz"))
349 "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))))
350 (build-system gnu-build-system)
351 (arguments '(#:configure-flags '("--disable-alsa")))
355 ("libid3tag" ,libid3tag)
357 (home-page "http://mpg321.sourceforge.net/")
358 (synopsis "Command-line MP3 player")
359 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
360 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
361 use with CD-recording software).")
362 (license license:gpl2)))
370 (uri (string-append "mirror://sourceforge/lame/lame/"
371 (version-major+minor version) "/lame-"
375 "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
376 (build-system gnu-build-system)
377 (home-page "http://lame.sourceforge.net/")
378 (synopsis "MPEG Audio Layer III (MP3) encoder")
379 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
380 (license license:lgpl2.0)))
382 (define-public ripperx
388 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
393 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
394 (patches (search-patches "ripperx-missing-file.patch"))))
395 (build-system gnu-build-system)
397 `(("gs-fonts" ,gs-fonts)
398 ("cdparanoia" ,cdparanoia)
401 ("vorbis-tools" ,vorbis-tools)))
408 `(("pkg-config" ,pkg-config)))
409 (synopsis "GTK program to rip and encode CD audio tracks")
411 "RipperX is a GTK program to rip CD audio tracks and encode them to the
412 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
413 a few mouse clicks to convert an entire album. It supports CDDB lookups
414 for album and track information.")
415 (license license:gpl2)
416 (home-page "https://sourceforge.net/projects/ripperx/")))
418 (define-public libmpcdec
425 "https://files.musepack.net/source/libmpcdec-"
429 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
430 (build-system gnu-build-system)
431 (synopsis "Decoding library for the Musepack audio format")
433 "This library supports decoding of the Musepack (MPC) audio compression
435 (license license:bsd-3)
436 (home-page "https://musepack.net")))
438 (define-public mpc123
444 (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
445 version "/mpc123-" version ".tar.gz")
446 (string-append "mirror://debian/pool/main/m/" name
447 "/" name "_" version ".orig.tar.gz")))
450 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
451 (patches (search-patches "mpc123-initialize-ao.patch"))))
452 (build-system gnu-build-system)
455 (modify-phases %standard-phases
458 (substitute* "Makefile"
459 (("CC[[:blank:]]*:=.*")
462 (lambda* (#:key outputs #:allow-other-keys)
463 (let* ((out (assoc-ref outputs "out"))
464 (bin (string-append out "/bin")))
465 (install-file "mpc123" bin)))))
468 `(("gettext" ,gettext-minimal)))
471 ("libmpcdec" ,libmpcdec)))
472 (home-page "https://github.com/bucciarati/mpc123")
473 (synopsis "Audio player for Musepack-formatted files")
475 "Mpc123 is a command-line player for files in the Musepack audio
476 compression format (.mpc files).")
477 (license license:gpl2+)))
486 (uri (pypi-uri "eyeD3" version))
488 (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
489 (build-system python-build-system)
491 `(#:tests? #f)) ; the required test data contains copyrighted material
493 `(("python-grako" ,python-grako)
494 ("python-magic" ,python-magic)
495 ("python-pathlib" ,python-pathlib)
496 ("python-six" ,python-six)))
497 (synopsis "MP3 tag ID3 metadata editor")
498 (description "eyeD3 is a Python tool for working with audio files,
499 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
500 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
501 to write your own applications or plugins that are callable from the
503 (home-page "https://eyed3.readthedocs.io/en/latest/")
504 (license license:gpl2+)))
506 (define-public chromaprint
513 "https://github.com/acoustid/chromaprint/releases/download/v"
514 version "/chromaprint-" version ".tar.gz"))
517 "0sknmyl5254rc55bvkhfwpl4dfvz45xglk1rq8zq5crmwq058fjp"))))
518 (build-system cmake-build-system)
520 `(#:tests? #f ; tests require googletest *sources*
521 ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
522 #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
523 #:test-target "check"))
525 ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
526 ;; use the same ffmpeg version as for acoustid-fingerprinter
529 (home-page "https://acoustid.org/chromaprint")
530 (synopsis "Audio fingerprinting library")
531 (description "Chromaprint is a library for calculating audio
532 fingerprints which are used by the Acoustid service. Its main purpose
533 is to provide an accurate identifier for record tracks.")
534 (license license:lgpl2.1+)))
536 (define-public python-audioread
538 (name "python-audioread")
543 (uri (pypi-uri "audioread" version))
546 "0s6iilb8ca6j6nv5a5hbyxi5alr3crvsbr6kggh82a44pkx08f87"))))
547 (build-system python-build-system)
548 (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
550 `(("python-pytest" ,python-pytest)
551 ("python-pytest-runner" ,python-pytest-runner)))
552 (home-page "https://github.com/sampsyo/audioread")
553 (synopsis "Decode audio files using whichever backend is available")
555 "This package provides a Python library for audo decoding. It uses
556 whatever audio backend is available, such as GStreamer, Core Audio, MAD,
558 (license license:expat)))
560 (define-public python-pyacoustid
562 (name "python-pyacoustid")
567 (uri (pypi-uri "pyacoustid" version))
570 "1zan6c22ca6sjy0g9ajwjp6mkzw7jv8r3n7jzska09a6x254lf87"))))
571 (build-system python-build-system)
573 `(("python-audioread" ,python-audioread)
574 ("python-requests" ,python-requests)))
575 (home-page "https://github.com/sampsyo/pyacoustid")
576 (synopsis "Bindings for Chromaprint acoustic fingerprinting")
578 "This package provides bindings for the Chromaprint acoustic
579 fingerprinting library and the Acoustid API.")
580 (license license:expat)))