简体   繁体   English

谷歌首页从网站上阅读

[英]google home reading from website

I'm currently working on a project where my main focus is to create an Action for Google Home which can be invoked and asked to read out some articles (chosen previously from a list, also by voice) from a particular website. 我目前正在从事一个项目,该项目的主要重点是为Google Home创建一个Action,可以调用该Action,并要求它从特定网站读出一些文章(以前是从列表中选择的,也可以通过语音选择)。 I was wondering if it was possible, or if it were already some similar projects. 我想知道是否有可能,或者已经是一些类似的项目。

What I'd like to do is something like the feature in Pocket or instapaper, where you can make the device read the article for you. 我想要做的是类似Pocket或instapaper中的功能,您可以在其中使设备为您阅读文章。

I also thought to make something like a database with all the articles I'm interested in, which auto-updates itself whenever a new article is posted, but my main concern now is to be able to separate the articles in various lists, parse the article and in the end implement text to speech into the Action. 我还考虑过用我感兴趣的所有文章制作类似数据库的文章,每当发布新文章时它都会自动更新,但是我现在主要关心的是能够将文章分成多个列表,解析文章,最后将文字转换为语音。

Also some implementations with 3rd party services and apps would be useful. 同样,使用第三方服务和应用程序的某些实现也将很有用。

Please ask me if anything isn't exactly clear, english is not my first language. 请问我是否不清楚,英语不是我的母语。

Yes, this is possible. 是的,这是可能的。 Not necessarily easy, but possible. 不一定容易,但可能。

First - there is nothing in the Actions on Google library or in Google Home that will automatically scrape a website. 首先-Google图书馆或Google Home中的操作中没有任何内容会自动抓取网站。 That will be up to you. 这将取决于您。

Second - Responses from your Action are limited in how much they can send at a time. 其次-您的“操作”响应一次只能发送多少。

If you're having it do text-to-speech , you're limited to two "text bubbles" of 640 characters each before the user has to reply. 如果您要进行文本语音转换 ,则在用户必须答复之前,您只能使用两个640个字符的“文本气泡”。 You should keep well below that and should probably stick to just one "text bubble". 您应该保持低于此水平,并且可能只应坚持一个“文本泡泡”。

If you're playing an audio cut , then you're limited to two minutes. 如果您正在播放音频剪辑 ,则仅限于两分钟。

You can work around both of these limitations by using the Media Response . 您可以使用Media Response来解决这两个限制。 With TTS, you would play a portion of the text, a brief Media response, at the conclusion of which, your server would be triggered to send the next chunk of text. 使用TTS,您将播放文本的一部分,即简短的Media响应,在响应结束时,将触发您的服务器发送下一段文本。 If it is all recorded, you can just send the longer audio as the Media. 如果已全部录制,则可以将较长的音频作为媒体发送。

Be advised, however, that if you're using the inline editor or using Firebase Cloud Functions (which the inline editor uses), that by default you're not able to access most sites outside Google's network. 但是请注意,如果您使用的是内联编辑器或Firebase Cloud Functions(内联编辑器使用的),则默认情况下您将无法访问Google网络之外的大多数网站。 You need to upgrade to a paid plan to do so. 您需要升级到付费计划 I suggest the Blaze plan which is pay-as-you-go, but includes a free tier which is typically good enough for development work and light production usage. 我建议使用Blaze计划,即按需付费,但其中包括免费套餐,通常足以满足开发工作和轻量产品的使用需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM