I just got my first Sonos Play 1 over the weekend and was able to quickly setup the TTS function within Scenes. I was wondering if it is possible to play a Chime prior to the TTS playing? Thought it might be less of a shock if occupants were alerted with a chime of sorts prior to a voice playing from the Sonos.
I wouldn’t mind this either. One time my mother was watching my kids and remarked to me later that the Sonos scared the hell out of her because she was walking by it right when it spoke a message.
We tend to forget that not everyone is familiar with our unique homes.
I take it that there’s still isn’t a response on how to insert a chime prior to announcement (TTS)? Would be nice to have a sample code and any neat chime file, surely someone out there has done this already any help/guidance would be greatly appreciated. Mike
[glow=red,2,300]
Update II: [/glow]
I would assume that the snip it of code below should be the “ticket”, haven’t had a chance to test. Mike
Updated & Tested the code snipit and it works. Mike
-- Gong Sound with Speech Example annotation by Michael Blackwell
local AV_DEV = 308
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"
-- Gong Sound
luup.call_action (LS_SID, "PlayURI", {URIToPlay="x-file-cifs://192.168.0.101/Public/Vera_Media/Ship_Bell.mp3", GroupZones="Kitchen", SameVolumeForAll="true", Volume=60}, AV_DEV)
-- Speech
luup.call_action (LS_SID, "Say", {Text = string.format("There should be a chime followed by this speech test"), GroupZones="Kitchen", SameVolumeForAll="true", Volume=60}, AV_DEV)
[ul][li]AV_DEV is your Sono device number
[/li][li]http address is your device where your mp3 lives[/li][/ul]
I have the same target: to play a Chime prior to the TTS playing but without a NAS or a internet source. I’d like to upload to my VeraLite a small mp3 and play it as a Chine before my TTS playing. Any ideas? Thanks in advance.
@zagreo, you will need a internet source for the TTS portion as for placing a file on Vera shouldn’t be problem, you could SSH and place the file in directory and ensure that the address points to it (I personally haven’t tried that but should work). Mike
Yes you are right, the tts needs an internet link and it runs ok, but which is the best directory where to put the MP3 file in veralite and how to play it programmatically via Lua code?
I’m trying the following (after putting sonos.mp3 in /www directory of my Veralite):
local AV_DEV = 50
local LS_SID = “urn:micasaverde-com:serviceId:Sonos1”
local LS_DURATION = 7
local LS_VOLUME = 70
-
local LS_PATH = "x-file-cifs://<NAS PRIVATE IP>/public/sonos.mp3"
-
local LS_PATH = "x-file-cifs://<VERALITE PRIVATE IP>/sonos.mp3"
– Chime Sound
luup.call_action (LS_SID, “Alert”, {URI=LS_PATH , Duration=LS_DURATION , Volume=LS_VOLUME }, AV_DEV)
- parameter runs fine,
- parameter gives on SONOS this error:
‘unable to play “sonos.mp3” unable to connet to "///sonos.mp3.’
Any ideas?
[quote=“zagreo, post:7, topic:188057”]2) parameter gives on SONOS this error:
‘unable to play “sonos.mp3” unable to connet to "///sonos.mp3.’
Any ideas?[/quote]
I ran into the same issue using cifs on my setup. I was able to get it to work using Alert and PlayURI:
luup.call_action(LS_SID, “Alert”, {URI = “http://xxx.xxx.xxx.xxx/chime.mp3”, Duration=1, Volume=90}, Sonos)
luup.call_action(LS_SID, “PlayURI”, {URIToPlay=“http://xxx.xxx.xxx.xxx/blah.mp3”, Duration=7, Volume=90}, Sonos)
I follow your advice but now I get the error:
“unable to play sonos.mp3 - the track is not encoded corretly”. It seems that the file has been corrupted before SONOS can play it
For everyone interested in a chime playing here my solution:
local AV_DEV = 50
local LS_SID = “urn:micasaverde-com:serviceId:Sonos1”
local LS_DURATION = 7
local LS_VOLUME = 70
-
local LS_PATH = “x-file-cifs:///public/sonos.mp3” –
-
local LS_PATH = “http:///media/sonos.mp3” –
-
local LS_PATH = “x-rincon-mp3radio:///media/sonos.mp3” –
– Chime Sound
local result = luup.call_action (LS_SID, “Alert”, {URI=LS_PATH , Duration=LS_DURATION , Volume=LS_VOLUME }, AV_DEV) -
parameter runs on a SAMBA system
-
parameter runs on VERA(dir: /www/media/) only if mp3 file is uploaded with WinSCP, NOT to corrupt the file
-
parameter runs on VERA(dir: /www/media/) only if mp3 file is uploaded with WinSCP, NOT to corrupt the file
@zagreo,
many thanxs for the update, question what is the difference between 2) “direct” and 3) “mp3 radio” other than the obvious? MP3 radio is a new one for me, also were you successful in solving the issue whilst playing music and the interruption of playing the MP3 and/or TTS doesn’t allow your original music to resume. Mike
I think I’ve answered my own question based on @Zagreo example using the “Alert” instead of “URIToPlay” seems to work, just out of curiosity how does the delay value work? Mike
When the delay expires, the previous playback context is restored.