简体   繁体   English

来自 google 官方文档的 Google Cloud Speech to Text NodeJs 在 Google Compute Engine Linux 服务器上不起作用

[英]Google Cloud Speech to Text NodeJs that from google official document does not work on Google Compute Engine Linux Server

I want to develop the speech-to-text conversion of streaming input application using google cloud speech API with Nodejs.我想使用带有 Nodejs 的谷歌云语音 API 开发流输入应用程序的语音到文本转换。 So I used the Google sample source and installed the SOX(version 14.4.1)recorder in my Window PC and running the Nodejs application in local is working well.因此,我使用 Google 示例源并在我的 Window PC 中安装了 SOX(版本 14.4.1)记录器,并且在本地运行 Nodejs 应用程序运行良好。 But when I uploaded my Nodejs applicaion on Google Compute Engine using Linux Server, the audio device of SOX doesn't work.但是当我使用 Linux 服务器在 Google Compute Engine 上上传我的 Nodejs 应用程序时,SOX 的音频设备无法正常工作。 The error is 【FAIL sox: missing filename】.错误是【FAIL sox: missing filename】。 How is the audio received from the client side?如何从客户端接收音频? Is there any way to solve above error in Linux?有什么办法可以解决 Linux 中的上述错误? app.js应用程序.js

error错误

It seems that GCE Linux VMs don't have soundcard support. GCE Linux 虚拟机似乎没有声卡支持。

To test this, assuming you're running an APT based distribution (Debian or Ubuntu), install alsa-utils with sudo apt-get install alsa-utils , and run sudo aplay -l .要对此进行测试,假设您正在运行基于 APT 的发行版(Debian 或 Ubuntu),请使用sudo apt-get install alsa-utils ,然后运行sudo aplay -l

The second command lists all soundcards and digital audio devices.第二个命令列出所有声卡和数字音频设备。 It should give you a result like:它应该给你这样的结果:

aplay: device_list:270: no soundcards found...

This means that even if you have SoX installed in your Linux GCE VM, you won't be able to use the speech-to-text conversion of streaming input application (for example this or this ).这意味着即使您在 Linux GCE VM 中安装了 SoX,您也无法使用流输入应用程序的语音到文本转换(例如thisthis )。

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

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