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

In local with Google API it's working fine but, deploy on server it's not working. #22

Open
higunjan opened this issue Jan 13, 2017 · 2 comments
Labels

Comments

@higunjan
Copy link

Hello their I used following code and integrate with Google API to convert speech to text.
In local demo is working fine and call instance and display text. when I load on server than it's called only once than stop execution.

When I speak in local than .on('data', function(data){ calls many time after that auto killed.
On server it's call only once.

/ [START speech_streaming_mic_recognize]
const record = require('node-record-lpcm16');

methods.streamingMicRecognize = function(callback){
  // Instantiates a client
  const speech = Speech({
    projectId: projectId
  });

  const options = {
    config: {
      // Configure these settings based on the audio you're transcribing
      encoding: 'LINEAR16',
      languageCode: 'en-IN',
      sampleRate: 16000
    }
  };

  // Create a recognize stream 
  const recognizeStream = speech.createRecognizeStream(options)
    .on('error', function(error){
      console.error
    })
    .on('data', function(data){
        process.stdout.write(data.results);
    });
      

  // Start recording and send the microphone input to the Speech API
  record.start({ sampleRate: 16000 }).pipe(recognizeStream);

  console.log('Listening, press Ctrl+C to stop.');
}
@higunjan higunjan changed the title In local with Google API it's working fine deploy on server it's not working. In local with Google API it's working fine but, deploy on server it's not working. Jan 13, 2017
@adeel-raza
Copy link

Facing the exact same problem when deploying on server

@Ayushimidha28
Copy link

I am facing the same error. Did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants