Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

client.recognize doesn't return result nor error #6

Closed
xavicolomer opened this issue Nov 27, 2017 · 4 comments
Closed

client.recognize doesn't return result nor error #6

xavicolomer opened this issue Nov 27, 2017 · 4 comments
Assignees
Labels
api: speech Issues related to the googleapis/nodejs-speech API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@xavicolomer
Copy link

xavicolomer commented Nov 27, 2017

Environment details

  • OS: OSX 10.12.6
  • Node.js version: v4.3.2
  • npm version: 2.14.12
  • @google-cloud/speech version: 0.11.0

Steps to reproduce

NOTE: In the example I am using keyFilePath but I also tried export GOOGLE_APPLICATION_CREDENTIALS=/path/to/file

Code

const audio = {
          content: base64AudioFileContents,
        };

        const client = new speech.SpeechClient({
          projectId: 'project-id',
          keyFilePath: 'path/to/file.json'
        });

        const config = {
          encoding: 'LINEAR16',
          sampleRateHertz: 16000,
          languageCode: 'en-US',
        };

        const request = {
          audio: audio,
          config: config
        };

        client
          .recognize(request)
          .then(data => {
            console.log(data);
            const response = data[0];
            const transcription = response.results
              .map(result => result.alternatives[0].transcript)
              .join('\n');
            
              console.log(data)
          })
          .catch(err => {
            console.log(error);
          });
@stephenplusplus
Copy link
Contributor

Sorry for the confusion-- the property name is keyFilename. Would you try that real quick?

@xavicolomer
Copy link
Author

Doesn't seem to work. Not even a TIMEOUT, how can I help / provide more information?

@stephenplusplus
Copy link
Contributor

I haven't been able to reproduce using similar snippets, such as running the samples here: https://github.com/googleapis/nodejs-speech/tree/master/samples

Could you provide reproduction steps / put together a small repo I can clone to try to reproduce?

@xavicolomer
Copy link
Author

xavicolomer commented Nov 27, 2017

I found it.

Must be an absolute path to keyFilename. Relative path won't work.

const client = new speech.SpeechClient({
            projectId: 'project-id',
            keyFilename: '/this/must/be/absolute/path/to.json'
          });

@google-cloud-label-sync google-cloud-label-sync bot added the api: speech Issues related to the googleapis/nodejs-speech API. label Jan 31, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: speech Issues related to the googleapis/nodejs-speech API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants