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 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages mp3)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages gcc)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages cdrom)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages pcre)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-xyz)
43 #:use-module (gnu packages xiph)
44 #:use-module (gnu packages pulseaudio)
45 #:use-module (gnu packages linux) ;alsa-lib
46 #:use-module (gnu packages video) ;ffmpeg
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix utils)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix build-system python)
52 #:use-module (guix build-system cmake))
60 (uri (string-append "mirror://sourceforge/mad/libmad/"
65 "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
66 (patches (search-patches "libmad-armv7-thumb-pt1.patch"
67 "libmad-armv7-thumb-pt2.patch"
68 "libmad-md_size.patch"
69 "libmad-length-check.patch"
70 "libmad-mips-newgcc.patch"))))
71 (build-system gnu-build-system)
74 (modify-phases %standard-phases
75 (add-before 'configure 'remove-unsupported-gcc-flags
77 ;; remove option that is not supported by gcc any more
78 (substitute* "configure" ((" -fforce-mem") ""))
80 (synopsis "MPEG audio decoder")
82 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
83 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
84 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
87 This package contains the library.")
88 (license license:gpl2+)
89 (home-page "https://www.underbit.com/products/mad/")))
91 (define-public libid3tag
97 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
102 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
103 (build-system gnu-build-system)
104 (inputs `(("zlib" ,zlib)))
105 (synopsis "Library for reading ID3 tags")
107 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
109 (license license:gpl2+)
110 (home-page "https://www.underbit.com/products/mad/")))
112 (define-public id3lib
118 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
119 version "/id3lib-" version ".tar.gz"))
122 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
123 (modules '((guix build utils)))
124 ;; Don't use bundled zlib
125 (snippet '(begin (delete-file-recursively "zlib") #t))
126 (patches (search-patches "id3lib-CVE-2007-4460.patch"
127 "id3lib-UTF16-writing-bug.patch"))))
128 (build-system gnu-build-system)
129 (inputs `(("zlib" ,zlib)))
132 (modify-phases %standard-phases
133 (add-before 'configure 'apply-patches
134 ;; TODO: create a patch for origin instead?
136 (substitute* "configure"
137 (("iomanip.h") "")) ; drop check for unused header
138 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
139 (substitute* "include/id3/id3lib_strings.h"
140 (("include <string>") "include <cstring>\n#include <string>"))
141 (substitute* "include/id3/writers.h"
142 (("//\\#include <string.h>") "#include <cstring>"))
143 (substitute* "examples/test_io.cpp"
144 (("dami;") "dami;\nusing namespace std;"))
146 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
148 "Id3lib is a cross-platform software development library for reading,
149 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
150 whose primary goals are full compliance with the ID3v2 standard, portability
151 across several platforms, and providing a powerful and feature-rich API with
152 a highly stable and efficient implementation.")
153 (license license:lgpl2.0+)
154 (home-page "http://id3lib.sourceforge.net/")))
156 (define-public taglib
162 (uri (string-append "http://taglib.github.io/releases/taglib-"
166 "0ssjcdjv4qf9liph5ry1kngam1y7zp8fzr9xv4wzzrma22kabldn"))))
167 (build-system cmake-build-system)
169 '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
170 #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")))
171 (inputs `(("zlib" ,zlib)))
172 (home-page "http://taglib.org")
173 (synopsis "Library to access audio file meta-data")
175 "TagLib is a C++ library for reading and editing the meta-data of several
176 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
177 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
178 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
180 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
181 (license (list license:lgpl2.1 license:mpl1.1))))
183 (define-public mp3info
190 "https://ibiblio.org"
191 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
195 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
196 (modules '((guix build utils)))
199 (substitute* "Makefile"
201 (("/usr/bin/install") "install")
202 (("man/man1") "share/man/man1"))
204 (build-system gnu-build-system)
205 (outputs '("out" "gui")) ;GTK+ interface in "gui"
208 (modify-phases %standard-phases
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let ((out (assoc-ref outputs "out")))
212 (substitute* "Makefile"
214 (string-append "prefix := " out "\n"))))
216 (add-before 'install 'pre-install
217 (lambda* (#:key outputs #:allow-other-keys)
218 (let ((out (assoc-ref outputs "out")))
219 (mkdir-p (string-append out "/bin"))
220 (mkdir-p (string-append out "/share/man/man1")))
222 (add-after 'install 'post-install
223 (lambda* (#:key outputs #:allow-other-keys)
224 ;; Move the GTK+ interface to "gui".
225 (let ((out (assoc-ref outputs "out"))
226 (gui (assoc-ref outputs "gui")))
227 (mkdir-p (string-append gui "/bin"))
228 (rename-file (string-append out "/bin/gmp3info")
229 (string-append gui "/bin/gmp3info")))
233 `(("pkg-config" ,pkg-config)))
236 ("ncurses" ,ncurses)))
237 (home-page "https://www.ibiblio.org/mp3info/")
238 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
240 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
241 files. MP3Info can also display various technical aspects of an MP3 file
242 including playing time, bit-rate, sampling frequency and other attributes in a
243 pre-defined or user-specifiable output format.")
244 (license license:gpl2+)))
246 (define-public libmp3splt
252 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
253 version "/libmp3splt-"
257 "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
258 (build-system gnu-build-system)
259 (inputs `(("libid3tag" ,libid3tag)
263 ("libvorbis" ,libvorbis)
266 `(("pkg-config" ,pkg-config)))
267 (synopsis "Library for splitting mp3 and ogg vorbis files")
269 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
270 and an end time position, without decoding. For splitting an album, one may
271 select split points and file names manually or obtain them automatically from
272 CDDB (internet or a local file) or from .cue files. The tool also supports
273 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
275 This package contains the library.")
276 (license license:gpl2+)
277 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
279 (define-public mp3splt
285 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
290 "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
291 (build-system gnu-build-system)
292 (native-inputs `(("pkg-config" ,pkg-config)))
293 (inputs `(("libmp3splt" ,libmp3splt)))
294 (synopsis "Utility for splitting mp3 and ogg vorbis files")
296 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
297 and an end time position, without decoding. For splitting an album, one may
298 select split points and file names manually or obtain them automatically from
299 CDDB (internet or a local file) or from .cue files. The tool also supports
300 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
302 This package contains the binary.")
303 (license license:gpl2+)
304 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
306 (define-public mpg123
312 (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
313 version "/mpg123-" version ".tar.bz2")
315 "https://www.mpg123.org/download/mpg123-"
316 version ".tar.bz2")))
319 "02l915jq0ymndb082g6w89bpf66z04ifa1lr7ga3yycw6m46hc4h"))))
320 (build-system gnu-build-system)
321 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
322 (native-inputs `(("pkg-config" ,pkg-config)))
323 (inputs `(("pulseaudio" ,pulseaudio)
324 ("alsa-lib" ,alsa-lib)))
325 (home-page "https://www.mpg123.org/")
326 (synopsis "Console MP3 player and decoder library")
328 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
329 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
330 command-line tool as well as a C library, libmpg123.")
331 (license license:lgpl2.1)))
333 (define-public mpg321
339 (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
340 version "/mpg321-" version ".tar.gz"))
343 "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))))
344 (build-system gnu-build-system)
345 (arguments '(#:configure-flags '("--disable-alsa")))
349 ("libid3tag" ,libid3tag)
351 (home-page "http://mpg321.sourceforge.net/")
352 (synopsis "Command-line MP3 player")
353 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
354 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
355 use with CD-recording software).")
356 (license license:gpl2)))
364 (uri (string-append "mirror://sourceforge/lame/lame/"
365 (version-major+minor version) "/lame-"
369 "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
370 (build-system gnu-build-system)
371 (home-page "http://lame.sourceforge.net/")
372 (synopsis "MPEG Audio Layer III (MP3) encoder")
373 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
374 (license license:lgpl2.0)))
376 (define-public ripperx
382 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
387 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
388 (patches (search-patches "ripperx-missing-file.patch"))))
389 (build-system gnu-build-system)
391 `(("gs-fonts" ,gs-fonts)
392 ("cdparanoia" ,cdparanoia)
395 ("vorbis-tools" ,vorbis-tools)))
402 `(("pkg-config" ,pkg-config)))
403 (synopsis "GTK program to rip and encode CD audio tracks")
405 "RipperX is a GTK program to rip CD audio tracks and encode them to the
406 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
407 a few mouse clicks to convert an entire album. It supports CDDB lookups
408 for album and track information.")
409 (license license:gpl2)
410 (home-page "https://sourceforge.net/projects/ripperx/")))
412 (define-public libmpcdec
419 "https://files.musepack.net/source/libmpcdec-"
423 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
424 (build-system gnu-build-system)
425 (synopsis "Decoding library for the Musepack audio format")
427 "This library supports decoding of the Musepack (MPC) audio compression
429 (license license:bsd-3)
430 (home-page "https://musepack.net")))
432 (define-public mpc123
438 (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
439 version "/mpc123-" version ".tar.gz")
440 (string-append "mirror://debian/pool/main/m/" name
441 "/" name "_" version ".orig.tar.gz")))
444 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
445 (patches (search-patches "mpc123-initialize-ao.patch"))))
446 (build-system gnu-build-system)
449 (modify-phases %standard-phases
452 (substitute* "Makefile"
453 (("CC[[:blank:]]*:=.*")
456 (lambda* (#:key outputs #:allow-other-keys)
457 (let* ((out (assoc-ref outputs "out"))
458 (bin (string-append out "/bin")))
459 (install-file "mpc123" bin)))))
462 `(("gettext" ,gettext-minimal)))
465 ("libmpcdec" ,libmpcdec)))
466 (home-page "https://github.com/bucciarati/mpc123")
467 (synopsis "Audio player for Musepack-formatted files")
469 "Mpc123 is a command-line player for files in the Musepack audio
470 compression format (.mpc files).")
471 (license license:gpl2+)))
480 (uri (pypi-uri "eyeD3" version))
482 (base32 "1347mhjysbdpmmvdqm6lhskdw0qj9vjdn4n172ffnz958adrnk0f"))))
483 (build-system python-build-system)
485 `(#:tests? #f)) ; the required test data contains copyrighted material
487 `(("python-grako" ,python-grako)
488 ("python-magic" ,python-magic)
489 ("python-pathlib" ,python-pathlib)
490 ("python-six" ,python-six)))
491 (synopsis "MP3 tag ID3 metadata editor")
492 (description "eyeD3 is a Python tool for working with audio files,
493 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
494 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
495 to write your own applications or plugins that are callable from the
497 (home-page "https://eyed3.readthedocs.io/en/latest/")
498 (license license:gpl2+)))
500 (define-public chromaprint
507 "https://github.com/acoustid/chromaprint/releases/download/v"
508 version "/chromaprint-" version ".tar.gz"))
511 "10kz8lncal4s2rp2rqpgc6xyjp0jzcrihgkx7chf127vfs5n067a"))))
512 (build-system cmake-build-system)
514 `(#:tests? #f ; tests require googletest *sources*
515 ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
516 #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
517 #:test-target "check"))
519 ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
520 ;; use the same ffmpeg version as for acoustid-fingerprinter
523 (home-page "https://acoustid.org/chromaprint")
524 (synopsis "Audio fingerprinting library")
525 (description "Chromaprint is a library for calculating audio
526 fingerprints which are used by the Acoustid service. Its main purpose
527 is to provide an accurate identifier for record tracks.")
528 (license license:lgpl2.1+)))