How To Play Specified Google Play Music Resources (Albums) via Sonos API - sonos

I have ~300 vinyl records which I want to attach RFID tags to so I can place one on an RFID reader and trigger playback of the album on my home Sonos (using Google Play Music).
Is there a way to load a specified resource from a service into a group? I was able to follow through the Postman tutorial, and was maybe thinking that I could set up each album as a Sonos Favorite and load that, but I'm looking around and see that there is a (very low) limit on how many favorites you can have, so this doesn't seem like a workable solution anymore. I've been digging around the APIs and can't quite find what I'm looking for in the Control API.
Ideally I'd have each RFID tag contain something along the lines of artist name, album name, and some Google-Play-Music-specific album ID, which I can use to load the album into a fixed Sonos Group queue. If there's a better approach, however, I'm also all ears.

The Sonos API doesn't offer a way to load and play content from another service (other than commands in the favorites namespace) unless that service provides an interface to get the Sonos IDs without authentication. An alternative is to host your own files and build a SMAPI server or use a mediaUrl to your audio file in the track.
See the SMAPI sample server and Tracks in the cloud queue in Play audio (cloud queue) for details.

Related

Sonos Cloud API Queues

I want to develop a Sonos Controller that is capable of:
Playing a playlist or album now, or next (after currently playing song) or by appending it to the end of the queue.
However I can't see a way to control how the playlist is added to a queue. The documentation at https://developer.sonos.com/reference/control-api/playlists/loadplaylist/ doesn't suggest that it is possible,but there is a reference to the queue in the description for the shuffle playmode "Play the tracks in the queue in a randomly shuffled order."
There is documentation for "Cloud Queues" but this seems to be targeted at Music Services.
Is it possible to create a Cloud Queue that just holds references to tracks in other services?
Not that I would really want to implement that, I would rather just access the queue that is on the players.
The Sonos Control API does not currently allow for direct access to the player queue. Third party integrations can get content on to the queue via the playlists and favorites namespaces, but they can't touch the queue directly.
As you noted, the Cloud Queue API is intended for Content Partners. It is not directly possible to reference third party content in personal CQs, there are authentication issues involved.
This squares with my user experience of the Sonos queue being very basic and unintelligent. There have been a number of times I've been forced to clear the queue and start over, rather than being able to reorder items, etc. FWIW, the closest thing I've seen in their documentation to what it sounds like you're looking for, is under a different API. Sonos Music API > reorderContainer as documented here: https://developer.sonos.com/reference/sonos-music-api/reordercontainer/
I don't see any similar functionality documented in the Sonos Cloud Queue API. With regard to random order, I believe that's on playback, not anything that modifies the queue.

Using pre-recorded audio instead of text-to-speech along with Watson Conversation bot

I built a conversation bot with text-to-speech, but no matter how well I tune it, the voice sounds robotic.
I think it would be simpler to have the conversation bot pick a pre-recorded audio and stream it back to the user.
Does anyone see issues with this?
Is there already an example of this so I don't reinvent the wheel?
This functionality needs to be implemented on the client side of the application. Watson Conversation Service can return a text answer and for example an index of the audio record you want to play.
This index then needs to be picked up by the client application communicating with Watson Conversation Service (e.g. a web page in node.js) and the audio record can be played to the user.
As for some examples...in Conversation Service docs there are links to github projects that integrate Watson Conversation Service with node.js web applications - these can be extended by adding the audio records and functionality that will play those records to the user.

Create a custom desktop YouTube player

I want to create an application capable to play YouTube video's audios and also save the downloaded content in a local cache, therefore when the user decides to resume or play the video again, then it doesn't have to download part of video again but only download the remaining part (User can decide what to do with the cache then, and how to organize it).
It is also very convenient for mobiles (it is my main focus) but I'd like to create a desktop one too for experimental purposes.
So, my question itself is, does YouTube provide any API for this? I mean, in order to cache the download content I need that my application download the content and not any embed player (also remember that it is a native application). I have a third-party application in my Android system that plays YouTube videos, so I think it's possible unless that the developers use some sort of hack, again this is what I don't know.
Don't confuse with the web gdata info API and the embed API, this is not what I want, what I want is to handle the video transfer.
As far as I know, there is no official API for that. However, you could use libquvi to look up the URLs of the real video data, or you could have a look at how they do it and reimplement it yourself (see here).

Youtube api uploading video to website channel

Im making a website with user-generated content (pictures/videos) and I want to host videos that users upload to youtube on my channel, is there any way I can do this via youtube api?
What are the best practices for such thing?
Thanks!
The best practice is not to allow uploads directly to your channel, but rather to upload them to an intermediary server where you have a tool that allows you to check the content for abuse before it programmatically uploads the video. This prevents abuse and keeps you using reasonable quota caps.
Another good idea is to allow users to upload to their own channels and, via your app, to use the playlist API to automatically add their videos to your playlist.

Streaming music on your website through custom player / application (iTunes)

I was doing some research to find out ways that would allow me to stream music on my website legally. I came across iTunes partner program which allows to stream music on a website through their embedded players. I was wondering is it possible to stream iTunes music through your own custom player? If that is not possible via iTunes, then what other methods are available?
You could do this with a server software like Icecast, there is some good tutorials on setting this up here: http://www.icecast.org/docs.php
Depending on how many browsers you want to support you might want to setup two streams, one in MP3/OGG and a "backup" stream in Flash. Then add some detection as to what the browser supports and present the correct stream (i.e.: Use the HTML5 <audio> tag for playing MP3/OGG to browsers that support this, and use your flash stream for the rest)
their program allowing playback of music in the iTunes Store is likely only for those with the intention to sell music, without providing a commerce business, you'd be breaking their partner program T&C's.