DeepSpeech-examples/android_mic_streaming
Hadran Ayoub 49b9832187 Bump version from 0.8.0 to 0.9.3 in branch r0.9
Bump DeepSpeech version from 0.8.0 to 0.9.3 in branch r0.9
2021-01-06 18:48:06 +01:00
..
app Bump version from 0.8.0 to 0.9.3 in branch r0.9 2021-01-06 18:48:06 +01:00
gradle/wrapper Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
.gitignore Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
README.md Bump version from 0.8.0 to 0.9.3 in branch r0.9 2021-01-06 18:48:06 +01:00
build.gradle Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
gradle.properties Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
gradlew Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
gradlew.bat Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00
settings.gradle Uplift new examples from r0.6 2020-04-23 23:44:42 +02:00

README.md

Android Microphone Streaming

Android demo application that streams audio from the microphone to deepspeech and transcribes it.

Prerequisites

Download model

Download the pre-trained English model and extract it:

curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.tflite
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer

Move the model files deepspeech-0.9.3-models.pbmm, deepspeech-0.9.3-models.scorer, to the demo application's data directory on your android device. Mind that the data directory will only be present after installing and launching the app once.

adb push deepspeech-0.9.3-models.tflite deepspeech-0.9.3-models.scorer /storage/emulated/0/Android/data/org.deepspeechdemo/files/

You can also copy the files from your file browser to the device.

Android device with USB Debugging

Connect an android device and make sure to enable USB-Debugging in the developer settings of the device. If haven't already, you can activate your developer settings by following this guide from android.

Installation

To install the example app on your connected android device you can either use the command line or Android Studio.

Command Line

cd android_mic_streaming
./gradlew installDebug

Android Studio

Open the android_mic_streaming directory in Android Studio.
Run the app and your connected android device.

Usage

Start recording by pressing the button and the app will transcribe the spoken text.

Fine-tuning the Recognition

Based on your use case or the language you are using you might change the values of BEAM_WIDTH, LM_ALPHA and LM_BETA to improve the speech recogintion.

You can also alter the NUM_BUFFER_ELEMENTS to change the size of the audio data buffer that is fed into the model.