Is it possible that after doing processing, I can turn a certain text result to speech using the SDK. Or say turn an alarm or warning message to speech eg. "You have left the gas on" .etc.
-
Can you elaborate on exactly what you're trying to do, and what the design scenarios are? Your question is pretty broad, and there are a number of different answers depending on what you're really trying to do. – Prisoner Jul 03 '17 at 16:36
-
Like if the smoke detectors have detected a fire and rally that info to my Raspberry. Can I turn a pre-defined text "Fire alarm!" stored in memory, to speech using the SDK and maybe play an alarm audio along with it? – Xavier Gonsalves Jul 04 '17 at 06:10
2 Answers
It sounds like you're looking for something that will do text-to-speech (TTS) generation.
While TTS is a component of the Assistant SDK, it is designed to do much more than this. The Assistant SDK also does speech-to-text (STT) to parse what the person is saying and provides a way to access the Google Assistant and Actions through this interface. So while it would be useful to help build a smoke detector that could also provide information about fire prevention if you ask it - it really isn't good at just providing audio output.
You have two options:
You can pre-record the audio. You've already suggested you want to do this for other sounds, so this is a logical next step. This is probably most reasonable for a safety system, since it would require minimal network interaction and won't have any latency.
You can use a Cloud API that is dedicated to TTS generation, such as Amazon Polly
Update To be more clear:
The Assistant SDK is meant to provide access to the Google Assistant. STT and TTS are side-effects and there is no direct access to these components in the current release (Developer Preview 1).
Right now, you must send all commands to the SDK via audio. There is no way to send a text command. So while in theory you can create an Action that receives a command and says something in reply - the command you send must be an audio stream. Since it makes more sense to just record the audio you want to play out in the first place, this isn't very useful in your application.
In the future, it might be possible to send text commands and get audio reply, and if/when such a thing exists, it is more feasible to cobble together a TTS system using the Assistant SDK and an Action. But this would be a pretty hackish way to do it.
There also doesn't appear to be a way to do TTS through other Google Cloud APIs (although there are web and Android libraries to do so - these don't really help you on your smoke detector). It looks like there used to be a way to use Google Translate to do this, but that feature seems to have been removed.

- 49,922
- 7
- 53
- 105
-
I know about Polly. But I was searching for a way to do it using Google Assistant SDK. I also know about STT. But, how can I do TTS on Google Assistant? Any weblink? – Xavier Gonsalves Jul 05 '17 at 13:15
-
Updated to provide some more clarification about the Google Assistant TTS. – Prisoner Jul 06 '17 at 13:21
-
Can you share the links for ".... there are web and Android libraries"? I can check if they are of any use to me. – Xavier Gonsalves Jul 09 '17 at 06:49
Not sure how much this will help, but you may want to look at the IfTTT (If This Than That) app.
I know they have a bunch of pre-made applets you can use that run on the Google Assistant API, and you can make your own too! If you have a nest fire alarm, for example, you can have the assistant and the alarm talk to one another.
On my Google Assistant Raspberry Pi, I can instruct it to change the temperature on the thermostat, for example. I can also set it up to give custom (often humerus), replies to specific commands. I know you can give it commands, and it will give back a custom TTS response. But I'm not sure you can make it read your devices and give an automatic response yet (E.g., If the Nest Alarm detects fire, Then send the message "FIRE! Get out!" to assistant). Pretty sure it's one way at the moment. Hope this helped and Cheers!

- 13
- 1
- 5