SONOS announced major updates to app

I listen to one album at a time. I've never created a playlist or mixtape. The only "playlists" I've ever used are called radio stations. So, Sonos isn't "better" for me at all ~ a former Sonos user. Please don't generalize.
I like the cut of your jib buddy. Well said 👌🏼
 
I listen to one album at a time. I've never created a playlist or mixtape. The only "playlists" I've ever used are called radio stations. So, Sonos isn't "better" for me at all ~ a former Sonos user. Please don't generalize.
Of course if you have more than 65,000 tracks Sonos definitely can't play them all 🤣
 
I listen to one album at a time. I've never created a playlist or mixtape. The only "playlists" I've ever used are called radio stations. So, Sonos isn't "better" for me at all ~ a former Sonos user. Please don't generalize.

I'm in the same boat. If I want to listen to a playlist, thats internet radio driven these days, typically Radio Paradise, Mother Earth Radio, The Jazz Groove, or JB Radio2, among others. When I choose the music, it's an album, just like it ever was in the physical media days.
 
I was trying to solve this and this is what I ended up with.
Asset server which just chugs away in the background with no input from me. It doesn't have to be asset just one that will pick up changes automatically.
A script that runs periodically, finds all the flac files, shuffles them, then picks 200 random ones and overwrites a playlist called random.m3u
In the morning while I wait for the kettle to boil I assign random.m3u in "Home Music Share" to preset 1 on my remote control. (Wiim saves the list of tunes rather than links to the actual playlist due to some complicated upnp malarkey).
Now I press 1 on my remote and get random tunes. If I play something else then press 1 again it picks up where I left off ie the start of the last playing song.
Of course I could just press "shuffle all" on a client app but I wanted it to work with the remote because I'm not attached to my phone and I wanted the possibility of any tune (I have about 50,000).
Another way is to just play all your tunes on random on the server and use some broadcast software like icecast to play it as a continuous "radio stream". Then just connect to the URL when you want a full random selection.
There's probably a far, far easier way but the asset works for me and life is good :)
 
I was trying to solve this and this is what I ended up with.
Asset server which just chugs away in the background with no input from me. It doesn't have to be asset just one that will pick up changes automatically.
A script that runs periodically, finds all the flac files, shuffles them, then picks 200 random ones and overwrites a playlist called random.m3u
In the morning while I wait for the kettle to boil I assign random.m3u in "Home Music Share" to preset 1 on my remote control. (Wiim saves the list of tunes rather than links to the actual playlist due to some complicated upnp malarkey).
Now I press 1 on my remote and get random tunes. If I play something else then press 1 again it picks up where I left off ie the start of the last playing song.
Of course I could just press "shuffle all" on a client app but I wanted it to work with the remote because I'm not attached to my phone and I wanted the possibility of any tune (I have about 50,000).
Another way is to just play all your tunes on random on the server and use some broadcast software like icecast to play it as a continuous "radio stream". Then just connect to the URL when you want a full random selection.
There's probably a far, far easier way but the asset works for me and life is good :)
Great concept! Can you post your randomizing script?
 
I was trying to solve this and this is what I ended up with.
Asset server which just chugs away in the background with no input from me. It doesn't have to be asset just one that will pick up changes automatically.
A script that runs periodically, finds all the flac files, shuffles them, then picks 200 random ones and overwrites a playlist called random.m3u
In the morning while I wait for the kettle to boil I assign random.m3u in "Home Music Share" to preset 1 on my remote control. (Wiim saves the list of tunes rather than links to the actual playlist due to some complicated upnp malarkey).
Now I press 1 on my remote and get random tunes. If I play something else then press 1 again it picks up where I left off ie the start of the last playing song.
Of course I could just press "shuffle all" on a client app but I wanted it to work with the remote because I'm not attached to my phone and I wanted the possibility of any tune (I have about 50,000).
Another way is to just play all your tunes on random on the server and use some broadcast software like icecast to play it as a continuous "radio stream". Then just connect to the URL when you want a full random selection.
There's probably a far, far easier way but the asset works for me and life is good :)
Can’t you just use the Jukebox Track Selection in the AssetUPNP main menu to generate your random playlist each day?
 
