-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
Description
Using google-cloud/speech module my code is running fine and not producing any error, my mp3 file is also ok ( I have tested with multiple .mp3 files ). But is gives the response with empty array every times.
Can anyone please suggest me why is is happening ?
my code is:
// Imports the Google Cloud client library
const Speech = require('@google-cloud/speech');
process.env.GOOGLE_APPLICATION_CREDENTIALS = './speech-368abcdefghi.json'
// Your Google Cloud Platform project ID
const projectId = 'engaged-talon-123456';
// Instantiates a client
const speechClient = Speech({
projectId: projectId
});
// The name of the audio file to transcribe
const fileName = './5sec.mp3';
// The audio file's encoding, sample rate in hertz, and BCP-47 language code
const options = {
encoding: 'LINEAR16',
sampleRateHertz: 16000,
languageCode: 'en-US'
};
// Detects speech in the audio file
speechClient.recognize(fileName, options)
.then((results) => {
console.log(results);
// const transcription = results[0];
// console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
console.error('ERROR:', err);
});
Result
[" '', { results: [] } ]
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.