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

fire end of stream at turn.end, not at speech.end #7

Merged
merged 8 commits into from
Dec 20, 2018

Conversation

fmegen
Copy link
Member

@fmegen fmegen commented Dec 17, 2018

No description provided.

Copy link
Contributor

@wolfma61 wolfma61 left a comment

Choose a reason for hiding this comment

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

lets review to make sure it matches the sdk for the other languages

@@ -349,12 +349,12 @@ export abstract class ServiceRecognizerBase implements IDisposable {
if (!!this.privRecognizer.speechEndDetected) {
this.privRecognizer.speechEndDetected(this.privRecognizer, speechStopEventArgs);
}

break;
case "turn.end":
if (requestSession.isSpeechEnded && this.privRecognizerConfig.isContinuousRecognition) {
Copy link
Member

@zhouwangzw zhouwangzw Dec 18, 2018

Choose a reason for hiding this comment

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

Do we return EndOfStream result for RecognizeOnceAsync()? The main purpose of EndOfStream is for RecognizeOnceAsync(). If users calls RecognizeOnceAsync() and there is no audio to be processed anymore, EndOfStream is returned as result (Reason is set to Canceled, and then CancellationDetails returns EndOfStream). #Closed

Copy link
Member Author

@fmegen fmegen Dec 19, 2018

Choose a reason for hiding this comment

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

i changed the code to be more consistent with the c++ implementation, i.e., make sure we fire the event in case the stream has ended and we have seen a turn-start message.
in this case, we fire the eof cancel event once.

re-buffering on the audio side is done through the audio-node, so we are not loosing data here, however,
since we are not yet handling the timestamps in the reco messages, it might be that the message come "too early" which means, there is so much data in flight that there will be a subsequent turn.start/end after the current one.
(note: this /should/ only happen for file data since microphone data is streamed in realtime to the service and thus responsed should not be behind the actual audio data)
#Closed

Copy link
Contributor

@wolfma61 wolfma61 left a comment

Choose a reason for hiding this comment

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

:shipit:

@fmegen fmegen merged commit 87b9d75 into master Dec 20, 2018
@fmegen fmegen deleted the fmegen/fix-event-ordering-end-of-stream branch December 20, 2018 08:14
mahilleb-msft added a commit that referenced this pull request Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants