All Projects → mlang → Ronor

mlang / Ronor

Sonos smart speaker controller API and command-line tools

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Ronor

Winfetch
🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
Stars: ✭ 189 (-10.85%)
Mutual labels:  command-line
Vonage Ruby Sdk
Vonage REST API client for Ruby. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Stars: ✭ 203 (-4.25%)
Mutual labels:  text-to-speech
Kube Linode
🐳 Provision a Kubernetes/CoreOS cluster on Linode
Stars: ✭ 207 (-2.36%)
Mutual labels:  command-line
Askgit
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
Stars: ✭ 2,707 (+1176.89%)
Mutual labels:  command-line
Ascii
👾 ASCII Roulette :: ascii art video chat on the cli
Stars: ✭ 202 (-4.72%)
Mutual labels:  command-line
Waveglow
A PyTorch implementation of the WaveGlow: A Flow-based Generative Network for Speech Synthesis
Stars: ✭ 205 (-3.3%)
Mutual labels:  text-to-speech
Sharprompt
Interactive command line interface toolkit for C#
Stars: ✭ 197 (-7.08%)
Mutual labels:  command-line
Node Cli Boilerplate
Boilerplate to kickstart creating a Node.js command-line tool
Stars: ✭ 209 (-1.42%)
Mutual labels:  command-line
Saldl
A lightweight well-featured CLI downloader optimized for speed and early preview.
Stars: ✭ 203 (-4.25%)
Mutual labels:  command-line
Facebook Dl
📼 Very minimal Facebook downloader written in 28 lines of Python code (not including comments and blank spaces)
Stars: ✭ 207 (-2.36%)
Mutual labels:  command-line
Survey
A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
Stars: ✭ 2,843 (+1241.04%)
Mutual labels:  command-line
Miniserve
🌟 For when you really just want to serve some files over HTTP right now!
Stars: ✭ 2,894 (+1265.09%)
Mutual labels:  command-line
Learn gnugrep ripgrep
Example based guide to mastering GNU grep and ripgrep
Stars: ✭ 204 (-3.77%)
Mutual labels:  command-line
Ruplacer
Find and replace text in source files
Stars: ✭ 201 (-5.19%)
Mutual labels:  command-line
Stonky
A command line dashboard for monitoring stocks
Stars: ✭ 208 (-1.89%)
Mutual labels:  command-line
Zoxide
A smarter cd command. Supports all major shells.
Stars: ✭ 4,422 (+1985.85%)
Mutual labels:  command-line
Gpymusic
Google Py Music: A simple TUI client for Google Play Music
Stars: ✭ 204 (-3.77%)
Mutual labels:  command-line
Mac
macOS Mojave v. 10.14 setup for developers.
Stars: ✭ 209 (-1.42%)
Mutual labels:  command-line
Aws Sso Util
Smooth out the rough edges of AWS SSO (temporarily, until AWS makes it better).
Stars: ✭ 208 (-1.89%)
Mutual labels:  command-line
Argparse4j
Java port of Python's famous argparse command-line argument parser.
Stars: ✭ 206 (-2.83%)
Mutual labels:  command-line

Sonos smart speaker controller API and CLI

Linux: Build Status

This project implements (most of) the Sonos control API in a rust crate. It also provides a simple command-line tool which can be used in scripts.

Building

You likely need a recent rust compiler. If you don't have rustup installed yet, I recommend you do so:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Now you are ready to build/install ronor:

$ cargo install --git https://github.com/mlang/ronor

This will copy the binary to ~/.cargo/bin/ronor which should be in your PATH if you are using rustup.

Configuration

You have to register a developer account on integration.sonos.com and create your own integration point. You also need to create your own redirection endpoint on the web. A minimalistic example script is provided in static/sonos.php. Copy that file to a web space you control, and use it as the redirection URL required when you create the integration.

With your integration information ready, run ronor init and your client id, secret, and redirection url will be saved to ~/.config/ronor/.

Now you can authorize ronor to access households belonging to your Sonos user account by running ronor login.

How to use

See ronor help for a list of available commands.

Favorites and Playlists

Sonos has two mechanisms for managing content you often play. Favorites can be thought of as pointers to specific streaming service content. For instance, a radio station, podcast, or a specific artist or album on a registered streaming service. A playlist is a list of several tracks, possibly on different streaming services. There is currently no API to create these, you have to use a Sonos controller like the iOS App to create favorites and playlists.

However, you can query and play favorites and playlists:

$ ronor get-favorites
Das Soundportal Radio
Freies Radio Salzkammergut
Österreich 1
Radio FM4
Radio Helsinki
Radio Swiss Classic
radiOzora Chill channel
SRF 2 Kultur
$ ronor load-favorite --play 'Österreich 1' Schlafzimmer
$ ronor get-playlists
Acid
Psybient
PsyDub
$ ronor load-playlist --shuffle --crossfade --play PsyDub Wohnzimmer

Managing groups

Use the modify-group subcommand to manage grouping of logical players.

For example, imagine the following household of three players and no grouping.

$ ronor inventory
Bad = Bad
Wohnzimmer = Wohnzimmer
Schlafzimmer = Schlafzimmer

That means, each player is the sole member of a group with the same name.

Now lets make a group of Schlafzimmer (bedroom) and Bad (Bathroom).

$ ronor modify-group Schlafzimmer --add Bad
Schlafzimmer -> Schlafzimmer + 1
$ ronor inventory
Schlafzimmer + 1 = Schlafzimmer + Bad
Wohnzimmer = Wohnzimmer

To undo this group, we simply remove Bad from Schlafzimmer + 1 again:

$ ronor modify-group 'Schlafzimmer + 1' --remove Bad
Schlafzimmer + 1 -> Schlafzimmer
$ ronor inventory
Bad = Bad
Wohnzimmer = Wohnzimmer
Schlafzimmer = Schlafzimmer

Notice that you never have to name groups. Sonos will automatically choose a name for a newly created group based on the coordinating player and the number of other members.

Text to speech

For the text-to-speech functionality (ronor speak) you need espeak and ffmpeg installed. Simply pipe text to STDIN and it should be spoken by the desired player.

$ echo "Hallo Wohnzimmer"|ronor speak --language de Wohnzimmer

Alternatively, ronor speak can scrape predefined web resources and speak the extracted text. The following command will speak the current weather forecast for Styria in Austria:

$ ronor speak --scrape wetter.orf.at/steiermark Wohnzimmer

The following scraping sources are predefined:

ronor speak makes use of transfer.sh for temporary storage and the loadAudioClip API. If you'd like to play already prepared audio clips, use ronor load-audio-clip.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].