Browse Source

Merge branch 'new_dev' of https://github.com/deepcloud2048/deep_voice into new_dev

weicu
liwei1dao 1 year ago
parent
commit
80e82b95df
  1. 8
      lib/modules/home/controllers/home_controller.dart
  2. 2
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift
  3. 4
      local_plugins/azure_speech/ios/azure_speech/Sources/tools/MicrophoneCapture.swift
  4. 3
      local_plugins/ble_service/ios/ble_service/Sources/ble_service/BleService.swift

8
lib/modules/home/controllers/home_controller.dart

@ -145,12 +145,16 @@ class HomeController extends GetxController {
update();
if (!wasConnected && isNowConnected) {
await _bleManager.fetchDeviceInfo();
// 连接成功后等待1秒再获取设备信息
Future.delayed(const Duration(seconds: 1), () async {
await _bleManager.fetchDeviceInfo();
});
// 连接成功后立即刷新一次电池信息
Future.delayed(const Duration(milliseconds: 500), () {
_refreshBatteryInfo();
});
// 连接成功后检查OTA升级
Future.delayed(const Duration(seconds: 2), () {
_checkOtaUpgrade();

2
local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

@ -432,7 +432,7 @@ class AgentServiceImpl: NSObject {
}
stopIdleCheck()
BleService.shared.closeCodec()
// 重置识别模式
currentRecognitionMode = "normal"

4
local_plugins/azure_speech/ios/azure_speech/Sources/tools/MicrophoneCapture.swift

@ -51,9 +51,9 @@ class MicrophoneCapture: NSObject {
// 设置音频会话参数
try audioSession.setCategory(.playAndRecord,
mode: .videoChat,
options: [//.allowBluetooth,
options: [//.allowBluetooth, // 允许蓝牙耳机,占用hfp链路
// .allowAirPlay,
.allowBluetoothA2DP,
.allowBluetoothA2DP,// 允许蓝牙耳机,不占用hfp链路
.mixWithOthers,
.defaultToSpeaker
])

3
local_plugins/ble_service/ios/ble_service/Sources/ble_service/BleService.swift

@ -644,7 +644,8 @@ private var cmdReplyType: UInt8 = 0
}
/// 关闭编解码器并停止录制
func closeCodec() -> Bool {
/// - Returns: 操作是否成功
public func closeCodec() -> Bool {
os_log("关闭编解码并停止录制...", log: logger, type: .info)
// 停止录制

Loading…
Cancel
Save