Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body ng-controller="speechController">
- <div class="speech-container">
- <div class="page-container">
- <div class="page-content">
- <div class="content-wrapper">
- <button type="submit" class="btn bg-pink-400 btn-block" ng-click="talk()">Reconhecimento <i class="icon-arrow-right14 position-right"></i></button>
- </div>
- </div>
- </div>
- <pre>{{speech| json}}</pre>
- </div>
- </body>
- app.controller("speechController", function($scope){
- $scope.speech = {
- username:'test',
- password:'test'
- };
- $scope.talk = function(){
- Android.askSpeechInput();
- }
- });
- private void askSpeechInput() {
- Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
- intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
- RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
- intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
- intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
- "Escutando");
- try {
- startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
- } catch (ActivityNotFoundException a) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement