@xmov/avatar 2.5.0-alpha.6 → 2.5.0-alpha.8
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.
- package/package-dist/agent/avatar.cjs +1 -1
- package/package-dist/agent/avatar.modern.js +1 -1
- package/package-dist/agent/avatar.module.js +1 -1
- package/package-dist/agent/avatar.umd.js +1 -1
- package/package-dist/agent/index.d.ts +3 -1
- package/package-dist/agent/public-types.d.ts +14 -0
- package/package-dist/index.cjs +1 -1
- package/package-dist/index.modern.js +1 -1
- package/package-dist/index.module.js +1 -1
- package/package-dist/index.umd.js +1 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarStatus, RenderState, Layout, WalkConfig, ICapabilityCheckReport } from "../public-types.js";
|
|
2
|
-
import type { XingyunAvatarAgentOptions, XingyunAvatarAgentInitParams, AgentASRStartOptions, AgentState, AgentASRState } from "./public-types.js";
|
|
2
|
+
import type { XingyunAvatarAgentOptions, XingyunAvatarAgentInitParams, AgentASRStartOptions, AgentPCMChunk, AgentState, AgentASRState } from "./public-types.js";
|
|
3
3
|
export * from "./public-types.js";
|
|
4
4
|
export default class XingyunAvatarAgent {
|
|
5
5
|
static checkCapability(audioOnlyMode?: boolean, hardwareAcceleration?: string): Promise<ICapabilityCheckReport>;
|
|
@@ -11,6 +11,8 @@ export default class XingyunAvatarAgent {
|
|
|
11
11
|
/** @deprecated Use speak instead. */
|
|
12
12
|
speakByE2E: (text: string) => Promise<void>;
|
|
13
13
|
startASR: (options?: AgentASRStartOptions) => Promise<void>;
|
|
14
|
+
/** Push PCM while a startASR({ pcm }) session is active. Throws synchronously on invalid input or overflow. */
|
|
15
|
+
pushASRAudio: (chunk: AgentPCMChunk) => void;
|
|
14
16
|
stopASR: () => Promise<void>;
|
|
15
17
|
interrupt: () => number;
|
|
16
18
|
interruptConversation: (reason?: string) => Promise<void>;
|
|
@@ -30,12 +30,26 @@ export interface AgentASRResult {
|
|
|
30
30
|
isFinal: boolean;
|
|
31
31
|
raw?: unknown;
|
|
32
32
|
}
|
|
33
|
+
export interface AgentASRPCMInputOptions {
|
|
34
|
+
/** Input sample rate, integer in 8000-48000. */
|
|
35
|
+
sampleRate: number;
|
|
36
|
+
/** Input channels; 2 means interleaved stereo. Defaults to 1. */
|
|
37
|
+
channels?: 1 | 2;
|
|
38
|
+
/** Start-up buffer in ms (0-1000, rounded up to 100 ms). Defaults to 200. */
|
|
39
|
+
jitterBufferMs?: number;
|
|
40
|
+
}
|
|
41
|
+
export type AgentPCMChunk = Int16Array | Float32Array;
|
|
33
42
|
export interface AgentASRStartOptions {
|
|
34
43
|
/**
|
|
35
44
|
* Optional caller-owned audio stream used instead of requesting the physical microphone.
|
|
36
45
|
* The Agent clones one live audio track and never stops the caller-owned stream.
|
|
37
46
|
*/
|
|
38
47
|
inputStream?: MediaStream;
|
|
48
|
+
/**
|
|
49
|
+
* Developer-pushed PCM input, fed with pushASRAudio(). Mutually exclusive with inputStream.
|
|
50
|
+
* The SDK emits silence for any 100 ms slot with no pushed data.
|
|
51
|
+
*/
|
|
52
|
+
pcm?: AgentASRPCMInputOptions;
|
|
39
53
|
}
|
|
40
54
|
export interface AgentLLMUsage {
|
|
41
55
|
promptTokens: number;
|