Search in sources :

Example 1 with AudioCue

use of ee.ioc.phon.android.speechutils.AudioCue in project K6nele by Kaljurand.

the class RecognizerIntentActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setUpActivity(R.layout.recognizer);
    setUpExtras();
    try {
        mRecSessionBuilder = new ChunkedWebRecSessionBuilder(this, getExtras(), getCallingActivity());
    } catch (MalformedURLException e) {
        // The user has managed to store a malformed URL in the configuration.
        handleResultError(RecognizerIntent.RESULT_CLIENT_ERROR, "", e);
    }
    mPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    // For the change in the autostart-setting to take effect,
    // the user must restart the app. This seems more natural.
    mStartRecording = isAutoStart();
    mTvPrompt = (TextView) findViewById(R.id.tvPrompt);
    registerPrompt(mTvPrompt);
    mBStartStop = (Button) findViewById(R.id.bStartStop);
    mLlTranscribing = (LinearLayout) findViewById(R.id.llTranscribing);
    mLlProgress = (LinearLayout) findViewById(R.id.llProgress);
    mLlError = (LinearLayout) findViewById(R.id.llError);
    mTvBytes = (TextView) findViewById(R.id.tvBytes);
    mChronometer = (Chronometer) findViewById(R.id.chronometer);
    mIvVolume = (ImageView) findViewById(R.id.ivVolume);
    mIvWaveform = (ImageView) findViewById(R.id.ivWaveform);
    mTvChunks = (TextView) findViewById(R.id.tvChunks);
    mTvErrorMessage = (TextView) findViewById(R.id.tvErrorMessage);
    mRes = getResources();
    mVolumeLevels = new ArrayList<>();
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level0));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level1));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level2));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level3));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level4));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level5));
    mVolumeLevels.add(mRes.getDrawable(R.drawable.speak_now_level6));
    mAudioCue = new AudioCue(this);
}
Also used : MalformedURLException(java.net.MalformedURLException) ChunkedWebRecSessionBuilder(ee.ioc.phon.android.speak.ChunkedWebRecSessionBuilder) AudioCue(ee.ioc.phon.android.speechutils.AudioCue)

Aggregations

ChunkedWebRecSessionBuilder (ee.ioc.phon.android.speak.ChunkedWebRecSessionBuilder)1 AudioCue (ee.ioc.phon.android.speechutils.AudioCue)1 MalformedURLException (java.net.MalformedURLException)1