Skip to content

Conversation

@dpopp07
Copy link
Contributor

@dpopp07 dpopp07 commented Aug 1, 2018

During a support session, I discovered that the example for using STT to stream from the microphone to the console was broken. This was due to the interim_results parameter not being passed in as true, as it defaults to false.

I updated the example to use the correct parameter and changed the JSDocs for RecognizeStream because they incorrectly listed the default value for interim_results as true.

ref:

From the Speech to Text docs:

interim_results
If true, the service returns interim results as a stream of JSON SpeechRecognitionResults objects. If false, the service returns a single SpeechRecognitionResults object with final results only.
Default: false

cc @jeffpk62

@codecov-io
Copy link

codecov-io commented Aug 1, 2018

Codecov Report

Merging #761 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #761   +/-   ##
=======================================
  Coverage   83.16%   83.16%           
=======================================
  Files          35       35           
  Lines        4395     4395           
  Branches      555      555           
=======================================
  Hits         3655     3655           
  Misses        361      361           
  Partials      379      379
Impacted Files Coverage Δ
lib/recognize-stream.ts 50.92% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 966ab35...7f08edc. Read the comment docs.

Copy link
Contributor

@anweshan anweshan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that the package.json needs to be updated for the version of watson-developer-cloud in this example. But I confirm that the example works with the change

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 2, 2018

You mean the package.json for the examples/ folder?

It has the line "watson-developer-cloud": "*", which should always be pulling in the latest version.

@anweshan
Copy link
Contributor

anweshan commented Aug 2, 2018

@dpopp07 No, I mean the package.json in the examples/speech_to_text_microphone_input folder which should be changed to what you said above

@anweshan
Copy link
Contributor

anweshan commented Aug 2, 2018

Actually I just noticed that all the package.json files inside the examples folder inside the examples that have their own package.json inside their individual folder should probably be updated with that but that is a separate issue

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 2, 2018

I see that now, thank you for clarifying. About to push a commit with all of those updated

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 2, 2018

Also, I verified that the examples work with the updated SDK versions.

@jeffpk62
Copy link
Contributor

jeffpk62 commented Aug 2, 2018

@dpopp07 Sorry for not seeing that comment about interim_results sooner. I'd have pointed it out otherwise. The API reference has the correct default (false).

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 2, 2018

@jeffpk62 No worries! I just tagged you so you would be aware of the fix.

All - holding off on merge until #762 is merged, since that should prevent the build on master from failing.

@dpopp07 dpopp07 merged commit e67e254 into master Aug 2, 2018
@dpopp07 dpopp07 deleted the update-mic-stream-example branch August 2, 2018 19:32
@qunliu
Copy link

qunliu commented Aug 3, 2018

Is there a similar issue with another sample STT code? (https://github.com/watson-developer-cloud/node-sdk/blob/master/examples/speech_to_text_microphone_input/transcribe-mic-to-file.js)

I pulled down the sample code and ran it, the recorded mic wav file sounds funny (like a slow mo recording where I record 2 seconds, but it gives me 8 seconds or something). However, I put interim_results (true) there doesn't help. Did I miss anything else? Would you please take a look? Thanks!

I am on Windows 10.

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 3, 2018

Hi @qunliu, I tested that example and found that it was not affected by the above problem. This example is for listening to audio from the microphone and writing the transcribed words to a text file. You should not be expecting an audio file.

If you are having trouble with a text-to-speech example, please open an issue with your code and I will be happy to take a look!

@qunliu
Copy link

qunliu commented Aug 6, 2018

Thanks for looking into it @dpopp07 I am a still bit confused. If I understand this example correctly, it does a few things (please see the screenshot below):

  • Listen to a mic and get audio stream from it;
  • Pipe this audio stream to a file writer and get an audio file written to disk;
  • Pipe the audio stream once again to Watson speech to text service and once the transcription is back, it gets written to a file (note: I am not looking at text to speech).

In my test, the transcription was all wrong, so that's where I started looking at that audio file recorded on disk and noticed that was wrong as well which in turn gave wrong transcription.

Sorry if I totally misunderstood the example. Please let me know what you think.

Thanks!

image

(Note: I still use createRecognizeStream since the code uses recognizeUsingWebSocket is not published yet and it'd give me error message)

@dpopp07
Copy link
Contributor Author

dpopp07 commented Aug 6, 2018

Hi @qunliu, I now see what you are saying. I misunderstood your problem at first. Thank you for clarifying. I opened an issue to track this while I investigate - Please reference #765

@watson-github-bot
Copy link
Collaborator

🎉 This PR is included in version 3.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants