Download songs from your remote music collection onto your phone โ optionally converting to a different audio codec.
The goal is to have a similar experience to Spotify or Netflix download caches.
- A file synchronization tool on both the server and the phone. Any will do, that is
any that copies changed files automatically from each side to the other will do.
If you don't know which, I suggest you give Syncthing a try.
Optional for codec conversion:
- Android OS
Unpack the server/
directory on the server machine and configure "audio"
, the path
to your music libarary in songfone.conf
:
{
"audio": "~/Music"
}
This is the only required configuration.
Next set up your file synchronization tool to share ~/.local/share/songfone
with the
device you want to download music to.
You should see a .songfone/
directory appear as soon as you start the server.
TODO
The default share folder is ~/.local/share/songfone
, but you can set its location
anywhere by adding the "output"
option:
{
"audio": "~/Music",
"output": "~/my/songfone"
}
You may set multiple audio source paths like this:
{
"audio": ["~/Music", "~/AudioBooks"]
}
When converting songs, you might want to use multiple threads to speed up the process:
{
"audio": "~/Music",
"max_conversion_threads": 6
}
The default value is 2
, so not setting this will already convert two songs at a time.
This config key supports setting the thread count in relation to the system's CPU count:
{
"audio": "~/Music",
"max_conversion_threads": "cpus/2"
}
You may use any expression like "cpus" [["+"|"-"|"*"|"/"] <number>]
, e.g.: "cpus-2",
"CPUs * 2" or just "cpus". Case and spaces between the operands and operators don't
matter. Conversion can occupy a CPU pretty well, so some recommended alternate settings
would be "cpus-1" or the more conservative "cpus/2", so that your system still has
some wiggle room.
Other options can be found in config.py
as attributes of
the Config
class.
- android app
- cover art
- (multiple servers)
You may use this code without attribution, that is without mentioning where it's from or who wrote it. I would actually prefer if you didn't mention me. You may even claim it's your own.