@byteplus/rtc 4.63.2 → 4.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,91 @@
1
1
  // Generated by dts-bundle-generator v8.0.1
2
2
 
3
- export declare class IRTCAIAnsExtension {
3
+ import { EventEmitter } from 'eventemitter3';
4
+
5
+ declare enum StreamIndex {
6
+ STREAM_INDEX_MAIN = 0,
7
+ STREAM_INDEX_SCREEN = 1
8
+ }
9
+ export declare class IRTCAIAnsExtension extends EventEmitter<EventDict> {
10
+ constructor(options?: Partial<IRTCAIAnsExtensionConfig>);
4
11
 
5
12
  /**
6
13
  * @brief Enables AI noise cancellation.
7
14
  * @notes The AI noise cancellation is applicable to internal captured audio.
8
15
  */
9
- enable: () => void;
16
+ enable: (constraint?: StreamSelectConstraint) => void;
10
17
 
11
18
  /**
12
19
  * @brief Disables AI noise cancellation.
13
20
  */
14
- disable: () => void;
21
+ disable: (constraint?: StreamSelectConstraint) => void;
22
+ isSupported: () => boolean;
23
+ setAnsMode: (ansMode: AnsMode) => Promise<void>;
24
+ dump: <I extends StreamIndex>(streamIndex: I) => Promise<DumpFile<I>>;
25
+ }
26
+ export declare enum AnsMode {
27
+ LOW = "low",
28
+ MEDIUM = "medium",
29
+ HIGH = "high",
30
+ AUTO = "auto"
31
+ }
32
+ export declare enum AudioSourceType {
33
+
34
+ /**
35
+ * @brief Custom audio source
36
+ */
37
+ AUDIO_SOURCE_TYPE_EXTERNAL = 0,
38
+
39
+ /**
40
+ * @brief Internal audio capture, referring to capture audio using the built-in module (the default)
41
+ */
42
+ AUDIO_SOURCE_TYPE_INTERNAL = 1
43
+ }
44
+ /**
45
+ * @hidden
46
+ */
47
+ export declare enum DumpType {
48
+ BEFORE_PROCESS = "before",
49
+ AFTER_PROCESS = "after"
50
+ }
51
+ export declare enum EventTypes {
52
+ onOverload = "onOverload",
53
+ onUnsupported = "onUnsupported"
15
54
  }
55
+ export interface EventDict {
56
+ [EventTypes.onOverload]: (data: {
57
+ elapsedTime: number;
58
+ }) => void;
59
+ [EventTypes.onUnsupported]: (data: {
60
+ message: string;
61
+ }) => void;
62
+ }
63
+ export interface IRTCAIAnsExtensionConfig {
64
+ urls?: {
65
+ gulpUrl: string;
66
+ wasmUrl: string;
67
+ type5ModelUrl: string;
68
+ type6ModelUrl: string;
69
+ };
70
+ resample?: boolean;
71
+ }
72
+ /**
73
+ * @hidden
74
+ */
75
+ export type DumpFile<I extends StreamIndex> = {
76
+ [D in DumpType]: {
77
+ file: File;
78
+ name: DumpFileName<I, D>;
79
+ };
80
+ };
81
+ /**
82
+ * @hidden
83
+ */
84
+ export type DumpFileName<Index extends StreamIndex, Type extends DumpType> = `${Type}_${Index}_${number}.wav`;
85
+ export type StreamSelectConstraint = {
86
+ streamIndex: StreamIndex;
87
+ sourceType: AudioSourceType;
88
+ };
16
89
 
17
90
  export {
18
91
  IRTCAIAnsExtension as default,