|
|
|
@ -127,6 +127,11 @@ class AzureAsrHelper(private val context: Context) { |
|
|
|
this.supportedLanguages = supportedLanguages |
|
|
|
} |
|
|
|
|
|
|
|
Log.i( |
|
|
|
tag, |
|
|
|
"lxm---ASR initialize: supportedLanguages=${supportedLanguages.joinToString(",")}, audioSourceType=$audioSourceType" |
|
|
|
) |
|
|
|
|
|
|
|
val xunfeiConfigReady = this.xunfeiAppId.isNotBlank() && |
|
|
|
this.xunfeiAccessKeyId.isNotBlank() && |
|
|
|
this.xunfeiAccessKeySecret.isNotBlank() |
|
|
|
@ -140,6 +145,11 @@ class AzureAsrHelper(private val context: Context) { |
|
|
|
this.currentLanguage = supportedLanguages[0] |
|
|
|
} |
|
|
|
|
|
|
|
Log.i( |
|
|
|
tag, |
|
|
|
"lxm---ASR initialize derived: isAutoDetectLanguage=$isAutoDetectLanguage, currentLanguage=$currentLanguage, provider=${getAsrProvider()}, xunfeiConfigured=$xunfeiConfigReady" |
|
|
|
) |
|
|
|
|
|
|
|
// 创建语音配置 |
|
|
|
speechConfig = SpeechConfig.fromSubscription(subscriptionKey, region).apply { |
|
|
|
if (isAutoDetectLanguage) { |
|
|
|
@ -314,6 +324,7 @@ class AzureAsrHelper(private val context: Context) { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
Log.d(tag, "startContinuousRecognition: ${audioStream.isContinuousRecognitionActive}") |
|
|
|
xunFeiAsrHelper?.start(callback, currentLanguage, isAutoDetectLanguage, isRemoveFirstPunctuation) |
|
|
|
|
|
|
|
this.audioSourceType = audioSourceType |
|
|
|
|