Linux audio: Difference between revisions
(→Beets) |
(→cmus) |
||
(26 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Audio |
== Audio CD ripping == |
||
See [[Linux CD]]. |
|||
== Format conversion == |
|||
This section is about how to convert an audio file from one format (e.g. {{file|.flac}}) into another one (e.g. {{file|.mp3}}). |
|||
=== Audio Conversion using Virtual FS === |
|||
; [http://mp3fs.sourceforge.net/ mp3fs] |
; [http://mp3fs.sourceforge.net/ mp3fs] |
||
Example: |
Example: |
||
Line 6: | Line 12: | ||
</source> |
</source> |
||
== GUI Audio Conversion == |
|||
=== Nautilus Audio Converter === |
=== Nautilus Audio Converter === |
||
:Install with |
:Install with |
||
Line 20: | Line 25: | ||
* Output to given directory, in ''{artis - album}'' format |
* Output to given directory, in ''{artis - album}'' format |
||
* mp3, support lame vbr (but apparently --vbr-old only) — done via GStreamer pipeline. |
* mp3, support lame vbr (but apparently --vbr-old only) — done via GStreamer pipeline. |
||
== CLI Audio Conversion == |
|||
=== <tt>flac</tt> - FLAC encoder / decoder === |
=== <tt>flac</tt> - FLAC encoder / decoder === |
||
Line 64: | Line 67: | ||
</source> |
</source> |
||
=== Using Banshee player === |
|||
== Conversion in integrated players == |
|||
=== Banshee === |
|||
* Plug external mp3 player device |
* Plug external mp3 player device |
||
* Right click on device in ''Banshee'' |
* Right click on device in ''Banshee'' |
||
Line 89: | Line 90: | ||
* More information at [http://ubuntuforums.org/showthread.php?t=1358067], [http://act1v8.wordpress.com/2007/10/07/make-banshee-recognize-your-mass-storage-device-as-a-dap/], [http://almost-a-technocrat.blogspot.be/2010/11/isaudioplayer.html], [https://live.gnome.org/Banshee/CommonQuestions/IsAudioPlayerFile] |
* More information at [http://ubuntuforums.org/showthread.php?t=1358067], [http://act1v8.wordpress.com/2007/10/07/make-banshee-recognize-your-mass-storage-device-as-a-dap/], [http://almost-a-technocrat.blogspot.be/2010/11/isaudioplayer.html], [https://live.gnome.org/Banshee/CommonQuestions/IsAudioPlayerFile] |
||
=== RhythmBox === |
=== Using RhythmBox player === |
||
* Can also export to external mp3 player |
* Can also export to external mp3 player |
||
* {{red|BUG?}} — Apparently only in mp3 (although there are some settings about preferred format in preferences) |
* {{red|BUG?}} — Apparently only in mp3 (although there are some settings about preferred format in preferences) |
||
Line 102: | Line 103: | ||
:'''Banshee''' supports at least {{file|folder.jpg}} and {{file|cover.jpg}}. |
:'''Banshee''' supports at least {{file|folder.jpg}} and {{file|cover.jpg}}. |
||
:On '''Android''', the standard is {{file|albumart.jpg}}. |
:On '''Android''', the standard is {{file|albumart.jpg}}. |
||
;Encoding / charset |
|||
* Use '''UTF-8''' as default charset, both for the '''filename''' and the '''tags'''. |
|||
* ''Enforcing Unicode filenames'' — UTF-8 is usually the default charset for mounted filesystems on Linux (ext3/4, reiserfs...). However on Samba, it requires option <code>iocharset=utf8</code>: |
|||
mount -t cifs -o iocharset=utf8 //host/share /mnt/point |
|||
:For USB sticks, make sure it is enabled with option <code>utf8=1</code>: |
|||
mount - vfat -o utf8=1 /dev/sdb1 /mnt/point |
|||
* ''Enforcing Unicode tags'' — Note that some converter screw up with the charset (for instance <code>pacpl</code>). So you might need to post-process the tags after conversion, for instance <code>[https://code.google.com/p/id3-to-unicode/ id3-to-unicode]</code> or [https://github.com/schernikov/id3_to_unicode github fork]). |
|||
=== Editors (GUI-based) === |
=== Editors (GUI-based) === |
||
''mp3 tag editor'', ''idv3 tags''... |
''mp3 tag editor'', ''idv3 tags''... |
||
;MusicBrainZ Picard |
|||
:Probably the most complete and powerful editor out there. Front-end to Picard database. Including cover art download. |
|||
;Banshee |
;Banshee |
||
Line 126: | Line 138: | ||
: Has auto-tagging facility (MusicBrainZ support) and can fetch and embed album arts automatically from itunes, amazon, google... |
: Has auto-tagging facility (MusicBrainZ support) and can fetch and embed album arts automatically from itunes, amazon, google... |
||
;eyeD3 |
;eyeD3 {{red|(best)}} |
||
:A simple tag editor, very complete (including cover art edition). |
:A simple tag editor, very complete (including cover art edition). |
||
<source lang=bash> |
<source lang=bash> |
||
eyeD3 myfile.mp3 |
eyeD3 myfile.mp3 |
||
eyeD3 --list-image-types # View available image type (APIC frame) |
eyeD3 --list-image-types # View available image type (APIC frame) |
||
eyeD3 --add-image=folder.jpg:FRONT_COVER:folder.jpg myfile.mp3 |
eyeD3 --add-image=folder.jpg:FRONT_COVER:folder.jpg myfile.mp3 |
||
eyeD3 --plugin=stats --verbose *.mp3 # Stats on mp3 files, including bad / missing tags |
|||
</source> |
</source> |
||
Line 147: | Line 160: | ||
:Can save into a {{file|folder.jpg}} file, {{file|.folder.png}} and an <code>Icon</code> entry in {{file|.directory}} for Konqueror, into an ID3v3 APIC frame... |
:Can save into a {{file|folder.jpg}} file, {{file|.folder.png}} and an <code>Icon</code> entry in {{file|.directory}} for Konqueror, into an ID3v3 APIC frame... |
||
:Broken. |
:Broken. |
||
=== Tools and scripts === |
|||
==== View ALL tags in a music collection ==== |
|||
Reference: [http://blog.darkstarsword.net/2009/01/new-years-resolution-massive-music-tag.html] |
|||
Require eyeD3. |
|||
<source lang=bash> |
|||
find music -iname "*.mp3" -exec eyeD3 -v {} \; | tee index |
|||
sort -u index | awk -F\): '/^<.*$/ {print $1}' | uniq | awk -F\)\> '{print $1}' | awk -F\( '{print $(NF)}' > tags |
|||
</source> |
|||
==== Remove ALL tags but some in a music collection ==== |
|||
Reference: [http://blog.darkstarsword.net/2009/01/new-years-resolution-massive-music-tag.html], [http://savvyadmin.com/strip-all-unwanted-mp3-id3-tags/] |
|||
This script removes all tags except a few white listed ones. This is handy to remove inaccurate tags, or in case of conflicts (for instance when two tags are in conflict because tag editor ignored one of the tag). Tags may also contain private information (like buying date, etc). |
|||
Require eyeD3. Run as |
|||
cd ~/music |
|||
strip-tags.sh |
|||
See <code>oktags</code> for list of tags that are kept. |
|||
{{hidden|1=<tt>strip-tags.sh</tt> |
|||
([{{#filelink: strip-tags.sh}} download])|2={{#fileanchor: strip-tags.sh}}<source lang="bash"> |
|||
#!/bin/bash |
|||
# Script name: strip-tags.sh |
|||
# Original Author: Ian of DarkStarShout Blog |
|||
# Site: http://darkstarshout.blogspot.com/ |
|||
# Options slightly modified to liking of SavvyAdmin.com |
|||
oktags="TALB APIC TCON TPE1 TPE2 TPE3 TIT2 TRCK TYER TCOM TPOS" |
|||
indexfile=`mktemp` |
|||
#Determine tags present: |
|||
find . -iname "*.mp3" -exec eyeD3 --no-color -v {} \; > $indexfile |
|||
tagspresent=`cat $indexfile | awk '/^[A-Z0-9]{4} \(.* bytes\)/ {print $1}' \ |
|||
| sort -u | awk 'BEGIN {ORS=" "} {print $0}'` |
|||
rm $indexfile |
|||
#Determine tags to strip: |
|||
tostrip=`echo -n $tagspresent $oktags $oktags \ |
|||
| awk 'BEGIN {RS=" "; ORS="\n"} {print $0}' | sort | uniq -u \ |
|||
| awk 'BEGIN {ORS=" "} {print $0}'` |
|||
#Confirm action: |
|||
echo |
|||
echo The following tags have been found in the mp3s: |
|||
echo $tagspresent |
|||
echo These tags are to be stripped: |
|||
echo $tostrip |
|||
echo |
|||
echo -n Press enter to confirm, or Ctrl+C to cancel... |
|||
read dummy |
|||
#Strip 'em |
|||
stripstring=`echo $tostrip \ |
|||
| awk 'BEGIN {FS="\n"; RS=" "} {print "--set-text-frame=" $1 ": "}'` |
|||
# First pass copies any v1.x tags to v2.3 and strips unwanted tag data. |
|||
# Second pass removes v1.x tags, since I don't like to use them. |
|||
# Without --no-tagging-time-frame, a new unwanted tag is added. :-) |
|||
find . -iname "*.mp3" \ |
|||
-exec eyeD3 --to-v2.3 --no-tagging-time-frame $stripstring '{}' \; \ |
|||
-exec eyeD3 --remove-v1 --no-tagging-time-frame {} \; |
|||
echo "Script complete!" |
|||
</source>|headerstyle=background:#ccccff;text-align:left;}} |
|||
== Music players, library managers and organizers == |
== Music players, library managers and organizers == |
||
Reference: [http://crunchbang.org/forums/viewtopic.php?id=34202], [http://www.tomshardware.com/reviews/ubuntu-linux-audio-software,2856-4.html] |
Reference: [http://crunchbang.org/forums/viewtopic.php?id=34202], [http://www.tomshardware.com/reviews/ubuntu-linux-audio-software,2856-4.html] |
||
My current favorites: banshee, beets, cmus. |
My current favorites: banshee, beets, cmus and picard. |
||
=== [http://amarok.kde.org/ Amarok] === |
=== [http://amarok.kde.org/ Amarok] === |
||
Line 183: | Line 268: | ||
</pre> |
</pre> |
||
This will configure beets to store music in directory {{file|~/music}}, and build its database into {{file|~/.cache/musiclibrary.blb}}. The <code>copy: no</code> option tells beets not to move/copy the imported music to local music folder. Then a few plugins are loaded and configured. |
This will configure beets to store music in directory {{file|~/music}}, and build its database into {{file|~/.cache/musiclibrary.blb}}. The <code>copy: no</code> option tells beets not to move/copy the imported music to local music folder. Then a few plugins are loaded and configured. |
||
Import music files into your library: |
|||
beet import ~/music |
|||
Some commands: |
Some commands: |
||
Line 194: | Line 282: | ||
* Beets can fetch art for album already in the library [http://beets.readthedocs.org/en/v1.3.15/plugins/fetchart.html]: |
* Beets can fetch art for album already in the library [http://beets.readthedocs.org/en/v1.3.15/plugins/fetchart.html]: |
||
beet fetchart [-f] [query] |
beet fetchart [-f] [query] |
||
* Beets can embed art using plugin '''embedart'''. |
|||
* Beets can look for track duplicates |
* Beets can look for track duplicates |
||
Line 199: | Line 288: | ||
'''cmus''' is a small, fast and powerful console music player for Unix-like operating systems. |
'''cmus''' is a small, fast and powerful console music player for Unix-like operating systems. |
||
TBC |
TBC |
||
;Install latest version |
|||
* Install build dependencies |
|||
sudo apt-get build-dep cmus |
|||
* Download latest version and untar it |
|||
tar xvzf cmus-2.7.1.tar.gz |
|||
cd cmus-2.7.1 |
|||
../configure |
|||
make |
|||
sudo make install |
|||
;Basic usage |
|||
* {{kb|u}} — Update media cache. |
|||
;Troubleshoot |
|||
* Incorrect sorting of album artists. |
|||
:Probably due to conflicting tags (see [http://darkstarshout.blogspot.com/2009/01/new-years-resolution-massive-music-tag.html], [http://savvyadmin.com/strip-all-unwanted-mp3-id3-tags/]). Cmus uses the content of tag TPE2 (aka "album artist") if present instead of TPE1 (aka "artist") used by other players like Amarok. The solution is to update the tags, or strip unnecessary tags using the script above {{file|strip-tags.sh}}. |
|||
:See also http://id3.org/id3v2.3.0 for tag info. |
|||
* To have all tracks of a same albums listed under the same artists, but still keep different artists / track, use a common artist name for '''album artist''' (e.g. <code>Adamo</code>) and a specific name for '''artist''' (e.g. <code>Adamo en duo avec Bénabar</code>). |
|||
=== [http://squentin.free.fr/gmusicbrowser/gmusicbrowser.html gmusicbrowser] === |
=== [http://squentin.free.fr/gmusicbrowser/gmusicbrowser.html gmusicbrowser] === |
||
Line 211: | Line 319: | ||
=== [http://getnightingale.com/ Nightingale] === |
=== [http://getnightingale.com/ Nightingale] === |
||
TBC |
TBC |
||
=== [https://picard.musicbrainz.org/ MusicBrainZ Picard] === |
|||
'''Picard''' is a front-end to the MusicBrainZ library. |
|||
;{{red|Troubleshoot}} — Cannot load album information in Picard 1.2 |
|||
* This is a [http://forums.musicbrainz.org/viewtopic.php?id=1577 known bug in Picard 1.2] that prevents Picard to download album information when album art are associated with unknown types. Upgrade to version 1.3.2 from Ubuntu repository (ex. Xenial release). |
|||
;Select the CORRECT LABEL |
|||
* See [https://musicbrainz.org/edit/36518048 detailed explanation]. Clue: '''Look at the logo''', not the (P) and (C) stuff!. |
|||
;Tag files - easiest method |
|||
:Easiest method is to use the CD lookup feature. |
|||
* Insert the CD |
|||
* Click on '''CD lookup'''. |
|||
* This will find the release in MB database. |
|||
* Then drag and drop your locally extracted album onto that release. |
|||
;Tag files - easy method |
|||
* First '''Add Folder''', or (with file browser visible) drag and drop a folder to ''Unmatched Files''. |
|||
* Click '''Cluster''' |
|||
* Click an album in the cluster, or click ''Clusters'' to lookup all albums, and click '''Lookup''' |
|||
* Right click album in right pane, and select '''Save'''. |
|||
;Tag files - scanning |
|||
:When Picard does not find a release corresponding to the cluster, use the ''scanning'' tool to find the release. |
|||
* Click an album in the cluster (or ''Clusters''' to select all clusters), and click '''Scan'''. |
|||
;Tag files - manual lookup |
|||
* Click an album cluster, and click '''Lookup in browser'''. |
|||
* Browse the MB database. When the matching release is found, click the '''TAGGER''' link (the tag with green background) |
|||
* The release opens in Picard (it was send via port 8000 that Picard is listening to). Now either drag & drop the album on that release, or drag&drap each track individually. On error, just right click on the track and click '''remove'''. |
|||
;Encoding a new release - Examples |
|||
* Label: <code>Columbia</code>, Cat. No: <code>COL 488791-2</code> |
|||
My options: |
|||
{| |
|||
|- |
|||
|'''Tags'''||'''Cover Art'''||'''File Naming''' |
|||
|- valign=top |
|||
|width=25%| |
|||
;Before tagging |
|||
* Clear existing tags |
|||
* Remove ID3 tags from FLAC files |
|||
* Remove APEv2 tags from MP3 files |
|||
* ID3v2 version: 2.3 |
|||
|width=25%| |
|||
;Location |
|||
* Embed cover images into tags |
|||
* Embed only front images |
|||
* Save cover images as separate files. Use file name: {{file|folder}}. |
|||
;Coverart Providers |
|||
* Amazon |
|||
* CD Baby |
|||
* Cover Art Archive |
|||
;Cover Art Archive |
|||
* Only use images of the following size: ''500px'' |
|||
* Download only images: ''Front'', ''Back'' |
|||
* Use the first image type as the filename |
|||
| |
|||
* Rename files when saving |
|||
* Replace Windows-incompatible characters |
|||
* Move files to this directory when saving: ''(update as necessary)'' |
|||
* Delete empty directories |
|||
* Move additional files: {{file|*.jpg}} {{file|*.png}} {{file|*.cue}} {{file|*.accurip}} {{file|*.log}} {{file|*.m3u}} |
|||
; Name file like this: |
|||
* <code>if2(%albumartist%,%artist%)/%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2)$if(%compilation%, %artist% -,) %title%</code> |
|||
|} |
|||
=== [http://www.gnome.org/projects/rhythmbox/ Rhythmbox] === |
=== [http://www.gnome.org/projects/rhythmbox/ Rhythmbox] === |
Latest revision as of 09:48, 11 July 2024
Audio CD ripping
See Linux CD.
Format conversion
This section is about how to convert an audio file from one format (e.g. .flac) into another one (e.g. .mp3).
Audio Conversion using Virtual FS
Example:
mp3fs -b 224 ~/Music /mnt/mp3 -o allow_other,ro
Nautilus Audio Converter
- Install with
sudo apt-get install wavpack mppenc libmpcdec3 faac flac vorbis-tools faad lame libid3-3.8.3-dev nautilus-script-audio-convert
- libid3-3.8.3-dev needed for id3tag.
- See Ubuntu Geek - Simplest way to convert audio file(s) on Ubuntu Linux
Gnome Sound Converter
Very nice utility.
- Can convert to flac, ogg, mp3.
- Output to given directory, in {artis - album} format
- mp3, support lame vbr (but apparently --vbr-old only) — done via GStreamer pipeline.
flac - FLAC encoder / decoder
flac -d source.flac
flac -d source.flac -o output.wav
flac -d source.flac -c # Write output to stdout
lame - MP3 encoder / decoder
See also Technical information on encoding settings.
lame -m auto --preset standard input.wav output.mp3 # Equiv to fast standard
lame -m auto --preset fast standard input.wav output.mp3 # Equiv to -V2 (~192kbps)
lame -m auto --preset extreme input.wav output.mp3 # Equiv to fast extreme
lame -m auto --preset fast extreme input.wav output.mp3 # Equiv to -V0 (~256kbps)
lame -m auto --preset insane input.wav output.mp3 # Equiv to -b 320
twolame - MP2 encoder / decoder
twolame -b 256 input.wav -o "output.mp3"
pacpl - Multi-format encoder / decoder in Perl
# From FLAC to MP3 - Using LAME (extreme quality) - recurse & keep directory structure
pacpl --to mp3 -r -p flac/ --outdir /media/USB --encoder lame --defopts 0 --eopts="-m auto --preset fast extreme"
# To decrease encoding priority:
nice -n 19 pacpl ...
To change the directory structure from "Artist - Album" to "Artist/Album":
for i in *; do eval $(echo $i | sed -r '/ - /!s/(.*)/ARTIST=Various;ALBUM="\1"/; / - /s/(.*) - (.*)/ARTIST="\1"; ALBUM="\2"/'); mkdir "$ARTIST"; mv "$i" "$ARTIST/$ALBUM"; done
yaflac2mp3 - Yet Another FLAC to MP3 script
An handy script to transcode from FLAC to MP3. Could be used as a basis for customized script. See also [1] for more ideas.
yaflac2mp3.sh -s . -d mp3
Using Banshee player
- Plug external mp3 player device
- Right click on device in Banshee
- Select the media type (ogg, mp3), then click on edit button.
- For mp3, quality goes from 0 (worst) to 9 (best). 7 seems equivalent to
lame -V 2
, i.e. fast standard preset, and 9 seems equivalent tolame -V 0
, ie. fast extreme preset
- For mp3, quality goes from 0 (worst) to 9 (best). 7 seems equivalent to
- BUG? — apparently can't save to .ogg although ogg is selected as encoder... — SOLVED see below.
- BUG? — export all files in device root directory — SOLVED see below.
- Create a file named ..is_audio_player in device root directory. For instance, to have audio files added in OGG format to the device, using a 1-folder deep structure (ie. Artist - Album/Track. Title), use the following:
name=SAMSUNG\ YP-U1\ (1GB)
folder_depth=1
output_formats=application/ogg,audio/mpeg,audio/mp3
To have files stored elsewhere than in root folder:
name=SAMSUNG\ CARD\ (8GB)
audio_folders=musics/,other/subfolder
folder_depth=2
output_formats=application/ogg,audio/mpeg,audio/mp3
Using RhythmBox player
- Can also export to external mp3 player
- BUG? — Apparently only in mp3 (although there are some settings about preferred format in preferences)
- Quality seems to be
lame --preset fast standard
- Export in /Artist/Album/Track - Title.mp3
Cover Art and ID3 Tags
Conventions and standards
- Cover art filename
- Usual names are folder.jpg (apparently the standard on Windows) and cover.jpg. Other options are front.jpg, %filename%.jpg or%album%.jpg.
- Banshee supports at least folder.jpg and cover.jpg.
- On Android, the standard is albumart.jpg.
- Encoding / charset
- Use UTF-8 as default charset, both for the filename and the tags.
- Enforcing Unicode filenames — UTF-8 is usually the default charset for mounted filesystems on Linux (ext3/4, reiserfs...). However on Samba, it requires option
iocharset=utf8
:
mount -t cifs -o iocharset=utf8 //host/share /mnt/point
- For USB sticks, make sure it is enabled with option
utf8=1
:
mount - vfat -o utf8=1 /dev/sdb1 /mnt/point
- Enforcing Unicode tags — Note that some converter screw up with the charset (for instance
pacpl
). So you might need to post-process the tags after conversion, for instanceid3-to-unicode
or github fork).
Editors (GUI-based)
mp3 tag editor, idv3 tags...
- MusicBrainZ Picard
- Probably the most complete and powerful editor out there. Front-end to Picard database. Including cover art download.
- Banshee
- Banshee first takes the cover art locally from file (folder.jpg, cover.jpg...). Otherwise it will download automatically cover arts for music in the library. These cover arts are stored in ~/.cache/media-art. Cover art filename is a hash of artist and album name (See this link for a more powerful script [6]):
f="Ennio Morricone" al="My Name Is Nobody" echo "~/.cache/media-art/album-$(echo -ne "$f\t$al" | md5sum | cut -b1-32).jpg"
- You can edit metadata (ID3 tags) in Banshee, but click Write metadata to files to save back to library.
- Easytags aac
- Edit ID3 tag, including cover arts (with automatically download)
- Puddletag
- A bit buggy sometimes
- folder.jpg
- Used under Windows.
Editors (CLI-based)
- Beets with fetchart plugins
- Has auto-tagging facility (MusicBrainZ support) and can fetch and embed album arts automatically from itunes, amazon, google...
- eyeD3 (best)
- A simple tag editor, very complete (including cover art edition).
eyeD3 myfile.mp3
eyeD3 --list-image-types # View available image type (APIC frame)
eyeD3 --add-image=folder.jpg:FRONT_COVER:folder.jpg myfile.mp3
eyeD3 --plugin=stats --verbose *.mp3 # Stats on mp3 files, including bad / missing tags
- id3v2
- Does not report cover arts.
- CoverLovin — obsolete
- To download cover art automatically. Broken.
- Album Cover Art Downloader — obsolete
- Can save into a folder.jpg file, .folder.png and an
Icon
entry in .directory for Konqueror, into an ID3v3 APIC frame... - Broken.
Tools and scripts
View ALL tags in a music collection
Reference: [7]
Require eyeD3.
find music -iname "*.mp3" -exec eyeD3 -v {} \; | tee index
sort -u index | awk -F\): '/^<.*$/ {print $1}' | uniq | awk -F\)\> '{print $1}' | awk -F\( '{print $(NF)}' > tags
Remove ALL tags but some in a music collection
This script removes all tags except a few white listed ones. This is handy to remove inaccurate tags, or in case of conflicts (for instance when two tags are in conflict because tag editor ignored one of the tag). Tags may also contain private information (like buying date, etc).
Require eyeD3. Run as
cd ~/music strip-tags.sh
See oktags
for list of tags that are kept.
#!/bin/bash
# Script name: strip-tags.sh
# Original Author: Ian of DarkStarShout Blog
# Site: http://darkstarshout.blogspot.com/
# Options slightly modified to liking of SavvyAdmin.com
oktags="TALB APIC TCON TPE1 TPE2 TPE3 TIT2 TRCK TYER TCOM TPOS"
indexfile=`mktemp`
#Determine tags present:
find . -iname "*.mp3" -exec eyeD3 --no-color -v {} \; > $indexfile
tagspresent=`cat $indexfile | awk '/^[A-Z0-9]{4} \(.* bytes\)/ {print $1}' \
| sort -u | awk 'BEGIN {ORS=" "} {print $0}'`
rm $indexfile
#Determine tags to strip:
tostrip=`echo -n $tagspresent $oktags $oktags \
| awk 'BEGIN {RS=" "; ORS="\n"} {print $0}' | sort | uniq -u \
| awk 'BEGIN {ORS=" "} {print $0}'`
#Confirm action:
echo
echo The following tags have been found in the mp3s:
echo $tagspresent
echo These tags are to be stripped:
echo $tostrip
echo
echo -n Press enter to confirm, or Ctrl+C to cancel...
read dummy
#Strip 'em
stripstring=`echo $tostrip \
| awk 'BEGIN {FS="\n"; RS=" "} {print "--set-text-frame=" $1 ": "}'`
# First pass copies any v1.x tags to v2.3 and strips unwanted tag data.
# Second pass removes v1.x tags, since I don't like to use them.
# Without --no-tagging-time-frame, a new unwanted tag is added. :-)
find . -iname "*.mp3" \
-exec eyeD3 --to-v2.3 --no-tagging-time-frame $stripstring '{}' \; \
-exec eyeD3 --remove-v1 --no-tagging-time-frame {} \;
echo "Script complete!"
Music players, library managers and organizers
My current favorites: banshee, beets, cmus and picard.
Amarok
TBC
Banshee
TBC
Beets
beets is a very powerful and extensible music library manager. It can auto-tag music files, find cover arts, browse and search for title very rapidly...
References:
To install:
sudo pip install beets
sudo pip install requests # For album art download plugin fetchart
sudo easy_install python-itunes # To allow downloading art from iTunes
First configure beet. Issue command beet config -e
, and enter the following config:
directory: ~/music library: ~/.cache/musiclibrary.blb import: copy: no plugins: fetchart fetchart: maxwidth: 1000
This will configure beets to store music in directory ~/music, and build its database into ~/.cache/musiclibrary.blb. The copy: no
option tells beets not to move/copy the imported music to local music folder. Then a few plugins are loaded and configured.
Import music files into your library:
beet import ~/music
Some commands:
beet config -p
- get location of the config file.
beet list [query]
beet ls [query]
- Show the full library, or search it with given
query
.
Some tips:
- Beets can fetch art for album already in the library [12]:
beet fetchart [-f] [query]
- Beets can embed art using plugin embedart.
- Beets can look for track duplicates
cmus
cmus is a small, fast and powerful console music player for Unix-like operating systems. TBC
- Install latest version
- Install build dependencies
sudo apt-get build-dep cmus
- Download latest version and untar it
tar xvzf cmus-2.7.1.tar.gz cd cmus-2.7.1 ../configure make sudo make install
- Basic usage
- u — Update media cache.
- Troubleshoot
- Incorrect sorting of album artists.
- Probably due to conflicting tags (see [13], [14]). Cmus uses the content of tag TPE2 (aka "album artist") if present instead of TPE1 (aka "artist") used by other players like Amarok. The solution is to update the tags, or strip unnecessary tags using the script above strip-tags.sh.
- See also http://id3.org/id3v2.3.0 for tag info.
- To have all tracks of a same albums listed under the same artists, but still keep different artists / track, use a common artist name for album artist (e.g.
Adamo
) and a specific name for artist (e.g.Adamo en duo avec Bénabar
).
gmusicbrowser
TBC
Guayadeque
TBC
MPD
MPD stands for Music Player Daemon. TBC.
Nightingale
TBC
MusicBrainZ Picard
Picard is a front-end to the MusicBrainZ library.
- Troubleshoot — Cannot load album information in Picard 1.2
- This is a known bug in Picard 1.2 that prevents Picard to download album information when album art are associated with unknown types. Upgrade to version 1.3.2 from Ubuntu repository (ex. Xenial release).
- Select the CORRECT LABEL
- See detailed explanation. Clue: Look at the logo, not the (P) and (C) stuff!.
- Tag files - easiest method
- Easiest method is to use the CD lookup feature.
- Insert the CD
- Click on CD lookup.
- This will find the release in MB database.
- Then drag and drop your locally extracted album onto that release.
- Tag files - easy method
- First Add Folder, or (with file browser visible) drag and drop a folder to Unmatched Files.
- Click Cluster
- Click an album in the cluster, or click Clusters to lookup all albums, and click Lookup
- Right click album in right pane, and select Save.
- Tag files - scanning
- When Picard does not find a release corresponding to the cluster, use the scanning tool to find the release.
- Click an album in the cluster (or Clusters' to select all clusters), and click Scan.
- Tag files - manual lookup
- Click an album cluster, and click Lookup in browser.
- Browse the MB database. When the matching release is found, click the TAGGER link (the tag with green background)
- The release opens in Picard (it was send via port 8000 that Picard is listening to). Now either drag & drop the album on that release, or drag&drap each track individually. On error, just right click on the track and click remove.
- Encoding a new release - Examples
- Label:
Columbia
, Cat. No:COL 488791-2
My options:
Tags | Cover Art | File Naming |
|
|
|
Rhythmbox
TBC
Web Radio
Several ways to play internet radios in Linux (sources [15]).
Let's consider the following radios:
- Chromanova.fm Chillout (homepage) - playlist (.pls) content:
[playlist] numberofentries=5 File1=http://85.25.86.69:8100 Title1=(#1 - 25/160) Chromanova.fm presents: Ambient & Chillout Deejay Sets Length1=-1 File2=http://212.112.241.88:8100 Title2=(#2 - 25/120) Chromanova.fm presents: Ambient & Chillout Deejay Sets Length1=-1 File3=http://85.25.86.69:9000 Title3=(#3 - 159/160) Chromanova.fm presents: Ambient & Chillout Deejay Sets Length1=-1
Here we list the various way to play the radios listed above.
- Mplayer
- Mplayer can play most streams. Give it the *stream* URL, not the playlist. Use -cache 1000 to cache audio stream. Works also fine with proxies.
mplayer -cache 1000 http://85.25.86.69:8100
- mpg123
- mpg123 can also play most radio stream. Works also fine with proxies.
mpg123 -cache 1000 http://85.25.86.69:8100
- audacious
- TBC
- streamtuner2
- TBC
streamtuner2 -r # Then tell audacious to open http://localhost:8000
- streamripper
- Use streamripper to rip an audio stream into a file. It can also relay the stripped stream to a local port to be played and ripped simultaneously
streamripper server:port -D "%S/%q -- %A - %T" # Rip to file (w/ naming convention)
streamripper server:port -D "%S/%q -- %A - %T" -r # Rip and relay to port 8000
mpg123 http://localhost:8000 # ... and play it
- banshee
- NOT WORKING — can't make it work, at least behind a proxy. Giving either .pls, or stream URL, nothing works (w/o error msg)
- rhythmbox
- NOT WORKING — can't make it work, at least behind a proxy. Giving either .pls, or stream URL, nothing works (w/o error msg)
- amarok
- STATE UNKNOWN — Used to work in the past, but need some weird configuration for the proxy.