I am using @google-cloud/speech but while doing node app.js I am getting Auth error: Error: invalid_grant.
I am searching on google but I couldn't get my solutions. Please tell me how to remove this error.
My code is:
const Speech = require('@google-cloud/speech')({
projectId: 'natural-numbus-123456789',
keyFilename: './myman-123456789.json'
});
process.env.GOOGLE_APPLICATION_CREDENTIALS = './myman-123456789.json'
const projectId = 'natural-numbus-123456789';
const fileName = "gs://cloud-samples-tests/myman/brooklyn.flac";
const options = {
encoding: 'FLAC',
sampleRateHertz: 16000,
languageCode: 'en-US'
};
Speech.recognize(fileName, options)
.then((results) => {
console.log(results);
const transcription = results[0];
console.log(`Transcription: ${transcription}`);
})
.catch((err) => {
console.error('ERROR:', err);
});
On linux its working fine. But on windows i got error.
I am using @google-cloud/speech but while doing node app.js I am getting Auth error: Error: invalid_grant.
I am searching on google but I couldn't get my solutions. Please tell me how to remove this error.
My code is:
On linux its working fine. But on windows i got error.