Advertisement
Guest User

Untitled

a guest
Sep 12th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <body ng-controller="speechController">
  2. <div class="speech-container">
  3. <div class="page-container">
  4. <div class="page-content">
  5. <div class="content-wrapper">
  6. <button type="submit" class="btn bg-pink-400 btn-block" ng-click="talk()">Reconhecimento <i class="icon-arrow-right14 position-right"></i></button>
  7. </div>
  8. </div>
  9. </div>
  10. <pre>{{speech| json}}</pre>
  11. </div>
  12. </body>
  13.  
  14. app.controller("speechController", function($scope){
  15. $scope.speech = {
  16. username:'test',
  17. password:'test'
  18. };
  19. $scope.talk = function(){
  20. Android.askSpeechInput();
  21. }
  22. });
  23.  
  24. private void askSpeechInput() {
  25. Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  26. intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
  27. RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  28. intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
  29. intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
  30. "Escutando");
  31. try {
  32. startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
  33. } catch (ActivityNotFoundException a) {
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement