我们正在使用NodeJS通过Google Speech-to-Text API处理较长的成绩单。许多功能需要10分钟以上的时间来处理。处理/音频时间的通常比例约为50%。因此,一个20分钟的FLAC音频文件需要大约10分钟的处理时间(因此,在Google Cloud Functions上失败,最大时间为540秒或9分钟),而超过29分钟的任何时间在AWS Lambda上都会失败。
每个平台上有哪些服务可以在20/30分钟内处理音频文件,还可以发送事件数据并调用应用程序?我可以混合使用云功能和其他平台来处理成绩单吗?
javascript amazon-web-services google-cloud-platform aws-lambda google-cloud-functions
我正在尝试使用 Azure Text to Speech 创建 MP3 文件。节点文件运行,但没有创建或输出任何内容。Node.js 文档文件和示例不太好
https://github.com/Azure-Samples/Cognitive-Speech-TTS
const sdk = require("microsoft-cognitiveservices-speech-sdk");
var subscriptionKey = "809-myazureapikey";
var serviceRegion = "westeurope"; // e.g., "westus"
function synthesizeSpeech() {
const speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);
const audioConfig = AudioConfig.fromAudioFileOutput("speech.mp3");
const synthesizer = new SpeechSynthesizer(speechConfig, audioConfig);F
synthesizer.speakTextAsync(
"A simple test to write to a file.",
result => {
if (result) {
console.log(JSON.stringify(result));
}
synthesizer.close();
},
error => {
console.log(error);
synthesizer.close();
});
};
Run Code Online (Sandbox Code Playgroud)
是否需要声明并使用 fs 服务来写入文件?
这是一个 Bing Speech 示例,与 Azure 服务和示例不同
https://github.com/palmerabollo/bingspeech-api-client/blob/master/examples/index.js
我目前在 Google Sheet 上使用 Google Apps Script,它将单个行数据发送到 AWS API Gateway 以生成屏幕截图。目前,多个单个 JSON 负载请求导致一些 Lambda 函数失败。所以我想对行数据进行批处理,然后作为单个有效负载发送,这样单个 AWS Lambda 函数就可以执行并完成多个屏幕截图。
在迭代下面代码中每一行的数据后,如何对 JSON 有效负载进行批处理?
function S3payload () {
var PAYLOAD_SENT = "S3 SCREENSHOT DATA SENT";
var sheet = SpreadsheetApp.getActiveSheet(); // Use data from the active sheet
// Add temporary column header for Payload Status new column entries
sheet.getRange('E1').activate();
sheet.getCurrentCell().setValue('payload status');
var startRow = 2; // First row of data to process
var numRows = sheet.getLastRow() - 1; // Number of rows to process …Run Code Online (Sandbox Code Playgroud) javascript ×3
aws-lambda ×2
amazon-s3 ×1
azure ×1
dns ×1
json ×1
namecheap ×1
node.js ×1
web-hosting ×1