fctom1215
2020-03-10 4d625b8f7d4eb22209dba53cf19353d8aa7455ea
lib/src/main/java/com/anyun/exam/lib/RemoteService.java
@@ -13,6 +13,7 @@
import com.anyun.exam.lib.util.DESUtil;
import com.anyun.exam.lib.util.NetUtils;
import com.anyun.exam.lib.util.Speaker;
import com.anyun.exam.lib.util.SpeakerCallback;
import androidx.annotation.Nullable;
@@ -78,7 +79,7 @@
    public void onCreate() {
        super.onCreate();
        Log.i(TAG,"onCreate()");
        speaker = new Speaker(getApplicationContext());
        speaker = new Speaker(/*getApplicationContext()*/this, new TTSCallback());
        new Thread(new StartNative()).start();
@@ -93,7 +94,6 @@
            } catch (InterruptedException e) {
            }
            ttsInitSucc = true;
        }
    }
@@ -186,6 +186,29 @@
        return h.toString();
    }
    class TTSCallback implements SpeakerCallback {
        @Override
        public void PlayInit(boolean ret) {
            Log.d(TAG, "TTS引擎初始化成功");
            ttsInitSucc = ret;
        }
        @Override
        public void PlayStart() {
            Log.d(TAG, "TTS引擎播放开始");
        }
        @Override
        public void PlayDone() {
            Log.d(TAG, "TTS引擎播放结束");
        }
        @Override
        public void PlayError() {
            Log.d(TAG, "TTS引擎播放出错");
        }
    }
    // Used to load the 'native-lib' library on application startup.
    static {
        System.loadLibrary("native-lib");