Great concept! Can you post your randomizing script?
The bit that does the random tunes is this

Code:
#! /bin/bash
fdfind . /mnt/Music/Music/ -e flac | shuf | shuf -n 200 >
/mnt/Music/Music/Playlists/Random.m3u

You would have to change the paths to apply to your set up and would need to be able to run a bash shell so Linux or Mac

The whole thing does 7 playlists and relies on the fact my Music is organised very loosely by genre.

There are other ways of doing this using tags but that relies on using a music tagging/organising software like beets or songkong and I just find this way simpler.

Can’t you just use the Jukebox Track Selection in the AssetUPNP main menu to generate your random playlist each day?

I could but this way, the playlists are picked up by my Emby server too.
 
Tha
The bit that does the random tunes is this

Code:
#! /bin/bash
fdfind . /mnt/Music/Music/ -e flac | shuf | shuf -n 200 >
/mnt/Music/Music/Playlists/Random.m3u

You would have to change the paths to apply to your set up and would need to be able to run a bash shell so Linux or Mac

The whole thing does 7 playlists and relies on the fact my Music is organised very loosely by genre.

There are other ways of doing this using tags but that relies on using a music tagging/organising software like beets or songkong and I just find this way simpler.



I could but this way, the playlists are picked up by my Emby server too.
Thanks for sharing. `shuf` is a new one for me so it tickled my coding brain bits🤓
 
There are other ways of doing this using tags but that relies on using a music tagging/organising software like beets or songkong and I just find this way simpler.
Emby uses sqlite on the backend so you could probably use that (library.db) to create playlists based on Genre, Date/OriginalReleaseDate e.t.c.
 
