Control Sonos speakers with Ruby.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install sonos
I'm working on a CLI client. For now, we'll use IRB. You will need the IP address of a speaker (auto-detection is on my list too). To get the IP of a speaker, one of your Sonos controllers and go to "About My Sonos System".
$ gem install sonos $ irb
require 'rubygems' require 'sonos' speaker = Sonos::Speaker('10.0.1.10') # or whatever the IP is
Now that we have a reference to the speaker, we can do all kinds of stuff.
speaker.pause # Pause whatever is playing speaker.play # Resumes the playlist speaker.play 'http://assets.samsoff.es/music/Airports.mp3' # Stream! speaker.now_playing speaker.volume speaker.volume = 70 speaker.volume -= 10
- Party Mode
- Handle errors better
- Fix album art in
- Handle line-in in
- Better support for stero pairs
- CLI client
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request