Playing local MP3 on Sonos

I thought I’d share how I got the playback of local .mp3 files working through Sonos. I added some .mp3 files to /etc/openhab/sounds and then created a new Samba share:

[openHAB-sounds]
  comment=openHAB sound files
  path=/etc/openhab/sounds
  writeable=yes
  public=no
  create mask=0664
  directory mask=0775
  guest ok = yes
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

The crucial bit seems to be guest ok = yes. That’s what stopped the “access denied” message in Sonos. The format of the URI in my case is:

x-file-cifs:///openHAB-sounds/mysound.mp3

For Sonos, it’s important that the hostname be in capitals, apparently, and the filenames and directories need to be URL-encoded if they contain spaces or what have you.

You may want to create a separate directory with more restricted permissions for this purpose.

1 Like