Posts: 2,407
Threads: 244
Joined: Oct 2007
|Z-Wave|Sonos|Tivo|Hue|Plex|Roku|MyMovies|Echo|
Nest|Harmony|Neeo|LG TV|Smarthings|
Posts: 40,483
Threads: 491
Joined: Aug 2002
We could do it easier than that really. We already have the ability to turn test into a playable WAV file. Our Speech II TTS driver uses that scheme. It just plays it via a local audio output.
It wouldn't be too difficult (for me) to create a driver that accepts text and drops it into a WAV of a given name in some target directory.
Though, given that the existing TTS driver can output to an audio output, and the Sonos has an audio input, and I think that the audio sent to the input of any Sonos can be sent to the others (right?), all you'd really need is one Sonos close enough to the server to connect to its audio inputs and you'd be done.
That's the theory anyway.
Dean Roddey
Explorans limites defectum
Posts: 2,407
Threads: 244
Joined: Oct 2007
The audio input is only on the connect and connect amp, the play series doesn't have it. whether it's done with switching inputs or a wav file the key would be handling the pausing, playing and unpausing aspect, caching files to be called later etc...
|Z-Wave|Sonos|Tivo|Hue|Plex|Roku|MyMovies|Echo|
Nest|Harmony|Neeo|LG TV|Smarthings|
Posts: 719
Threads: 64
Joined: Jan 2013
Careful with this, the Google Text To Speech service now has captcha. I used to use it. I haven't had TTS for about 6 months because google kicked everyone out.
It would be nice if CQC could convert TTS to WAV/MP3. My CQC server doesnt support audio.
--Kill all the serial ports--
Posts: 3,716
Threads: 196
Joined: Aug 2006
11-26-2015, 08:49 AM
(This post was last modified: 11-26-2015, 09:18 AM by jkmonroe.)
i just used some free utilities.
VBCableDriver - creates loopback audio driver
edcast - stream creator thingy
lame - mp3 encoder
icecast - streaming server
all that I do is create a continuous live stream using those tools, then add a favorite streaming station in sonos with that URL.
for TTS announcements, switch to the favorite station, it plays the announcement, and can switch back.
total delay is maybe 2 or 3 seconds.
easy, free, works.
edit: the tools to do this are all on my FTP site, so if someone wants to give it a go PM me for access.
edit 2: in the Sonos controller, Manage -> Add Radio Station / provide localhost URL and name. it shows up under Radio by TuneIn -> My Radio Stations. add it to Sonos Favorites from there.
do the needful ...
Hue | Sonos | Harmony | Elk M1G // Netatmo / Brultech
Posts: 2,339
Threads: 104
Joined: Apr 2009
This is very interesting can you provide a basic flow of how this all fits together?
Do you have the wave file looping and broadcasting all the time or do you drop one in depending on the situation?
-Ben
Posts: 3,716
Threads: 196
Joined: Aug 2006
11-28-2015, 12:40 PM
(This post was last modified: 11-28-2015, 12:43 PM by jkmonroe.)
this is from wuench using a Connect with the LineIn:
Code: / Check if Source is LineIn
If Not System::Equals($(Sonos-Upstairs.CurTrackURI), x-rincon-stream:RINCON_xxxxx, Case)
// Save Off Current URI
LocalVars::SetVariable(LVar:TrackURI, $(Sonos-Upstairs.CurTrackURI))
// Switch to Line In
Devices::FieldWrite(Sonos-Upstairs.InvokeCmd, SetTransURI:"x-rincon-stream:..., False)
Devices::FieldWrite(Sonos-Upstairs.Transport, Play, True)
End
// Speak text passed as argument 1
Devices::FieldWrite(Speech.SayText, %(LVar:CQCActParm_1), False)
Devices::WaitFieldValue(Speech.SpeechActive, False, Equal, 30000)
If LocalVars::Exists(LVar:TrackURI)
// Switch Input Back to Original URI
Devices::FieldWrite(Sonos-Upstairs.InvokeCmd, SetTransURI:"%(LVar:TrackURI)..., False)
Devices::FieldWrite(Sonos-Upstairs.Transport, Play, True)
End
for the stream, you can grab your TTS stream URI by manually starting it and grabbing the information from the driver to use where applicable. to start the stream, you can use the new PlayFavorite command, so InvokeCmd PlayFavorite:TTS or whatever youve named your favorite.
but instead of playing mp3/wav files, just write to the SayText field for the TTS driver. make sure to account for the delay if you use the stream.
do the needful ...
Hue | Sonos | Harmony | Elk M1G // Netatmo / Brultech
Posts: 2,339
Threads: 104
Joined: Apr 2009
Got it, now to connect the dots...
Thanks!
Posts: 7,970
Threads: 554
Joined: Mar 2005
we need a hangout on this.
Posts: 3,716
Threads: 196
Joined: Aug 2006
i can demo my setup, maybe next weekend?
do the needful ...
Hue | Sonos | Harmony | Elk M1G // Netatmo / Brultech
|