Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speechClient.recognize() giving empty array as response? #425

Closed
svsh227 opened this issue Jul 13, 2017 · 3 comments
Closed

speechClient.recognize() giving empty array as response? #425

svsh227 opened this issue Jul 13, 2017 · 3 comments
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@svsh227
Copy link

svsh227 commented Jul 13, 2017

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: [] } ]

@jmdobry
Copy link
Member

jmdobry commented Aug 21, 2017

Could you try a different encoding? Perhaps the Speech API is unable to read the file?

@jmdobry
Copy link
Member

jmdobry commented Aug 21, 2017

Someone on https://groups.google.com/forum/#!forum/cloud-speech-discuss may be able to help you get the file encoded properly.

@fhinkel
Copy link
Contributor

fhinkel commented Nov 8, 2018

If the issue still persists, please file it here. Thank you.

@fhinkel fhinkel closed this as completed Nov 8, 2018
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 7, 2020
ahrarmonsur pushed a commit that referenced this issue Nov 8, 2022
…new Uptime check feature. Uptime HTTP(S) checks can now be GET or POST (#425)
ace-n pushed a commit that referenced this issue Nov 10, 2022
…new Uptime check feature. Uptime HTTP(S) checks can now be GET or POST (#425)
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 17, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants