Coder Social home page Coder Social logo

Comments (4)

Thyraz avatar Thyraz commented on May 29, 2024

Ich würde das durchaus auch gerne unterstützen. Bei Hörbüchern nicht so wichtig, bei Musikalben hingegen schon was Feines.

Aber das Ganze ist an sich ja nur ein grafisches Frontend für node-sonos-http-api.
Und hier scheint es nicht so einfach zu tracken zu sein ob man überhaupt noch das gestartete Album hört oder nicht.

Die Lieder zum Album könnte ich aus der Spotify API ziehen, aber ob ich das dann irgendwie mit dem Status von node-sonos-http-api in Verbindung bringen kann?

Steht schon irgendwo auf meiner Liste wünschenswerter neuer Features, allerdings bin ich noch nicht so optimistisch, dass sich das mit den gewählten Softwarekomponenten umsetzen lässt...

from sonos-kids-controller.

stepman0 avatar stepman0 commented on May 29, 2024

Die node-sonos-http-api scheint die notwendigen Informationen zum aktuellen Zustand des Sonos zu enthalten

Hier die Antwort auf roomname/state:

{
	"volume": 65,
	"mute": false,
	"equalizer": {
		"bass": 0,
		"treble": 0,
		"loudness": true
	},
	"currentTrack": {
		"artist": "Karsten Glück",
		"title": "Im All",
		"album": "Die 20 wichtigsten Wissenslieder für Kinder",
		"albumArtUri": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a0yCwDVuh0FrBmpmcnMhAaw%3fsid%3d9%26flags%3d8224%26sn%3d5",
		"duration": 202,
		"uri": "x-sonos-spotify:spotify%3atrack%3a0yCwDVuh0FrBmpmcnMhAaw?sid=9&flags=8224&sn=5",
		"trackUri": "x-sonos-spotify:spotify%3atrack%3a0yCwDVuh0FrBmpmcnMhAaw?sid=9&flags=8224&sn=5",
		"type": "track",
		"stationName": "",
		"absoluteAlbumArtUri": "http://192.168.188.21:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a0yCwDVuh0FrBmpmcnMhAaw%3fsid%3d9%26flags%3d8224%26sn%3d5"
	},
	"nextTrack": {
		"artist": "Karsten Glück",
		"title": "Die Dinos",
		"album": "Die 20 wichtigsten Wissenslieder für Kinder",
		"albumArtUri": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a5mAhOrZKMZzitwv0OOfrim%3fsid%3d9%26flags%3d8224%26sn%3d5",
		"duration": 161,
		"uri": "x-sonos-spotify:spotify%3atrack%3a5mAhOrZKMZzitwv0OOfrim?sid=9&flags=8224&sn=5",
		"trackUri": "x-sonos-spotify:spotify%3atrack%3a5mAhOrZKMZzitwv0OOfrim?sid=9&flags=8224&sn=5",
		"absoluteAlbumArtUri": "http://192.168.188.21:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a5mAhOrZKMZzitwv0OOfrim%3fsid%3d9%26flags%3d8224%26sn%3d5"
	},
	"trackNo": 6,
	"elapsedTime": 76,
	"elapsedTimeFormatted": "00:01:16",
	"playbackState": "PAUSED_PLAYBACK",
	"playMode": {
		"repeat": "none",
		"shuffle": false,
		"crossfade": false
	}
}

Unter CurrentTrack gibt es artist, title, album sowie die duration.

Ganz unten dann noch die elapsedTime.

from sonos-kids-controller.

Thyraz avatar Thyraz commented on May 29, 2024

Das hab ich mir auch schon angeschaut. Das ist aber ja nur die Info zum Track.
Vom Album ist nur ein Name, aber keine eindeutige ID vorhanden, oder?

Intern nutzt die Software bei Spotify ja die UniqueID für das Album.
Das müsste man irgendwie in Zusammenhang bekommen.

Wenn man das Album hat, dürfte trackNo immerhin die Info liefern, das wievielte Lied/Kapitel gerade läuft.

Ebenfalls schön wäre ja, wenn ein Album z.B. übers Handy (oder bei z.B. Sonos One mit Alexa) gestartet wird,
die Box auch auf das Album umspringt.

Ich fürchte nur, dass man sich da ziemlich tief in die Spotify API reinknien muss.
Da will ja einiges an Infos abgerufen und lokal vorgehalten werden um solche Suchtreffer zu erlauben (sofern möglich).
Könnte gut sein, dass das komplexer ist als als der gesamte bisherige Code.

Wenn ich das meiner knappen Freitzeit fürs Coden gegenüberstelle, sind die Kids ausgezogen und brauchen den Spass nicht mehr bis ich fertig bin. 😬

from sonos-kids-controller.

HeikoGr avatar HeikoGr commented on May 29, 2024

from sonos-kids-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.