Browse Source

fix: 八麦思必驰对接

sibichiEight
高志龙 6 months ago
parent
commit
4e6b4860e5
  1. 2
      .idea/misc.xml
  2. 1
      app/build.gradle
  3. BIN
      app/libs/DUI-lite-SDK-for-Android-3.5.0-0a84f3b4.jar
  4. BIN
      app/libs/armeabi-v7a/libaispeechaudio.so
  5. BIN
      app/libs/armeabi-v7a/libduiitn.so
  6. BIN
      app/libs/armeabi-v7a/libsspe.so
  7. BIN
      app/src/main/assets/sspe_aec-bf-bss-wkp_ch10-mic8-ref2_outgain4_v2.0.0.165_20251127_v1.bin
  8. BIN
      app/src/main/assets/vad_aicar_v0.16.bin
  9. BIN
      app/src/main/assets/vad_aihome_v0.11.bin
  10. BIN
      app/src/main/assets/vad_aihome_v0.12c_noDither.bin
  11. BIN
      app/src/main/assets/wakeup_aifar_comm_h7_20210127.bin
  12. 8
      app/src/main/java/qianmu/container/activity/H5/WebViewActivity.java
  13. 15
      app/src/main/java/qianmu/container/app/MyApplication.java

2
.idea/misc.xml

@ -5,7 +5,7 @@
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" /> <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations> </configurations>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

1
app/build.gradle

