Browse Source

add

newdev_shunjiawei
fdp 1 year ago
parent
commit
21b7077a4f
  1. 1
      local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt
  2. 5
      local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt
  3. 3
      local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/tools/RecordFile.kt
  4. 4
      local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleService.kt
  5. 3
      local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

1
local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt

@ -587,6 +587,7 @@ class AzureAsrHelper(private val context: Context) {
recordfile!!.creatingFiles(filePath) recordfile!!.creatingFiles(filePath)
} }
/** /**
* 移动文件到新路径 * 移动文件到新路径
*/ */

5
local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureSpeechPlugin.kt

@ -11,7 +11,6 @@ import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.EventChannel
import com.microsoft.cognitiveservices.speech.audio.*
import com.deep_voice.speech.tts.TtsEvent import com.deep_voice.speech.tts.TtsEvent
import com.deep_voice.speech.tts.TtsEventListener import com.deep_voice.speech.tts.TtsEventListener
import com.deep_voice.speech.tts.TtsEventType import com.deep_voice.speech.tts.TtsEventType
@ -366,6 +365,7 @@ class AzureSpeechPlugin : BleService.Callback, FlutterPlugin {
result.error("ENABLERECORD_ERROR", e.message, null) result.error("ENABLERECORD_ERROR", e.message, null)
} }
} }
"moveFile" -> { "moveFile" -> {
val sourcePath = call.argument<String>("sourcePath") ?: "" val sourcePath = call.argument<String>("sourcePath") ?: ""
val destPath = call.argument<String>("destPath") ?: "" val destPath = call.argument<String>("destPath") ?: ""
@ -378,6 +378,7 @@ class AzureSpeechPlugin : BleService.Callback, FlutterPlugin {
result.error("ENABLERECORD_ERROR", e.message, null) result.error("ENABLERECORD_ERROR", e.message, null)
} }
} }
"enableRecord" -> { "enableRecord" -> {
val filePath = call.argument<String>("filePath") ?: "" val filePath = call.argument<String>("filePath") ?: ""
try { try {
@ -389,10 +390,12 @@ class AzureSpeechPlugin : BleService.Callback, FlutterPlugin {
result.error("ENABLERECORD_ERROR", e.message, null) result.error("ENABLERECORD_ERROR", e.message, null)
} }
} }
"pauseRecord" -> { "pauseRecord" -> {
azureAsrHelper.pauseRecord() azureAsrHelper.pauseRecord()
result.success(true) result.success(true)
} }
"stopRecord" -> { "stopRecord" -> {
val isSave = call.argument<Boolean>("isSave") ?: false val isSave = call.argument<Boolean>("isSave") ?: false
try { try {

3
local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/tools/RecordFile.kt

@ -1,4 +1,5 @@
package com.yunqiinnovation.azure_speech.tools package com.yunqiinnovation.azure_speech.tools
import java.io.File import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
import java.io.RandomAccessFile import java.io.RandomAccessFile
@ -156,6 +157,7 @@ import java.util.concurrent.atomic.AtomicBoolean
false false
} }
} }
/** /**
* 移动文件到新路径 * 移动文件到新路径
* @param sourcePath 原始文件完整路径 * @param sourcePath 原始文件完整路径
@ -213,6 +215,7 @@ import java.util.concurrent.atomic.AtomicBoolean
false false
} }
} }
internal fun closeFile(isSave: Boolean): Boolean { internal fun closeFile(isSave: Boolean): Boolean {
try { try {
if (fos == null || currentAudioFile == null) { if (fos == null || currentAudioFile == null) {

4
local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleService.kt

@ -16,14 +16,10 @@ import com.jieli.jl_audio_decode.exceptions.OpusException
import java.io.File import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
import java.io.RandomAccessFile
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date import java.util.Date
import java.util.concurrent.BlockingQueue
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
import android.os.Handler import android.os.Handler
import android.os.HandlerThread
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import android.util.Log import android.util.Log
/** /**

3
local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

@ -297,8 +297,7 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
Log.i("TAG", "onAttachedToEngine") Log.i("TAG", "onAttachedToEngine")
result.success("") result.success("")
} } else if (call.method == "startUpgrading") {
else if (call.method == "startUpgrading") {
Log.d("TAG", "startUpgrading") Log.d("TAG", "startUpgrading")
// 接收传入的参数 // 接收传入的参数
val arguments = call.arguments as? Map<String, Any> val arguments = call.arguments as? Map<String, Any>

Loading…
Cancel
Save