简体   繁体   English

使用node.js谷歌云语音文本,如何获取当前工作的状态?

[英]Using the node.js google cloud speech to text, how can I get the status of a current job?

I managed to trigger a job with: 我设法触发了一项工作:

        const config = {
            languageCode: 'en-US',
            enableSpeakerDiarization: true,
            audioChannelCount: 2,
            enableSeparateRecognitionPerChannel: true,
            useEnhanced: true,
            profanityFilter: false,
            enableAutomaticPunctuation: true,
        };

        const audio = {
            uri: `gs://${filePath}`
        }

        const requestObj = {
            config: config,
            audio: audio
        }
        return speechClient.longRunningRecognize(requestObj)

I get back an object with a name . 我取回一个带有name的对象。 I want to use that with https://cloud.google.com/speech-to-text/docs/reference/rest/v1/LongRunningRecognizeMetadata (via the node.js package) to get the current status. 我想将其与https://cloud.google.com/speech-to-text/docs/reference/rest/v1/LongRunningRecognizeMetadata一起使用(通过node.js包)以获取当前状态。

How do I do it? 我该怎么做?

return speechClient.longrunning.Operation()

Seems not to exist 似乎不存在

Looks like you can do it with: 看来您可以使用:

                return speechClient.operationsClient.getOperation({ name: googleName })

This is not super well documented 这没有很好的记录

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

相关问题 如何使用 node.js 获得文本应用程序的演讲? - How can I get a speech to text app working with node.js? Node.js中的Google Cloud语音到文本api编码问题 - Google Cloud Speech-to-Text api encoding issues in Node.js 我如何使用node.js函数检查我的VM实例在google-cloud中使用了多少CPU和内存 - How can I check how many CPUs and memory my vm instance uses in google-cloud using node.js function 如何使用Node.js从Google Calendar API获取当前年份的所有假期? - How to get all the current year holidays from google calendar API using Node.js? 如何在Node.js中的多个文件中获取变量的当前值? - How can I get the current value of a variable in multiple files in Node.js? 如何使文本到语音队列 Node.js - How to make Text to speech queue Node.js 如何在 node.js 中使用 Watson text-to-speech api? - How to use Watson text-to-speech api in node.js? 如何在字符串中通过data属性获取元素并在node.js应用程序中获取内部文本? - How can I Get element by data attribute in string and get the inner text in a node.js application? 如何从适用于Node.js的Google Calendar API获取承载值 - How Can I Get Bearer Value from Google Calendar API for Node.js 如何将Google Chrome用作node.js服务器? - How can I use Google Chrome as a node.js server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM