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

Implementation of Google ASR Driver #664

Merged
merged 6 commits into from Nov 8, 2017

Conversation

Projects
None yet
2 participants
@rlimonta
Contributor

rlimonta commented Nov 6, 2017

No description provided.

@hrosa hrosa self-assigned this Nov 6, 2017

@hrosa hrosa added this to the 7.0M - sprint08 milestone Nov 6, 2017

private static final String DEFAULT_LANGUAGE = "en-US";

// Configuration
private final List<String> languages;

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

this can be static

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

private int hertz;
private boolean interimResults;

private boolean running;

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

use AtomicBoolean for safety

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

}
}

log.debug("responseTimeout: " + this.responseTimeout);

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

protect logger if(log.isDebug...

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

this.interimResults = Boolean.parseBoolean(parameters.get(INTERIM_RESULTS.symbol()));
}

log.debug("interimResults: " + this.interimResults);

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

protect logger

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

}
}

log.debug("mediaHertz: " + this.hertz);

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

protect logger

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

return;
}

log.debug("lang: " + lang);

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

protect logger

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

StreamingRecognitionResult result = ((StreamingRecognizeResponse)message).getResultsList().get(0);
if (listener != null) {
listener.onSpeechRecognized(result.getAlternativesList().get(0).getTranscript(), result.getIsFinal());
log.debug("Transcript: " + result.getAlternativesList().get(0).getTranscript() + ", isFinal: " + result.getIsFinal());

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

protect logger

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

}

//Send audio data
requestObserver.onNext(StreamingRecognizeRequest.newBuilder().setAudioContent(ByteString.copyFrom(data)).build());

This comment has been minimized.

@hrosa

hrosa Nov 6, 2017

Collaborator

respect offset and data length

This comment has been minimized.

@rlimonta

rlimonta Nov 6, 2017

Contributor

done.

@rlimonta

This comment has been minimized.

Contributor

rlimonta commented Nov 6, 2017

done.

this.languages.add("ja-JP"); //Japanese (Japan)
this.languages.add("cmn-Hans-HK"); //Chinese, Mandarin (Simplified, Hong Kong)
this.languages.add("cmn-Hans-CN"); //Chinese, Mandarin (Simplified, China)
GoogleAsrDriver.LANGUAGES.add("af-ZA"); //Afrikaans (South Africa)

This comment has been minimized.

@hrosa

hrosa Nov 7, 2017

Collaborator

this logic cannot be inside the constructor. Please use a

static {
    LANGUAGES.add("af-ZA"); //Afrikaans (South Africa)
    LANGUAGES.add("am-ET"); //Amharic (Ethiopia)
    ...
}

block outside of the constructor.

This comment has been minimized.

@rlimonta

rlimonta Nov 7, 2017

Contributor

done.

@hrosa

hrosa approved these changes Nov 7, 2017

@hrosa hrosa merged commit b3659e9 into RestComm:master Nov 8, 2017

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