sonos | Control Sonos speakers with Ruby | Audio Utils library

 by   gotwalt Ruby Version: Current License: MIT

kandi X-RAY | sonos Summary

kandi X-RAY | sonos Summary

sonos is a Ruby library typically used in Audio, Audio Utils applications. sonos has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Control Sonos speakers with Ruby
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sonos has a low active ecosystem.
              It has 377 star(s) with 82 fork(s). There are 36 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 8 open issues and 11 have been closed. On average issues are closed in 136 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of sonos is current.

            kandi-Quality Quality

              sonos has 0 bugs and 0 code smells.

            kandi-Security Security

              sonos has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sonos code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sonos is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sonos releases are not available. You will need to build from source code and install.
              sonos saves you 388 person hours of effort in developing the same functionality from scratch.
              It has 923 lines of code, 129 functions and 20 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sonos and discovered the below as its top functions. This is intended to give you an instant insight into sonos implemented functionality, and help decide if they suit your requirements.
            • Constructs a cluster of all nodes associated with this cluster .
            • Initialize the client .
            • Turn this participant into this participant .
            • Prints all users
            • Creates a new instance .
            • returns list of hosts
            • Set the current status
            • Sets the cross - stroke span
            • Checks if the current user has a Patient .
            • Sets the delay_delay for all repeat values .
            Get all kandi verified functions for this library.

            sonos Key Features

            No Key Features are available at this moment for sonos.

            sonos Examples and Code Snippets

            No Code Snippets are available at this moment for sonos.

            Community Discussions

            QUESTION

            SONOS auth token is not being sent in Authorization HTTP header for CQ API calls
            Asked 2021-May-21 at 23:00

            I followed the Sonos docs for adding app authentication and the page for using authentication tokens and the result is that the SMAPI server correctly returns an authToken together with a privateKey back to the controller. I can see the authToken being present in the credentials header inside the SOAP messages sent to my SMAPI server.

            However, despite the many mentions of this inside the Sonos docs pages related to HTTP requests (I will list the resources links down below), the same authToken is not being sent inside the HTTP header Authorization, this making my CQ server unable to validate requester identity.

            I tried the following, without success:

            • checking "Requires authorization header" capability in the customsd page of my Sonos device (I tried this because the docs page about capabilities precisely indicates that checking this "Sends OAuth token in the HTTP Authorization header.")

            • identifying some correlation between the "X-Sonos-" prefix HTTP headers used when the controller sends SOAP messages to my SMAPI server and the "X-Sonos-" prefix HTTP headers used when the device sends HTTP requests to my CQ server (eventually, I could not find any information that would identify the user based on this)

            From Sonos device:

            X-Sonos-Playback-Id: RINCON_48??????D201400:3165321802 <= deviceId inserted after RINCON_

            X-Sonos-Device-Id: Sonos_U????????????????????????6 <= householdId

            X-Sonos-Corr-Id: 267e3e0c-75ca-4b9d-8be4-b8a795a462a3 <= unique each time

            From macOS Controller:

            X-Sonos-Controller-ID: 68:??:??:??:??:07 <= the same each time

            X-Sonos-Api-Key: 8??????e-7??7-4??f-b??6-7??????????0 <= the same each time

            X-Sonos-Corr-Id: 648ec896-e043-44f8-bfba-cd0a80c9d857 <= unique each time

            The docs links I mentioned above that refer the presence of the auth token inside the HTTP Authorization header are the following:

            • the GET /context CQ API method page says to return 401 Unauthorized when "The access token has expired or is invalid."

            • the GET /itemWindows CQ API method page says "the player can use this API to obtain a new access token in the response from your cloud queue server" and "The request contains the access token in the authorization header" and "If the access token is set to expire soon, an updated one is included in the X-Updated-Authorization header of the response"

            • the POST /timePlayed CQ API method page says "The request header contains the access token in the authorization header" and that the method returns ERROR_SONOS_TOKEN_EXPIRED when "SMAPI OAuth token is expired, and user must re-authorize the account"

            • the GET /version CQ API method page says again that "The request contains the access token in the authorization header" and talks about a now deprecated updateToken parameter and also says that "If the access token is set to expire soon, you should include an updated token in the X-Updated-Authorization header."

            But the most clear mention is in the page about HTTP requests, because it's not particular just for the CQ API endpoints but for all HTTP endpoints, even those hosted by the SMAPI server itself. The page reads the following 2 excerpts:

            and

            To conclude, with so many mentions of it in the official Sonos docs, why isn't this essential header being transmitted in the HTTP Authorization header? And how should a CQ verify the identity of the requester without the presence of this authToken on each API method request?

            ...

            ANSWER

            Answered 2021-May-09 at 22:26

            If I follow you correctly, the token is passed in the header under loginToken, see https://developer.sonos.com/build/content-service-add-features/add-authentication/use-authentication-tokens/

            This is not an http header, this is a section of the SOAP envelope. Like this:

            Source https://stackoverflow.com/questions/67316704

            QUESTION

            Sonos Simulator not able to compile node package
            Asked 2021-Apr-24 at 21:43

            Trying to install and utilize the https://developer.sonos.com/tools/developer-tools/sonos-simulator/

            When following the install instructions and trying to install the node package via the npm install command within the directory it fails with a 404 error trying to find node-ssdp as seen from the snippet below:

            ...

            ANSWER

            Answered 2021-Apr-24 at 21:43

            I was having a play around with this today, and managed to get it working.

            I installed an old (4.x) version of node as this is what the documentation said it worked with (I honestly didn't try anything newer as I couldn't get the simulator to do what I wanted so uninstalled it after).

            The main issue was with node-ssdp, as the included package file with the simulator was trying to get it from a repo that no longer exists. After some trial and error, I found that if you edit the package file to specify node-ssdp 2.7.0 (which is the version that was released when the simulator was), the npm install should go through ok. (If you install a newer version the simulator crashes a few seconds after you run it).

            Hopefully this helps!

            Source https://stackoverflow.com/questions/66702046

            QUESTION

            Control API: Service unavailable (503)
            Asked 2021-Jan-19 at 14:16

            Good morning,

            I want to query households (my first query and generally first experience with the Sonos API) and have authenticated successfully. I got an access token and query the Control API like this:

            ...

            ANSWER

            Answered 2021-Jan-19 at 14:16

            I see two issues with the code snippet you provided:

            • Issue 1: Your API URL has a typo. You used "househoulds" instead of "households".
            • Issue 2: Your URL needs to use https://, not http://

            If you fix those two issues and are indeed using a valid access token, your request should work.

            Source https://stackoverflow.com/questions/65747360

            QUESTION

            composer installing packages command is not defined
            Asked 2020-Dec-03 at 08:30

            I have installed composer on my Synology NAS using this tutorial. I did use PHP73 instead of PHP70 because the package I would like to install requires a minimum of PHP72. It all seems to run fine until I run the following command:

            ...

            ANSWER

            Answered 2020-Dec-03 at 08:30

            Solved this by adding the following to my composer.json file and thus forcing composer to use a different version of PHP:

            Source https://stackoverflow.com/questions/65095414

            QUESTION

            Sonos API sends too short auth code in return?
            Asked 2020-Oct-30 at 10:05

            Turning to all you smart people out there for help, tips and trix :)

            I want to connect my NodeRed instance to the Sonos API to control my speakers in various ways. During the OAUTH process however, after logging in with my username and password for my account, the auth code being sent back to me through my redirect_uri seems to be too short? In the developers' guide the example auth code looks like this: f10072fa6-2134-4fe1-93fd-ca5b9cffa738 where in my case, I just receive the first part up until the first dash sign. Eg.:f10072fa6

            At first I ran the connection through a NetScaler, then I changed to using a Nginx Reverse Proxy thinking that the Netscaler might have truncated the URL (for some very odd reason), but the result turned out the same..

            Ideas anyone?

            ...

            ANSWER

            Answered 2020-Sep-22 at 14:04

            The Authorization code you received is correct. The Authorization code format was recently changed and the documentation needs to be updated to reflect this. This question was also answered in Authorization code has different structure than example code.

            Thanks! -Mark

            Source https://stackoverflow.com/questions/63999432

            QUESTION

            Where can I find the SONOS Cloud Queue server sample the docs are talking about?
            Asked 2020-Oct-28 at 12:00

            I'm trying to get started with SONOS programmed radio feature, but I can't seem to find their Cloud Queue server sample referenced in the docs. Namely, the docs (this link) says the following:

            A cloud queue to serve the list of tracks to Sonos players. See our cloud queue sample server for a sample implementation and Play audio for details about cloud queues.

            with cloud queue sample server receiving 403 File Not Found

            I noticed the same thing happens in the case of another sample code of theirs, also referenced in the docs (this link) here:

            For example, we handle this on our Android cloud queue sample app by moving music playback to the local device so that it continues playing on the local device and stops playing on Sonos.

            with Android cloud queue sample app receiving same HTTP error.

            How can I access this needed samples?

            Thank you in advance

            ...

            ANSWER

            Answered 2020-Oct-28 at 12:00

            Just received this email from developer-feedback@sonos.com

            Hello,

            You should find the links to these samples restored. Let us know if you encounter further issues. Disclaimer: we are not actively maintaining these samples and they are provided as-is.

            Best, Sonos Sound Platform Team

            I verified the links and they're working

            Source https://stackoverflow.com/questions/63881409

            QUESTION

            How to get count or records returned from json_agg() query?
            Asked 2020-Aug-29 at 16:05

            I am dynamically building up some queries that look like this

            ...

            ANSWER

            Answered 2020-Aug-29 at 15:23

            Use json_array_length as your final out put is in JSON Array format.

            Source https://stackoverflow.com/questions/63647815

            QUESTION

            Does the Sonos Port support UPnP?
            Asked 2020-Aug-02 at 14:31

            I'm looking at my options to control the Sonos Port at https://developer.sonos.com/reference/. I read about some UPnP control of other Sonos devices, but I can't seem to find any official information about this online. Is UPnP control of the Sonos Port possible?

            ...

            ANSWER

            Answered 2020-Jul-02 at 02:01

            Sonos uses UPnP for some calls internally, but we never publicly supported this protocol. We encourage you to use the Control API to control Sonos devices. See Connected Home: Get Started for details. Let us know if you see anything missing that you'd like us to add.

            Source https://stackoverflow.com/questions/62680711

            QUESTION

            Sonos Control Api: Get sonos account information
            Asked 2020-Jul-28 at 13:33

            I am integrating Sonos using Control API.

            In the login phase, the user writes username and password in the Sonos login page and authorizes the integration. After that Sonos returns an authorization code back to my integration to use for calling api.

            I would like to display the username in my application. How can you get it?

            ...

            ANSWER

            Answered 2020-Jul-28 at 13:33

            Unfortunately, there aren't any publicly-available APIs for getting the user information you are looking for. Given the sensitivity of any type of user information, we don't have any plans to expose APIs for getting this information in the near future.

            The closest thing to a user unique identifier would be a householdId. This is documented here: https://developer.sonos.com/reference/control-api/households/.

            Thanks,

            -Mark

            Source https://stackoverflow.com/questions/63133754

            QUESTION

            Authorization code has different structure than example code
            Asked 2020-Jul-22 at 06:51

            So I'm trying to build a application following the Sonos documentation, which can control my Sonos speaker. Sending a GET request to get a authorization code works just fine, with the exception that my code looks like this "qNvyst9Y" while the example response shows following code "f10072fa6-2134-4fe1-93fd-ca5b9cffa738". So the format of my code is not the same as the example code's format.

            Am I missing something or why is this?

            ...

            ANSWER

            Answered 2020-Jul-21 at 19:56

            I can confirm that the Authorization Code you received is valid. We recently changed the format, so will update the documentation to reflect this change.

            Thank you for calling this out!

            Source https://stackoverflow.com/questions/63014590

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sonos

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/gotwalt/sonos.git

          • CLI

            gh repo clone gotwalt/sonos

          • sshUrl

            git@github.com:gotwalt/sonos.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Audio Utils Libraries

            howler.js

            by goldfire

            fingerprintjs

            by fingerprintjs

            Tone.js

            by Tonejs

            AudioKit

            by AudioKit

            sonic-pi

            by sonic-pi-net

            Try Top Libraries by gotwalt

            ghosty

            by gotwaltRuby

            redlink

            by gotwaltRuby

            dwollotron

            by gotwaltRuby

            instant_sinatra

            by gotwaltRuby

            everdrone

            by gotwaltJavaScript