Skip to content

Library crashes on neutab g7 (Android 5.1) #20

@willblaschko

Description

@willblaschko

Library is crashing when initializing the SpeechRecognizer with the following call:

recognizer = defaultSetup()
          .setAcousticModel(new File(assetsDir, "en-us-ptm"))
          .setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
          // Use context-independent phonetic search, context-dependent is too slow for mobile
          .setBoolean("-allphone_ci", true)
          .getRecognizer();

No issues on any other device than the one above. Below is the stack trace:

Non-fatal Exception: java.lang.IllegalArgumentException
       at android.media.AudioRecord.<init>(AudioRecord.java:277)
       at android.media.AudioRecord.<init>(AudioRecord.java:233)
       at edu.cmu.pocketsphinx.SpeechRecognizer.<init>(SpeechRecognizer.java:82)
       at edu.cmu.pocketsphinx.SpeechRecognizerSetup.getRecognizer(SpeechRecognizerSetup.java:74)
       at com.willblaschko.android.alexalistens.MainActivity$SettingsFragment$6.doInBackground(MainActivity.java:261)
       at com.willblaschko.android.alexalistens.MainActivity$SettingsFragment$6.doInBackground(MainActivity.java:245)
       at android.os.AsyncTask$2.call(AsyncTask.java:292)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions