Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use kotlin backend #198

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
apply plugin: 'com.android.application'

repositories {
google()
mavenCentral()
}

android {
namespace "org.vosk.demo"
compileSdkVersion 33
Expand Down Expand Up @@ -33,6 +28,6 @@ android {

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation group: 'com.alphacephei', name: 'vosk-android', version: '0.3.46'
implementation("com.alphacephei:vosk-api-kotlin-android:0.4.0-alpha0")
implementation project(':models')
}
4 changes: 2 additions & 2 deletions app/src/main/java/org/vosk/demo/VoskActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import android.widget.TextView;
import android.widget.ToggleButton;

import org.vosk.LibVosk;
import org.vosk.Vosk;
import org.vosk.LogLevel;
import org.vosk.Model;
import org.vosk.Recognizer;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void onCreate(Bundle state) {
findViewById(R.id.recognize_mic).setOnClickListener(view -> recognizeMicrophone());
((ToggleButton) findViewById(R.id.pause)).setOnCheckedChangeListener((view, isChecked) -> pause(isChecked));

LibVosk.setLogLevel(LogLevel.INFO);
Vosk.setLogLevel(LogLevel.INFO);

// Check if user has given permission to record audio, init the model after permission is granted
int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.RECORD_AUDIO);
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
maven {
url 'https://alphacephei.com/maven/'
}
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
Expand All @@ -22,5 +23,6 @@ allprojects {
maven {
url 'https://alphacephei.com/maven/'
}
mavenLocal()
}
}