public class DDS
extends java.lang.Object
This program is the property of AI Speech Ltd. It shall be communicated to authorized personnel only. It is not to be disclosed outside the group without prior written consent. If you are not sure if you’re authorized to read this program, please contact info@aispeech.com before reading.
Created by jinrui.gan on 17-3-12.
Modifier and Type | Field and Description |
---|---|
static int |
AUTH_COMPLETE_FULL |
static int |
AUTH_COMPLETE_NONE |
static int |
AUTH_COMPLETE_NOT_FULL |
static java.lang.String |
BUS_SERVER_ADDR |
static java.lang.String |
DNS_SERVER |
static int |
ERROR_EXTRACT_DDS_BIN
Extract dds.bin error.
|
static int |
ERROR_KERNEL_READY_TIMEOUT
Waiting sys.kernel.ready timeout error.
|
static int |
ERROR_LASA_EXECUTE_FAILED
Lasa execute bootloader error.
|
static int |
ERROR_MD5SUM_NOT_EXIST
md5sum not exist.
|
static java.lang.String |
ERROR_MD5SUM_NOT_EXIST_MSG |
static int |
ERROR_NO_SPACE_LEFT |
static int |
INIT_COMPLETE_FULL |
static int |
INIT_COMPLETE_NONE |
static int |
INIT_COMPLETE_NOT_FULL |
android.content.Context |
mContext |
Modifier and Type | Method and Description |
---|---|
void |
doAuth()
执行设备授权操作
异步返回,见
DDSAuthListener |
Agent |
getAgent()
获取Agent
|
java.lang.String |
getDeviceName()
返回Profile授权方式下的deviceName信息
|
int |
getInitStatus()
获取当前初始化的状态
|
static DDS |
getInstance()
获取DDS实例
|
DDSUpdater |
getUpdater()
获取DDSUpdater
|
java.lang.String |
getVersionName()
获取DDS SDK的版本号
|
void |
init(android.content.Context context,
DDSConfig configs,
DDSInitListener ddsInitListener,
DDSAuthListener ddsAuthListener)
初始化DDS SDK
|
boolean |
isAuthSuccess()
授权是否成功,该方法适用于api key授权
|
boolean |
isInitComplete()
Deprecated.
|
void |
release()
销毁DDS SDK
|
void |
releaseSync()
同步销毁 DDS SDK
|
void |
setDDSErrorListener(DDSErrorListener listener)
设置DDS异常监听器,如果DDS有不可逆的异常会通过此接口抛出,客户收到此异常之后可以消毁并重启DDS
|
boolean |
setDebugMode(int level)
|
boolean |
setReverseRecorderDataListener(ReverseRecorderDataListener listener)
设置录音机音频反转监听器
|
void |
startDebug()
开启调试模式:
1.
|
void |
stopDebug()
关闭调试模式:
1.
|
public static final int ERROR_EXTRACT_DDS_BIN
public static final int ERROR_LASA_EXECUTE_FAILED
public static final int ERROR_KERNEL_READY_TIMEOUT
public static final int ERROR_NO_SPACE_LEFT
public static final int ERROR_MD5SUM_NOT_EXIST
public static final java.lang.String ERROR_MD5SUM_NOT_EXIST_MSG
public static final int INIT_COMPLETE_NONE
public static final int INIT_COMPLETE_NOT_FULL
public static final int INIT_COMPLETE_FULL
public static final int AUTH_COMPLETE_NONE
public static final int AUTH_COMPLETE_NOT_FULL
public static final int AUTH_COMPLETE_FULL
public android.content.Context mContext
public static final java.lang.String DNS_SERVER
public static java.lang.String BUS_SERVER_ADDR
public static DDS getInstance()
public java.lang.String getVersionName()
public void init(android.content.Context context, DDSConfig configs, DDSInitListener ddsInitListener, DDSAuthListener ddsAuthListener)
context
- Android context.configs
- 初始化的配置ddsInitListener
- 初始化回调方法ddsAuthListener
- 授权回调方法public void release()
public void releaseSync()
public Agent getAgent()
public DDSUpdater getUpdater() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void doAuth() throws DDSNotInitCompleteException
DDSAuthListener
DDSNotInitCompleteException
public java.lang.String getDeviceName() throws DDSNotInitCompleteException
DDSNotInitCompleteException
public boolean isAuthSuccess() throws DDSNotInitCompleteException
DDSNotInitCompleteException
@Deprecated public boolean isInitComplete()
DDS#getInstance()#getInitStatus()
public int getInitStatus()
public boolean setDebugMode(int level)
init(android.content.Context, com.aispeech.dui.dds.DDSConfig, com.aispeech.dui.dds.DDSInitListener, com.aispeech.dui.dds.DDSAuthListener)
之前调用才生效level
- 可选值1,2,3,4,5 默认值:4public void setDDSErrorListener(DDSErrorListener listener)
listener
- public boolean setReverseRecorderDataListener(ReverseRecorderDataListener listener)
listener
- public void startDebug() throws DDSNotInitCompleteException
DDSNotInitCompleteException
public void stopDebug() throws DDSNotInitCompleteException
DDSNotInitCompleteException