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

[bug] Fixing speech checking #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android-buildsystem
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public InteractiveAssistant build() {

void setupSpeech(SynthesizerListener.OnStatusChecked listener);

boolean isCheckingSpeech(int requestCode);

void checkSpeech(int resultCode);

void release();

void pause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,33 @@ public void setupSpeech(RecognizerListener.OnStatusChecked listener) {
hideLoading();
listener.execute(recognizerStatus);
});
// TODO: P2 - to show TTS error screen
});
}

private SynthesizerListener.OnStatusChecked synthesizerStatusCheckListener;

@Override
public void setupSpeech(SynthesizerListener.OnStatusChecked listener) {
synthesizerStatusCheckListener = listener;
showLoading();
Objects.requireNonNull(voiceComponent).checkSpeechSynthesizerStatus(context, synthesizerStatus -> {
context.runOnUiThread(() -> {
hideLoading();
listener.execute(synthesizerStatus);
synthesizerStatusCheckListener.execute(synthesizerStatus);
});
});
}

@Override public boolean isCheckingSpeech(int requestCode) {
return voiceComponent.isCheckingSpeech(requestCode);
}

@Override public void checkSpeech(int resultCode) {
voiceComponent.checkSpeech(resultCode, synthesizerStatus -> {
context.runOnUiThread(() -> {
hideLoading();
synthesizerStatusCheckListener.execute(synthesizerStatus);
});
// TODO: P2 - to show TTS error screen
});
}

Expand Down