Music partners can support the lyrics functionality using SMAPI. This feature is static and beneficial for users that want to look up song lyrics.
|
→ |
|
→ |
|
---|
Finding lyrics within the Sonos app
Song lyrics can be found in the app though the song’s Info View (…) > The lyrics page. The name of the The lyrics tab can be customized from the Now Playing screen or list in container.
Implementing lyrics
In order to set up lyrics for songs, you’ll require getExtendedMetadata
and getExtendedMetadataText
.
The SMAPI service must include the relatedText
element in the getExtendedMetadataResult
tag of the desired track.
The following is an example of a response you would send:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sonos.com/Services/1.1"> <SOAP-ENV:Body> <ns1:getExtendedMetadataResponse> <ns1:getExtendedMetadataResult> <ns1:mediaMetadata> <ns1:id>SONG:6FF4D69F</ns1:id> <ns1:itemType>track</ns1:itemType> <ns1:title>Blowing in the Wind</ns1:title> <ns1:mimeType>audio/flac</ns1:mimeType> <ns1:trackMetadata> <ns1:artistId>SINGER:29323</ns1:artistId> <ns1:artist>Bob Dylan</ns1:artist> <ns1:albumId>ALBUM:30ED9C15</ns1:albumId> <ns1:album>Blowing in the Wind</ns1:album> <ns1:duration>166</ns1:duration> <ns1:albumArtURI>http://example.com/images/aa/1.jpg</ns1:albumArtURI> <ns1:canPlay>true</ns1:canPlay> </ns1:trackMetadata> </ns1:mediaMetadata> <ns1:relatedText> <ns1:id>LYRICS:6FF4D69F</ns1:id> <ns1:type>The lyrics</ns1:type> </ns1:relatedText> </ns1:getExtendedMetadataResult> </ns1:getExtendedMetadataResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |
The value of type
within the relatedText
tag will be the name of the lyrics button in the Sonos app. You can customize the name of the button by changing the value within the type
tag.
When a user presses The lyrics button, the Sonos app sends the getExtendedMetadataText
call with the ID from the relatedText
tag from the last response to request more information.
The following is an example of a response you would send:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sonos.com/Services/1.1"> <SOAP-ENV:Body> <ns1:getExtendedMetadataTextResponse> <ns1:getExtendedMetadataTextResult>00:06 - How many roads must a man walk down 00:12 - Before you call him a man 00:17 - How many seas must a white dove sail 00:23 - Before she sleeps in the sand 00:29 - How many times must the cannon balls fly 00:35 - Before they're forever banned 00:40 - The answer, my friend, is blowing in the wind 00:46 - The answer is blowing in the wind 00:52 - How many years can a mountain exist 00:58 - Before it is washed to the sea 01:04 - How many years can some people exist 01:09 - Before they're allowed to be free 01:15 - How many times can a man turn his head 01:20 - And pretend that he just doesn't see 01:26 - The answer, my friend, is blowing in the wind 01:32 - The answer is blowing in the wind 01:38 - How many times must a man look up 01:43 - Before he really see the sky 01:49 - How many ears must one person have 01:54 - Before he can hear people cry 02:00 - How many deaths will it take 02:06 - Till he knows that too many people have died 02:12 - The answer, my friend, is blowing in the wind 02:17 - The answer is blowing in the wind 02:23 - The answer, my friend, is blowing in the wind 02:29 - The answer is blowing in the wind </ns1:getExtendedMetadataTextResult> </ns1:getExtendedMetadataTextResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |