-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathzego_express_api_ai_voice_changer.dart
44 lines (40 loc) · 1.93 KB
/
zego_express_api_ai_voice_changer.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import 'zego_express_api.dart';
import 'impl/zego_express_impl.dart';
import 'zego_express_defines.dart';
// ignore_for_file: deprecated_member_use_from_same_package
extension ZegoExpressEngineAIVoiceChanger on ZegoExpressEngine {
/// Creates an AI voice changer instance.
///
/// Available since: 3.10.0
/// Description: Creates an AI voice changer instance.
/// Use case: Often used in live broadcasting, voice chatroom and KTV.
/// When to call: It can be called after the SDK by [createEngine] has been initialized.
/// Restrictions: Currently, a maximum of 1 instance can be created, after which it will return null.
/// Related APIs: User can call [destroyAIVoiceChanger] function to destroy an AI voice changer instance.
///
/// - Returns AI voice changer instance.
Future<ZegoAIVoiceChanger?> createAIVoiceChanger() async {
return await ZegoExpressImpl.instance.createAIVoiceChanger();
}
/// Destroys an AI voice changer instance.
///
/// Available since: 3.10.0
/// Description: Destroys the AI voice changer instance.
/// Related APIs: User can call [createAIVoiceChanger] function to create an AI voice changer instance.
///
/// - [aiVoiceChanger] The AI voice changer instance object to be destroyed.
Future<void> destroyAIVoiceChanger(ZegoAIVoiceChanger aiVoiceChanger) async {
return await ZegoExpressImpl.instance.destroyAIVoiceChanger(aiVoiceChanger);
}
/// Check the device can run AI voice changer or not.
///
/// Available since: 3.14.0
/// Description: Check the device can run AI voice changer or not.
/// Use case: Often used in live broadcasting, voice chatroom and KTV.
/// When to call: It can be called after the SDK by [createEngine] has been initialized.
///
/// - Returns Return true if the device can run AI voice changer, otherwise return false.
Future<bool> isAIVoiceChangerSupported() async {
return await ZegoExpressImpl.instance.isAIVoiceChangerSupported();
}
}