Search in sources :

Example 1 with NotAvailableException

use of ee.ioc.phon.android.recsession.NotAvailableException in project K6nele by Kaljurand.

the class HttpRecognitionService method configure.

@Override
protected void configure(Intent recognizerIntent) throws IOException {
    ChunkedWebRecSessionBuilder mRecSessionBuilder = new ChunkedWebRecSessionBuilder(this, getExtras(), null);
    mRecSessionBuilder.setContentType(getEncoderType(), getSampleRate());
    if (Log.DEBUG)
        Log.i(mRecSessionBuilder.toStringArrayList());
    mRecSession = mRecSessionBuilder.build();
    try {
        mRecSession.create();
    } catch (IOException e) {
        onError(SpeechRecognizer.ERROR_NETWORK);
    } catch (NotAvailableException e) {
        // This cannot happen in the current net-speech-api?
        onError(SpeechRecognizer.ERROR_SERVER);
    }
}
Also used : ChunkedWebRecSessionBuilder(ee.ioc.phon.android.speak.ChunkedWebRecSessionBuilder) IOException(java.io.IOException) NotAvailableException(ee.ioc.phon.android.recsession.NotAvailableException)

Aggregations

NotAvailableException (ee.ioc.phon.android.recsession.NotAvailableException)1 ChunkedWebRecSessionBuilder (ee.ioc.phon.android.speak.ChunkedWebRecSessionBuilder)1 IOException (java.io.IOException)1