Msync: Maintain lower-bitrate copy of your music files
github.com
github.com
> Requirements: at the moment, msync supports only macOS. This is because it uses macOS's built-in afinfo tool to determine music files' bitrates.
You can simply use file[1] to get the bitrate on Linux if you have the metadata (if you lack the metadata, read below). I bet even macOS supports it, it is available on Unix, Unix-like, Plan 9, and IBM i. That, or you can use the MediaInfo[2] program or library, although I am not sure if it works with metadata or not.
Using file:
file foo.mp3 | sed 's/.*, \(.*\)kbps.*/\1/'| tr -d " "
The result is in kbps.[1] https://en.wikipedia.org/wiki/File_(command)
[2] https://mediaarea.net/en/MediaInfo, https://mediaarea.net/en/MediaInfo/Download
You can download the CLI, GUI, or the library of MediaInfo. You want the CLI or the library.
---
The above solutions may work only if you have the metadata (ID3, for example) set, although I am not sure about MediaInfo.
Another solution would be using ffprobe[3] (requires ffmpeg), which for example returns this for a FLAC file:
Metadata:
Comment : Processed by SoX
Duration: 00:00:26.20, start: 0.000000, bitrate: 527 kb/s
Stream #0:0: Audio: flac, 48000 Hz, stereo, s16
It should not be based on any metadata.For a FLAC file, I get:
Metadata:
Comment : Processed by SoX
Duration: 00:00:26.20, start: 0.000000, bitrate: 527 kb/s
Stream #0:0: Audio: flac, 48000 Hz, stereo, s16
You could extract 527 kb/s easily from this, too, and it should not be based on metadata.I edited my previous comment.
ffprobe -print_format json -show_format -show_streams foo.flac
This should be easy to parse.This won't work on iPhone, since MPD hasn't been ported, but it works great for Android.
I did something similar a long time ago, a process that transcodes music on-the-fly with ffmpeg and exposes the ogg version through a FUSE filesystem, also built with go (https://github.com/rakoo/codecfs/). I just tested and you can export this FUSE filesystem through SFTP, and VLC on Android can open remote folders through SFTP... so you can have your entire library compressed on-the-fly on both Android and iOS, and there is no lag between input and playback. If you want to keep a song on your phone for offline use, like the OP link usecase, just copy the file locally: it works today, without installing anything or running stuff on your computer.
Filesystems all the way down and it works transparently (even though to be even cleaner SFTP should be mountable and available as a standard folder in Android). Somewhere in there Plan9 says "I told you so".
(Note if you're doing that: there is an issue with entering credentials on Android with SFTP, see https://code.videolan.org/videolan/vlc-android/-/issues/1508)
iTunes Match is still around:
“iTunes Match gives you access to all of your music on all of your devices, even songs that you've imported from other sources such as CDs.”
https://support.apple.com/en-us/HT204146
It’s $25 a year, and will cheerfully upgrade crappy .mp3s of dubious origin from the 90s-00s to high bitrate drm-free AAC.
“Matched, uploaded, and purchased tracks reside in iCloud Music Library, Apple's cloud-based music locker. Users can stream or download these tracks from iCloud Music Library to any of their 10 devices as long as their iTunes Match subscription remains active; downloaded tracks will either show up as a 256kbps matched DRM-free AAC file or an AAC-converted file of tracks you uploaded on devices other than the Mac or PC from which tracks were uploaded. If you uploaded music in WAV, ALAC, or AIFF formats, then they will remain in those formats on the Mac or PC from which they were uploaded.”
https://www.imore.com/apple-music-vs-itunes-match-whats-diff...
I moved from home grown to this when it first came out, as for me the $25 a year was worth not maintaining anything.
Plex Music: https://www.plex.tv/your-media/music/
Supported Devices: https://www.plex.tv/apps-devices/
(I recommend a Lifetime Plex Pass for $120, as after three years that will have been the better bet and one tends to stay invested in a curated library. Also consider the subscription Tidal integration for a high sound quality streaming library of 60M tracks.)
---
To your point about stories of unique recordings, yes, first release was pretty sketchy but it didn’t replace the origin computer recordings. Many people tried using it to “upgrade” found rips or bootlegs, and lost things that way as its early matching was considerably worse than that era’s open tools.
My hand curated library was around 25,000 tracks. It initially matched only a minority, mostly mainstream. Through time, it’s matched more and more tracks, more and more accurately. By now I’m surprised when it can’t match something, and it’s rare if gets confused between releases of the same song by the same artist.
Correct me if I’m wrong, but isn’t this feature built in (since the early days of iPhone)?
Unfortunately it uses ffmpeg's AAC encoder, which isn't the best. I went for using XLD's command line tools on mac to encode to AAC using Apple's codec, and that does produce better results - I tried afconvert to start with and had a lot of issues.
From talking to my friends, it sounds like everyone is just streaming all the time.