You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
852 B
33 lines
852 B
import 'dart:async';
|
|
import 'package:get/get.dart';
|
|
import '../models/events/voice_interaction_event.dart';
|
|
|
|
/// 语音交互服务抽象基类
|
|
///
|
|
/// 定义了iOS和Android平台共用的语音交互服务接口
|
|
abstract class VoiceInteractionService {
|
|
/// 事件流,用于发布语音交互相关事件
|
|
Stream<VoiceInteractionEvent> get eventStream;
|
|
|
|
/// 初始化服务
|
|
///
|
|
/// 返回服务实例自身,以支持链式调用
|
|
Future<VoiceInteractionService> initialize();
|
|
|
|
/// 暂停语音交互
|
|
///
|
|
/// 停止正在进行的语音识别和TTS播放
|
|
void pauseVoiceInteraction();
|
|
|
|
/// 唤醒语音交互
|
|
void onWakeup();
|
|
|
|
/// 是否处于活跃状态
|
|
bool isActive();
|
|
|
|
/// 获取当前对话历史
|
|
List<Map<String, String>> getMessageHistory();
|
|
|
|
/// 获取当前服务ID
|
|
String getServiceId();
|
|
}
|