[android] add build.gradle and rename model name (#88)

This commit is contained in:
彭震东 2022-09-12 17:50:05 +08:00 committed by GitHub
parent 9f29e033aa
commit 508938f537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 129 additions and 120 deletions

View File

@ -30,7 +30,7 @@ int offset;
void init(JNIEnv* env, jobject, jstring jModelDir) {
const char* pModelDir = env->GetStringUTFChars(jModelDir, nullptr);
std::string modelPath = std::string(pModelDir) + "/wenwen.ort";
std::string modelPath = std::string(pModelDir) + "/kws.ort";
spotter = std::make_shared<KeywordSpotting>(modelPath);
feature_config = std::make_shared<wenet::FeaturePipelineConfig>(40, 16000);

View File

@ -34,7 +34,7 @@ public class MainActivity extends AppCompatActivity {
private static final String LOG_TAG = "WEKWS";
private static final int SAMPLE_RATE = 16000; // The sampling rate
private static final int MAX_QUEUE_SIZE = 2500; // 100 seconds audio, 1 / 0.04 * 100
private static final List<String> resource = Arrays.asList("wenwen.ort");
private static final List<String> resource = Arrays.asList("kws.ort");
private boolean startRecord = false;
private AudioRecord record = null;

View File

@ -0,0 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}