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.
On my Linux Mint 18.2 setup, it’s a simple one liner:
sudo apt-get install mp3fs
First, create the folder where my FLAC files will appear as MP3 files. I’m calling mine
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:
mp3fs -b 192 /media/norman/USB_MUSIC ./mp3
-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:
ls ./mp3 Benny Andersson Carole_King Fleetwood_Mac Tangerine Dream Zero Project ls ./mp3/Tangerine\ Dream/ Quantum_Gate ls ./mp3/Tangerine\ Dream/Quantum_Gate/ 01 - Sensing_Elements.mp3 02 - Roll_the_Seven_Twice.mp3 03 - Granular_Blankets.mp3 04 - It_is_Time_to_Leave_When_Everyone_is_Dancing.mp3 05 - Identify_Proven_Matrix.mp3 06 - Non-Locality_Destination.mp3 07 - Proton_Bonfire.mp3 08 - Tear_Down_the_Grey_Skies.mp3 09 - Genesis_of_Precious_Thoughts.mp3
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:
fusermount -u ./mp3
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.