This commit is contained in:
Родитель
aa50483957
Коммит
77e39c20d8
|
@ -33,11 +33,11 @@ dependencies {
|
|||
implementation project(':mozillaspeechlibrary')
|
||||
implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||
implementation 'androidx.annotation:annotation:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
|
||||
implementation 'com.jjoe64:graphview:4.2.2'
|
||||
implementation 'net.lingala.zip4j:zip4j:1.3.2'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
|
|
|
@ -50,11 +50,12 @@ dependencies {
|
|||
implementation 'com.github.axet:opus:1.0.2'
|
||||
implementation 'com.github.axet:jssrc:1.0.2-2'
|
||||
implementation 'org.apache.commons:commons-math3:3.6.1'
|
||||
implementation 'androidx.annotation:annotation:1.0.0'
|
||||
|
||||
compileOnly 'com.loopj.android:android-async-http:1.4.9'
|
||||
compileOnly "org.mozilla.geckoview:geckoview-nightly-x86_64:74.0.20200107215758"
|
||||
compileOnly "org.mozilla.geckoview:geckoview-nightly-x86_64:75.0.20200213035745"
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.mozilla.speechlibrary;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mozilla.speechlibrary.networking.NetworkSettings;
|
||||
|
||||
import org.mozilla.geckoview.GeckoWebExecutor;
|
||||
|
|
|
@ -67,7 +67,7 @@ class NetworkSpeechRecognition implements Runnable {
|
|||
try {
|
||||
Class.forName("org.mozilla.geckoview.GeckoWebExecutor");
|
||||
if (mExecutor == null) {
|
||||
throw new IllegalStateException("GeckoWebExecutor not set, call enableGeckoWebExecutor first.");
|
||||
throw new IllegalStateException("GeckoWebExecutor not set, call setGeckoWebExecutor first.");
|
||||
}
|
||||
network = new GeckoNetworking(mContext, mService, mExecutor);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package com.mozilla.speechlibrary.networking;
|
|||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mozilla.speechlibrary.MozillaSpeechService;
|
||||
import com.mozilla.speechlibrary.STTResult;
|
||||
|
@ -37,8 +38,9 @@ public class GeckoNetworking extends Networking {
|
|||
}
|
||||
|
||||
mHandler.post(() -> {
|
||||
ByteBuffer input = ByteBuffer.allocateDirect(baos.size());
|
||||
input.put(baos.toByteArray());
|
||||
byte[] byteArray = baos.toByteArray();
|
||||
ByteBuffer input = ByteBuffer.allocateDirect(byteArray.length);
|
||||
input.put(byteArray);
|
||||
WebRequest request = new WebRequest.Builder(STT_ENDPOINT)
|
||||
.body(input)
|
||||
.method("POST")
|
||||
|
|
Загрузка…
Ссылка в новой задаче