Emby uses sqlite on the backend so you could probably use that (library.db) to create playlists based on Genre, Date/OriginalReleaseDate e.t.c.
I could, but that sounds like hard graft. Much easier for that sort of thing to make a smart playlist in symfonium, export it, and use a while loop in bash with shuf to pick some random tunes from the exported list......and let Tolriq (symfonium's dev) worry about sqlite :)
 
I could, but that sounds like hard graft. Much easier for that sort of thing to make a smart playlist in symfonium, export it, and use a while loop in bash with shuf to pick some random tunes from the exported list......and let Tolriq (symfonium's dev) worry about sqlite :)
I don't use Emby but I've just had a quick look at the database and it's pretty straightforward, at least it is as far as my example goes.

Let's say we wanted a playlist of 200 random Pop music tracks from the 90's:
SQL:
select a.path
  from mediaitems          a
         inner join
       itemlinks2          b on (a.id = b.itemid)
         inner join
       fts_search9_content c on (b.LinkedId = c.id)
  where     a.type = 11                            -- Tracks
        and (b.type = 2 and c.c0 = 'Pop')          -- Genre
        and a.productionyear between 1990 and 1999 -- Year range
  order by random() limit 200;                     -- Number of items
Put that in a text file named 90sPopExport.sql and schedule the following code to run daily:
Code:
sqlite3 library.db <90sPopExport.sql >90sPopPlaylist.m3u
 
Last edited:
Thank you very much!
I don't use Emby but I've just had a quick look at the database and it's pretty straightforward,

So having a mess with that I've made some playlists that combine genres eg
Code:
 where     a.type = 11  
        and ((b.type = 2 and c.c0 = 'Vocal Music') or (b.type = 2 and c.c0 = 'Chamber Music') or (b.type = 2 and c.c0 = 'Opera'))

And search for a string within a genre (so match Jazz, Jazz Fusion; Vocal Jazz etc)

Code:
 where     a.type = 11 
                and (b.type = 2 and LOWER(c.c0) GLOB LOWER('*jazz*'))

The only other parameters I would really use are "bits per sample" and "sample rate". I have some headphones that you can go swimming in but they only take flac files upto 24/96. In symfonium I can export a smart playlist with the rule (Bits per sample is less than 25) AND (Sample rate is less than 96001). How would I add those to the sqlite3 query?

Or indeed how do I list which parameters I can query?
 
The only other parameters I would really use are "bits per sample" and "sample rate". I have some headphones that you can go swimming in but they only take flac files upto 24/96. In symfonium I can export a smart playlist with the rule (Bits per sample is less than 25) AND (Sample rate is less than 96001). How would I add those to the sqlite3 query?

Or indeed how do I list which parameters I can query?
Are you copying sections from previous posts and pasting them in quote blocks as I'm not getting notified of replies (notice my name is missing from the quoted block)?

The easiest way to browse the database is to use a GUI, something like DB Browser for SQLite (on a copy of the database), but if you're comfortable using sqlite3:
.tables - lists available tables
.schema tablename - prints the table definition

SampleRate and BitDepth are in MediaStreams2 so my original query becomes:
SQL:
select a.path,
       d.SampleRate,
       d.BitDepth
  from mediaitems          a
         inner join
       itemlinks2          b on (a.id = b.itemid)
         inner join
       fts_search9_content c on (b.LinkedId = c.id)
         inner JOIN
       mediastreams2       d on (a.id = d.itemid)
  where     a.type = 11                            -- Tracks
        and (b.type = 2 and c.c0 = 'Pop')          -- Genre
        and a.productionyear between 1990 and 1999 -- Year range
        and d.streamtype = 1                       -- Audio track (as the table includes the metadata of embedded images)
  order by random() limit 200;                     -- Number of items

In the above sql I've output SampleRate and BitDepth; when you're happy that they look right you just need to add your constraints to the where clause (and remove them from the select):
Code:
        and d.SampleRate < 96001
        and d.BitDepth < 25
 
Last edited:
Are you copying sections from previous posts and pasting them in quote blocks as I'm not getting notified of replies (notice my name is missing from the quoted block)?
I am, sorry, and thankyou again

For the swimming headphones, I like to have any track upto 24/96 so I tried modifying the above and removing the genre bit and the year bit to

Code:
select a.path,
       d.SampleRate,
       d.BitDepth
  from mediaitems          a
         inner join
       itemlinks2          b on (a.id = b.itemid)
         inner join
       fts_search9_content c on (b.LinkedId = c.id)
         inner JOIN
       mediastreams2       d on (a.id = d.itemid)
  where     a.type = 11                            -- Tracks
        and d.streamtype = 1                       -- Audio track (as the table includes the metadata of embedded images too)
        and d.SampleRate < 96001
        and d.BitDepth < 25

and I get

Code:
/mnt/Music/Music/Pop Rock/Alternative/Killing Joke/Hosannas from the Basements of Hell/1-05 Majestic.flac|44100|16
/mnt/Music/Music/Classical Music/Chamber Music/Smetana_Trio/Beethoven_Piano_Trios/2-02_Piano_Trio_in_D_major,_Op._70_No._1_Ghost_II._Largo_assai_ed_espres.flac|44100|16
/mnt/Music/Music/Roots/Americana/Shelby Lynne/Shelby Lynne/1-04 Weather.flac|44100|24

with the sample rate and bit depth included at the end of each result, which is easily solved with sed, but how do I just get it to just output the path to the file?

.....then I promise, I'll shut up and let this thread get back to SONOS' update.
 
with the sample rate and bit depth included at the end of each result, which is easily solved with sed, but how do I just get it to just output the path to the file?
Just remove SampleRate and BitDepth from the select clause, so it reads
SQL:
select a.path
  from mediaitems ...

.....then I promise, I'll shut up and let this thread get back to SONOS' update.
If you have any problems just send me a message.
 
Back
Top