package com.demo.csjbot.csjsdkdemo;

import android.app.Application;
import android.util.Log;

import com.csjbot.coshandler.core.CsjRobot;
import com.csjbot.coshandler.listener.OnAuthenticationListener;
import com.csjbot.coshandler.tts.ISpeechSpeak;
import com.csjbot.coshandler.tts.SpeechFactory;

/**
 * Created by Administrator on 2019/7/13.
 */

public class MyApplication extends Application {




    @Override
    public void onCreate() {
        super.onCreate();

        CsjRobot.authentication(this, "123", "456", new OnAuthenticationListener() {
            @Override
            public void success() {
                Log.d("TAG", "授权成功!");
            }

            @Override
            public void error() {
                Log.d("TAG", "授权失败!");
            }
        });

        try {
            Thread.sleep(1500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // 是否启用语音模块(默认开启)  #####在init之前调用
        CsjRobot.enableAsr(true);
        // 是否启用人脸识别模块
        CsjRobot.enableFace(true);
        // 是否启用导航模块
        CsjRobot.enableSlam(true);
        // 设置通信的地址，默认是192.168.99.101， 60002
        CsjRobot.setIpAndrPort("127.0.0.1", 60002);

        /*
         * 设置机器人类型(在init之前调用)
         * 如果设置了ALICE，则为第八代机器人的协议
         */
        CsjRobot.setRobotType(CsjRobot.RobotType.ALICE_NEW);

        /*
         * 初始化SDK
         */
        CsjRobot.getInstance().init(this);
    }
}
