I have ripped all my music, well most of it, to FLAC for the quality aspect. Sometimes though, I need to convert to MP3 for some of the lesser audio players out there that I might have to use from time to time.
I have recently come across a pretty nifty (Linux) way to do this, without having to cope with having duplicate files in FLAC and MP3 formats on my hard drives.
The utility I’ve discovered is called mp3fs and is a FUSE file system whereby a normal, non-root user, can mount
the FLAC folder and see the contents as MP3 files.
Once mounted in this way, the MP3 files can be played by, or copied to, a less well enabled device and will be converted to MP3 on the fly. I don’t then have to have MP3 files clogging up my music hard drives.
Installation
On my Linux Mint 18.2 setup, it’s a simple one liner:
|
|
Usage
First, create the folder where my FLAC files will appear as MP3 files. I’m calling mine mp3
:
|
|
Then mount the FLAC folder on to the new mp3
folder. The FLAC files live in /media/norman/USB_MUSIC
and sub-folders below this mount point:
|
|
The -b 192
part sets the bit rate for the MP3 output files. Other values are available.
Now, if I do a quick check, I see the following:
|
|
|
|
|
|
It’s looking good. Now I can copy my wife’s new CDs from the folders above to the device she wants to play them on, as MP3 files. My FLAC ripped files will be converted to MP3 on the fly as the copy progresses.
Once completed, I can unmount the mp3
folder as follows:
|
|
There are numerous options that can be supplied to the mp3fs command, including one to automatically unmount the folder after the file operation has completed. I prefer to manual unmount things as I might want to do other stuff later.