欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

android7.1 科大讯飞语音引擎设置为首选引擎

程序员文章站 2022-06-23 19:37:09
说明 车机需要添加科大讯飞语音引擎,并且设置为首选引擎(Settiings里面可以看到默认选项)。实现 1.frameworks中修改zhoujy@TP:~/data/android/sc826_cn_01_00/msm_8953_git/frameworks$ git show c7f9645508499629c4947d4691073ff254007f1commit c7f9645508499629c4947d4691073ff254007f19Author: zhoujiny.....

说明

  车机需要添加科大讯飞语音引擎,并且设置为首选引擎(Settiings里面可以看到默认选项)。

实现

  1.frameworks中修改

zhoujy@TP:~/data/android/sc826_cn_01_00/msm_8953_git/frameworks$ git show c7f9645508499629c4947d4691073ff254007f1
commit c7f9645508499629c4947d4691073ff254007f19
Author: zhoujinyan <zhoujy@ibumobile.com>
Date:   Thu Jun 11 21:16:53 2020 +0800

    [frameworks]将科大讯飞语音引擎设置为首选引擎

diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 4b2dbb6..afc14e5 100644
--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -314,4 +314,5 @@
     <string name="def_enable_input_methods" translatable="false"></string>
     <!-- Default for Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED -->
     <integer name="def_captive_portal_detection_enabled" translatable="false">0</integer>
+    <string name="default_tts" translatable="false">com.iflytek.speechcloud</string>
 </resources>
diff --git a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index f71d712..d62f569 100644
--- a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2548,7 +2548,7 @@ class DatabaseHelper extends SQLiteOpenHelper {
 
             loadIntegerSetting(stmt, Settings.Secure.SLEEP_TIMEOUT,
                     R.integer.def_sleep_timeout);
-
+            loadStringSetting(stmt, Settings.Secure.TTS_DEFAULT_SYNTH,R.string.default_tts); 
             /*
              * IMPORTANT: Do not add any more upgrade steps here as the global,
              * secure, and system settings are no longer stored in a databas

2.添加APK,并且进行编译

zhoujy@TP:~/data/android/sc826_cn_01_00/msm_8953_git/vendor/fibo/common/IFlytek$ git show 4bdfd5c723c4bf620b307522e7499cd27b66b3d0
commit 4bdfd5c723c4bf620b307522e7499cd27b66b3d0
Author: zhoujinyan <zhoujy@ibumobile.com>
Date:   Thu Jun 11 21:15:41 2020 +0800

    [vendor]增加科大讯飞语音引擎

diff --git a/device/qcom/msm8953_64/msm8953_64.mk b/device/qcom/msm8953_64/msm8953_64.mk
index a3174d3..98121d4 100755
--- a/device/qcom/msm8953_64/msm8953_64.mk
+++ b/device/qcom/msm8953_64/msm8953_64.mk
@@ -131,7 +131,8 @@ PRODUCT_PACKAGES += \
     mkfs.exfat \
     fsck.exfat \
     autommi \
-    Amap
+    Amap \
+    IFlytek
 
 
 # Feature definition files for msm8953
diff --git a/vendor/fibo/common/IFlytek/Android.mk b/vendor/fibo/common/IFlytek/Android.mk
new file mode 100644
index 0000000..c1afac0
--- /dev/null
+++ b/vendor/fibo/common/IFlytek/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional eng
+#copy to data/app
+$(shell if [ ! -d $(TARGET_OUT_DATA)/app/IFlytek ]; then mkdir -p $(TARGET_OUT_DATA)/app/IFlytek;fi)
+$(shell cp -r `find $(LOCAL_PATH)/ -iname *.apk` $(TARGET_OUT_DATA)/app/IFlytek)

科大讯飞语音引擎apk

 

 

 

本文地址:https://blog.csdn.net/zjy764219923/article/details/109637611