@ -101,7 +101,6 @@ dependencies {
implementation files('libs\\signway.jar') // implementation files('libs\\signway.jar') //
implementation files('libs\\sdkapi.jar') //Bv-3588 implementation files('libs\\sdkapi.jar') //Bv-3588
implementation files('libs\\smdt.jar') // implementation files('libs\\smdt.jar') //
implementation files('libs\\DUI-lite-SDK-for-Android-3.5.0-466a4c77.jar') //
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

BIN
app/libs/DUI-lite-SDK-for-Android-3.5.0-466a4c77.jar → app/libs/DUI-lite-SDK-for-Android-3.5.0-0a84f3b4.jar

Binary file not shown.

BIN
app/libs/armeabi-v7a/libaispeechaudio.so

Binary file not shown.

BIN
app/libs/armeabi-v7a/libduiitn.so

Binary file not shown.

BIN
app/libs/armeabi-v7a/libsspe.so

Binary file not shown.

BIN
app/src/main/assets/sspe_aec-bf-bss-wkp_ch10-mic8-ref2_outgain4_v2.0.0.165_20251127_v1.bin

Binary file not shown.

BIN
app/src/main/assets/vad_aicar_v0.16.bin

Binary file not shown.

BIN
app/src/main/assets/vad_aihome_v0.11.bin

Binary file not shown.

BIN
app/src/main/assets/vad_aihome_v0.12c_noDither.bin

Binary file not shown.

BIN
app/src/main/assets/wakeup_aifar_comm_h7_20210127.bin

Binary file not shown.

8
app/src/main/java/qianmu/container/activity/H5/WebViewActivity.java

@ -930,16 +930,18 @@ public class WebViewActivity extends BaseActivity {
if(mEngine == null){ if(mEngine == null){
AICloudASRConfig config = new AICloudASRConfig(); AICloudASRConfig config = new AICloudASRConfig();
config.setLocalVadEnable(true); config.setLocalVadEnable(true);
config.setVadResource("vad_aihome_v0.11.bin");
config.setVadResource("vad_aihome_v0.12c_noDither.bin");
mEngine = AICloudASREngine.createInstance(); mEngine = AICloudASREngine.createInstance();
aiCloudASRIntent = new AICloudASRIntent(); aiCloudASRIntent = new AICloudASRIntent();
aiCloudASRIntent.setEnablePunctuation(true); aiCloudASRIntent.setEnablePunctuation(true);
aiCloudASRIntent.setRealback(true);//打开实时反馈功能 aiCloudASRIntent.setRealback(true);//打开实时反馈功能
aiCloudASRIntent.setCloudVadEnable(false);
aiCloudASRIntent.setResourceType(Constant.asrModel); aiCloudASRIntent.setResourceType(Constant.asrModel);
aiCloudASRIntent.setEnableNumberConvert(true);//设置启用识别结果汉字数字转阿拉伯数字功能 aiCloudASRIntent.setEnableNumberConvert(true);//设置启用识别结果汉字数字转阿拉伯数字功能
aiCloudASRIntent.setWaitingTimeout(30000); //设置等待识别结果超时时长,默认5000ms aiCloudASRIntent.setWaitingTimeout(30000); //设置等待识别结果超时时长,默认5000ms
aiCloudASRIntent.setNoSpeechTimeOut(10000); aiCloudASRIntent.setNoSpeechTimeOut(10000);
aiCloudASRIntent.setPauseTime(2000); aiCloudASRIntent.setPauseTime(2000);
//aiCloudASRIntent.setServer("wss://asr.dui.ai/runtime/v2/recognize");
mEngine.init(config, new AIASRListenerImpl()); mEngine.init(config, new AIASRListenerImpl());
} }
} }
@ -947,7 +949,7 @@ public class WebViewActivity extends BaseActivity {
private class AIASRListenerImpl implements AIASRListener { private class AIASRListenerImpl implements AIASRListener {
public void onError(AIError error) { public void onError(AIError error) {
LoggerUtil.e("ASRInit: ",error.getMessage());
LoggerUtil.e("ASRInitErroe: ",error.getMessage());
// 在非主线程中需要调用 WebView 方法时 // 在非主线程中需要调用 WebView 方法时
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
@ -959,7 +961,7 @@ public class WebViewActivity extends BaseActivity {
} }
public void onResults(AIResult results) { public void onResults(AIResult results) {
LoggerUtil.e("ASRInit: ", String.valueOf(results.isLast()));
LoggerUtil.e("ASRInitResult: ", String.valueOf(results.isLast()));
if (results.getResultType() == AIConstant.AIENGINE_MESSAGE_TYPE_JSON) { if (results.getResultType() == AIConstant.AIENGINE_MESSAGE_TYPE_JSON) {
JSONResultParser parser = new JSONResultParser((String) results.getResultObject()); JSONResultParser parser = new JSONResultParser((String) results.getResultObject());
if("".equals(parser.getVar()) && !"".equals(parser.getText())){ if("".equals(parser.getVar()) && !"".equals(parser.getText())){

15
app/src/main/java/qianmu/container/app/MyApplication.java

@ -11,6 +11,7 @@ import android.util.Log;
import com.aispeech.DUILiteConfig; import com.aispeech.DUILiteConfig;
import com.aispeech.DUILiteSDK; import com.aispeech.DUILiteSDK;
import com.aispeech.export.config.AuthConfig;
import com.alibaba.android.arouter.BuildConfig; import com.alibaba.android.arouter.BuildConfig;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.jakewharton.processphoenix.ProcessPhoenix; import com.jakewharton.processphoenix.ProcessPhoenix;
@ -89,17 +90,19 @@ public class MyApplication extends Application {
} }
private void initSbcSDK(){ private void initSbcSDK(){
AuthConfig authConfig = new AuthConfig.Builder()
.setCustomDeviceName("19a2ebc079d6d99e") // my_uniqie_device_name只是举例,请用真实设备唯一码替换
.setAuthTimeout(5000)
.create();
// 产品认证需设置 apiKey, productId, productKey, productSecret // 产品认证需设置 apiKey, productId, productKey, productSecret
DUILiteConfig config = new DUILiteConfig.Builder() DUILiteConfig config = new DUILiteConfig.Builder()
.setApiKey("3ac5b2151aab3ac5b2151aab692e463b") .setApiKey("3ac5b2151aab3ac5b2151aab692e463b")
.setProductId("279633115") .setProductId("279633115")
.setProductKey("f08d7e0da576f89fedc67bbf44e2e2d6") .setProductKey("f08d7e0da576f89fedc67bbf44e2e2d6")
.setProductSecret("25846304a956fd09b14de16cbf3832b0").create();
MyManager manager = MyManager.getInstance(this);
String mac = manager.getEthMacAddress();
config.setExtraParameter("DEVICE_ID", mac);
config.setExtraParameter("DEVICE_NAME", mac);
.setProductSecret("25846304a956fd09b14de16cbf3832b0")
.setAuthConfig(authConfig)
.create();
DUILiteSDK.init(getApplicationContext()); DUILiteSDK.init(getApplicationContext());
// SDK 授权 // SDK 授权

Loading…
Cancel
Save