1

I am new to Android and am trying to develop an application which would capture the speaker's facial expressions via camera and simultaneously convert speech to text. I am using Affectiva's affdex API for real time facial emotions recognition. Whenever I try to launch the speech to text module via a button, the facial recognition stops, the STT modules completes and then the facial recognition module restarts. I want to have them work simultaneously.

5
  • 1
    Only one app can record audio at a time, so make sure the camera app does not access the microphone.
    – Kaarel
    May 30, 2017 at 21:32
  • 1
    The camera doesn't record audio, the STT module directly converts the speech through RecognizerIntent. But that needs to be as a focus activity, thus the camera module stops May 31, 2017 at 6:14
  • @Kaarel is a great source of advice.... given that , why is it not possible to independently control 2 processes ... #1 get the camera control and capture camera frames ... #2 start an AudioRecorder, capturing an audio buffer -> bytes -> encoder -> STT API ... more on #1 at inducesmile.com/android/android-camera2-api-example-tutorial "see OnImageAvailableListener" ... more on #2 github.com/rowntreerob/Google-speech-Opus-Recorder/blob/master/… - note that this audiobuffer is delegated to google-STT Jun 1, 2017 at 16:36
  • So just to clarify, is your speech-to-text logic in a different activity than your facial expression recognition logic? Obviously, you can't have two foreground activities at the same time. Try putting them in the same activity, or put one in a service. Jun 3, 2017 at 20:59
  • Yes, both logic are in the same, main activity. the STT module requires to be run on a different thread. Jun 5, 2017 at 6:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.