5

Recently Google released a new "Read it" function of Google Assistant.

How can I try it with Python? I enabled Google Assistant API in console and created service account credentials. The documentation does not provide any Python implementation.

I'd like to run a simple "Hello world" example: send a text and get a wav file.

F. Vosnim
  • 476
  • 2
  • 8
  • 23
  • Why don't you scrape the web, and then use something like `pyttsx` to read it? – xilpex May 05 '20 at 18:36
  • I know many ways for text-to-speech. I'd like to know how to use this function. – F. Vosnim May 06 '20 at 09:11
  • Explain what you don't like about my question. – F. Vosnim May 06 '20 at 13:58
  • 1
    No, no-- you got me wrong! This is a good question (I didn't downvote!). I just wanted to see what you had already done (and what you were ok with doing). – xilpex May 06 '20 at 16:45
  • I never tried it. But at the moment I am using with gTTS module, it works fine! you can use it with requests library to make what you're looking for – Giuppox May 12 '20 at 09:04

2 Answers2

5

Google uses the term "Assistant" somewhat loosely, and a feature being available on the Assistant for one platform isn't always available on others, even if there is no obvious reason for it not to be.

Reading long-form audio may seem to make sense to be available on all audio Assistant platforms - but it isn't. At least as of this writing, it seems to only be available on Assistant for Android platforms. This suggests that it is a feature of that implementation specifically, and not a full Assistant feature.

Also note that the Assistant SDK is officially listed for hobbyist use only. Production hardware with the Assistant seems to use a different development platform that handles other features including streaming audio.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Thanks. Can you suggest how to test this feature on Android? – F. Vosnim May 12 '20 at 20:43
  • Thank you for the bounty. "Test" in what way? I don't believe developers have access to it on the Android side, but website developers do have some limited control about how the Assistant will read it. What are you looking to try? – Prisoner May 12 '20 at 20:52
  • I'm looking for any way of running "Read it" programmatically: send a text and get the audio. There is an official Kotlin [implementation](https://developers.google.com/assistant/app/read-it#kotlin) for Android, so it is available for Android. I think I can run it with [AndroidViewClient](https://pypi.org/project/androidviewclient/). But I'm not very familiar with android development. – F. Vosnim May 12 '20 at 21:07
0

It is an interesting question!

I am not sure if I help you completely, but I found this Google Assistant Service documentation.

According to the documentation, "The Google Assistant Service gives you full control over the integration with the Assistant by providing a streaming endpoint. Stream a user audio query to this endpoint to receive a Google Assistant audio response."

What I understand: you can bind to the API via gRPC call using python language to call Google Assistant API. The documentation gives a step by step about the integration.

I hope this could help you.

  • I suppose Assistant SDK does not allow to run "Read it". If you managed to run it please share the code. – F. Vosnim May 09 '20 at 07:37
  • Yeah, I think you're right. This SDK hasn't support "Read it" yet. I just tried this https://github.com/googlesamples/assistant-sdk-python/tree/master/google-assistant-sdk/googlesamples/assistant/grpc – David Setyanugraha May 09 '20 at 09:25