As it says in the title, I can't get the s2t API to work with gcs.
When working with local <1m files, it works well, but when I provide it a gcs link (be it of the same short file or a longer one) I get bad results. I either get nothing, or just a very small portion of the file transcribed (~5 words out of a 2 minute speech).
Is there some gotcha that I'm not aware of, or is it a known bug that I just couldn't find on the internet? Here is the code used (google's own example in js):
const speech = require('@google-cloud/speech');
const client = new speech.SpeechClient();
const gcsUri = `gs://myBucket/${toRec}`;
const encoding = 'AMR';
const sampleRateHertz = 8000;
const languageCode = 'sr-RS';
const config = {
encoding: encoding,
sampleRateHertz: sampleRateHertz,
languageCode: languageCode,
};
const audio = {
uri: gcsUri,
};
const request = {
config: config,
audio: audio,
};
const [operation] = await client.longRunningRecognize(request);
const [response] = await operation.promise();
const transcription = response.results
.map(result => result.alternatives[0].transcript)
.join('\n');
console.log(`Transcription: ${transcription}`);