Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sonos TTS
An interesting read on implementing TTS on sonos.
Nest|Harmony|Neeo|LG TV|Smarthings|
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
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...
Nest|Harmony|Neeo|LG TV|Smarthings|
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--
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
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?

this is from wuench using a Connect with the LineIn:

/ 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)
// 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)

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
Got it, now to connect the dots...

we need a hangout on this.
Some of my devices: Sonos, Aeotec zWave, Nest, Rain8Net, Various H/T
What's next: CQC-Voice, Brultech GEM
My vlogs:
i can demo my setup, maybe next weekend?
do the needful ...
Hue | Sonos | Harmony | Elk M1G // Netatmo / Brultech

Possibly Related Threads…
Thread Author Replies Views Last Post
  New Sonos amp Dean Roddey 3 10,786 09-06-2018, 09:57 PM
Last Post: Dean Roddey
  Sonos going public? Dean Roddey 0 3,421 07-07-2018, 10:08 PM
Last Post: Dean Roddey
  Scheduling next webinar (Sonos/TTS) IVB 6 4,823 02-04-2018, 10:51 PM
Last Post: IVB
  Uverse and Sonos kblagron 5 4,945 01-20-2017, 11:29 AM
Last Post: Dean Roddey
  Lutron adds support for Alexa and Sonos ControlFreak 2 3,992 12-10-2016, 08:47 AM
Last Post: dgage
  Sonos opens its platform to Spotify Connect and Amazon's Alexa batwater 14 8,798 09-06-2016, 02:41 PM
Last Post: potts.mike
  CQC Media Repo - Sonos potts.mike 15 7,484 03-10-2016, 12:28 PM
Last Post: Dean Roddey
  Sonos Opinions zra 51 17,325 01-30-2016, 06:16 PM
Last Post: jkmonroe
  Question for Sonos Owners jkmonroe 23 13,701 09-27-2015, 11:11 AM
Last Post: kfly
  Sonos - How Are You Doing It? karenlee 32 15,507 08-05-2015, 02:07 AM
Last Post: finish.06

Forum Jump:

Users browsing this thread: 1 Guest(s)