@spatialwalk/avatarkit 1.0.0-beta.27 → 1.0.0-beta.29
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/CHANGELOG.md +37 -4
- package/README.md +30 -31
- package/dist/StreamingAudioPlayer-C-_1X8K-.js +398 -0
- package/dist/animation/AnimationWebSocketClient.d.ts +0 -20
- package/dist/animation/utils/eventEmitter.d.ts +0 -3
- package/dist/animation/utils/flameConverter.d.ts +3 -10
- package/dist/audio/AnimationPlayer.d.ts +0 -46
- package/dist/audio/StreamingAudioPlayer.d.ts +0 -81
- package/dist/avatar_core_wasm-i0Ocpx6q.js +2693 -0
- package/dist/config/app-config.d.ts +1 -5
- package/dist/config/constants.d.ts +2 -10
- package/dist/config/sdk-config-loader.d.ts +2 -8
- package/dist/core/Avatar.d.ts +0 -6
- package/dist/core/AvatarController.d.ts +0 -111
- package/dist/core/AvatarDownloader.d.ts +0 -75
- package/dist/core/AvatarManager.d.ts +6 -13
- package/dist/core/AvatarSDK.d.ts +21 -0
- package/dist/core/AvatarView.d.ts +4 -103
- package/dist/core/NetworkLayer.d.ts +0 -6
- package/dist/generated/driveningress/v1/driveningress.d.ts +1 -11
- package/dist/generated/driveningress/v2/driveningress.d.ts +0 -2
- package/dist/generated/google/protobuf/struct.d.ts +5 -38
- package/dist/generated/google/protobuf/timestamp.d.ts +1 -102
- package/dist/index-BpVIIm3g.js +7921 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +17 -17
- package/dist/renderer/RenderSystem.d.ts +0 -8
- package/dist/renderer/covariance.d.ts +0 -11
- package/dist/renderer/sortSplats.d.ts +0 -10
- package/dist/renderer/webgl/reorderData.d.ts +0 -12
- package/dist/renderer/webgl/webglRenderer.d.ts +3 -39
- package/dist/renderer/webgpu/webgpuRenderer.d.ts +3 -27
- package/dist/types/character-settings.d.ts +0 -4
- package/dist/types/character.d.ts +3 -9
- package/dist/types/index.d.ts +14 -21
- package/dist/utils/animation-interpolation.d.ts +3 -12
- package/dist/utils/client-id.d.ts +0 -5
- package/dist/utils/cls-tracker.d.ts +5 -26
- package/dist/utils/conversationId.d.ts +0 -18
- package/dist/utils/error-utils.d.ts +1 -24
- package/dist/utils/heartbeat-manager.d.ts +0 -26
- package/dist/utils/id-manager.d.ts +0 -23
- package/dist/utils/logger.d.ts +1 -4
- package/dist/utils/usage-tracker.d.ts +2 -17
- package/dist/wasm/avatarCoreAdapter.d.ts +0 -134
- package/dist/wasm/avatarCoreMemory.d.ts +0 -52
- package/package.json +1 -1
- package/dist/StreamingAudioPlayer-C6v9Ed55.js +0 -352
- package/dist/avatar_core_wasm-BPIbbUx_.js +0 -1663
- package/dist/core/AvatarKit.d.ts +0 -48
- package/dist/index-s9KqPWVW.js +0 -6770
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Environment } from '../types';
|
|
2
2
|
export declare const CLS_TRACK_EVENTS: boolean;
|
|
3
|
-
|
|
4
|
-
* 获取 CLS 配置(需要传入环境)
|
|
5
|
-
*/
|
|
3
|
+
|
|
6
4
|
export declare function getCLSConfig(environment: Environment): {
|
|
7
5
|
endpoint: string;
|
|
8
6
|
topicId: string;
|
|
@@ -18,11 +16,5 @@ export declare const CLS_CONFIG: {
|
|
|
18
16
|
token: string;
|
|
19
17
|
};
|
|
20
18
|
export declare const ENV_TEST: boolean;
|
|
21
|
-
|
|
22
|
-
* Comprehensive debug mode check
|
|
23
|
-
* Returns true if:
|
|
24
|
-
* - VITE_ENV_TEST is 'true', OR
|
|
25
|
-
* - Running in DEV mode, OR
|
|
26
|
-
* - URL has debug=1 parameter
|
|
27
|
-
*/
|
|
19
|
+
|
|
28
20
|
export declare function isDebugMode(): boolean;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { Environment } from '../types';
|
|
2
|
-
|
|
3
|
-
* 从远程配置接口获取 SDK 配置
|
|
4
|
-
* @param version SDK 版本号
|
|
5
|
-
* @returns 解析后的配置映射
|
|
6
|
-
*/
|
|
2
|
+
|
|
7
3
|
export declare function fetchSdkConfig(version: string): Promise<Partial<Record<Environment, string>>>;
|
|
8
|
-
|
|
9
|
-
* 清除配置缓存(用于测试或重新加载)
|
|
10
|
-
*/
|
|
4
|
+
|
|
11
5
|
export declare function clearSdkConfigCache(): void;
|
package/dist/core/Avatar.d.ts
CHANGED
|
@@ -4,11 +4,5 @@ export declare class Avatar {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
private characterMeta;
|
|
6
6
|
private resources;
|
|
7
|
-
/**
|
|
8
|
-
* 构造函数(内部使用)
|
|
9
|
-
* @param id 数字人 ID
|
|
10
|
-
* @param characterMeta 角色元数据
|
|
11
|
-
* @param resources 资源数据
|
|
12
|
-
*/
|
|
13
7
|
constructor(id: string, characterMeta: CharacterMeta, resources: PreloadResult);
|
|
14
8
|
}
|
|
@@ -34,143 +34,32 @@ export declare class AvatarController {
|
|
|
34
34
|
constructor(avatar: Avatar, options?: {
|
|
35
35
|
playbackMode?: DrivingServiceMode;
|
|
36
36
|
});
|
|
37
|
-
/**
|
|
38
|
-
* Get current conversation ID
|
|
39
|
-
* Returns the current conversation ID for the active audio session
|
|
40
|
-
* @returns Current conversation ID, or null if no active session
|
|
41
|
-
*/
|
|
42
37
|
getCurrentConversationId(): string | null;
|
|
43
|
-
/**
|
|
44
|
-
* Start service (SDK mode only)
|
|
45
|
-
*/
|
|
46
38
|
start(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Send audio to server (SDK mode only)
|
|
49
|
-
* Also cache to data layer for playback
|
|
50
|
-
* @returns conversationId - Conversation ID for this audio session
|
|
51
|
-
*/
|
|
52
39
|
send(audioData: ArrayBuffer, end?: boolean): string | null;
|
|
53
|
-
/**
|
|
54
|
-
* Close service (SDK mode only)
|
|
55
|
-
*/
|
|
56
40
|
close(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Send audio data (host mode)
|
|
59
|
-
* Stream additional audio data after playback()
|
|
60
|
-
* @returns conversationId - Conversation ID for this audio session
|
|
61
|
-
*/
|
|
62
41
|
yieldAudioData(data: Uint8Array, isLast?: boolean): string | null;
|
|
63
|
-
/**
|
|
64
|
-
* Send animation keyframes (host mode or SDK mode)
|
|
65
|
-
* Stream additional animation data after playback()
|
|
66
|
-
* @param keyframes - Animation keyframes to send
|
|
67
|
-
* @param conversationId - Conversation ID (required). If conversationId doesn't match current conversationId, keyframes will be discarded.
|
|
68
|
-
* Use getCurrentConversationId() to get the current conversationId.
|
|
69
|
-
*/
|
|
70
42
|
yieldFramesData(keyframes: Flame[], conversationId: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Pause playback (can be resumed later)
|
|
73
|
-
* Pause audio playback and stop render loop, but preserve all state (keyframes, audio buffers, etc.)
|
|
74
|
-
*/
|
|
75
43
|
pause(): void;
|
|
76
|
-
/**
|
|
77
|
-
* Resume playback (from paused state)
|
|
78
|
-
* Resume audio playback and restart render loop
|
|
79
|
-
* Animation will continue from paused frame (because animation time base comes from audio, will auto-sync)
|
|
80
|
-
*/
|
|
81
44
|
resume(): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Interrupt current playback
|
|
84
|
-
*/
|
|
85
45
|
interrupt(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Clear all data and resources
|
|
88
|
-
*/
|
|
89
46
|
clear(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Generate new conversation ID and log conversation started event
|
|
92
|
-
* @private
|
|
93
|
-
*/
|
|
94
47
|
private generateAndLogNewConversationId;
|
|
95
|
-
/**
|
|
96
|
-
* Clear playback data (keyframes, audio chunks, and playback state)
|
|
97
|
-
* @private
|
|
98
|
-
*/
|
|
99
48
|
private clearPlaybackData;
|
|
100
|
-
/**
|
|
101
|
-
* Reset conversation ID state (for both network and external modes)
|
|
102
|
-
* @private
|
|
103
|
-
*/
|
|
104
49
|
private resetConversationIdState;
|
|
105
|
-
/**
|
|
106
|
-
* Get effective conversation ID (handles both SDK and host modes)
|
|
107
|
-
* @private
|
|
108
|
-
*/
|
|
109
50
|
private getEffectiveConversationId;
|
|
110
|
-
/**
|
|
111
|
-
* 设置音频播放音量
|
|
112
|
-
* 注意:这仅控制数字人音频播放器的音量,不影响系统音量
|
|
113
|
-
* @param volume 音量值,范围 0.0 到 1.0(0.0 为静音,1.0 为最大音量)
|
|
114
|
-
*/
|
|
115
51
|
setVolume(volume: number): void;
|
|
116
|
-
/**
|
|
117
|
-
* 获取当前音频播放音量
|
|
118
|
-
* @returns 当前音量值 (0.0 - 1.0)
|
|
119
|
-
*/
|
|
120
52
|
getVolume(): number;
|
|
121
|
-
/**
|
|
122
|
-
* Start streaming playback (internal implementation)
|
|
123
|
-
*/
|
|
124
53
|
private startStreamingPlaybackInternal;
|
|
125
|
-
/**
|
|
126
|
-
* Playback loop: Calculate animation frame based on audio time, notify render layer to render
|
|
127
|
-
*/
|
|
128
54
|
private startPlaybackLoop;
|
|
129
|
-
/**
|
|
130
|
-
* Stop playback loop
|
|
131
|
-
*/
|
|
132
55
|
private stopPlaybackLoop;
|
|
133
|
-
/**
|
|
134
|
-
* 启用音频独立播放模式(当服务器错误或超时时调用)
|
|
135
|
-
* 此模式下,音频会独立播放,不依赖动画数据
|
|
136
|
-
* 一旦启用,本次会话后续的动画数据将被忽略
|
|
137
|
-
* @private
|
|
138
|
-
*/
|
|
139
56
|
private enableAudioOnlyMode;
|
|
140
|
-
/**
|
|
141
|
-
* 音频独立播放(完全独立的逻辑,不影响正常播放流程)
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
57
|
private startAudioOnlyPlayback;
|
|
145
|
-
/**
|
|
146
|
-
* 音频监控循环(仅用于音频独立模式)
|
|
147
|
-
* 只检测音频是否结束,不进行动画渲染
|
|
148
|
-
* @private
|
|
149
|
-
*/
|
|
150
58
|
private startAudioMonitoringLoop;
|
|
151
|
-
/**
|
|
152
|
-
* Stop playback
|
|
153
|
-
*/
|
|
154
59
|
protected stopPlayback(): void;
|
|
155
|
-
/**
|
|
156
|
-
* Clean up players
|
|
157
|
-
*/
|
|
158
60
|
protected cleanupPlayers(): void;
|
|
159
|
-
/**
|
|
160
|
-
* Add audio chunk to buffer
|
|
161
|
-
*/
|
|
162
61
|
private addAudioChunkToBuffer;
|
|
163
|
-
/**
|
|
164
|
-
* Event system
|
|
165
|
-
*/
|
|
166
62
|
private registerEventListener;
|
|
167
|
-
/**
|
|
168
|
-
* Emit event
|
|
169
|
-
*/
|
|
170
63
|
protected emit(event: string, data?: any): void;
|
|
171
|
-
/**
|
|
172
|
-
* 上报 driving_latency 事件(Host 模式)
|
|
173
|
-
* @private
|
|
174
|
-
*/
|
|
175
64
|
private reportDrivingLatency;
|
|
176
65
|
}
|
|
@@ -1,80 +1,5 @@
|
|
|
1
|
-
import { CharacterMeta, PreloadCameraSettings } from '../types/character';
|
|
2
|
-
import { CharacterSettings } from '../types/character-settings';
|
|
3
|
-
interface ProgressInfo {
|
|
4
|
-
stage: string;
|
|
5
|
-
filename: string;
|
|
6
|
-
loaded: number;
|
|
7
|
-
total: number;
|
|
8
|
-
progress: number;
|
|
9
|
-
}
|
|
10
|
-
type ProgressCallback = (info: ProgressInfo) => void;
|
|
11
|
-
interface TemplateResources {
|
|
12
|
-
[key: string]: ArrayBuffer;
|
|
13
|
-
}
|
|
14
|
-
interface FlameResources {
|
|
15
|
-
flameModel?: {
|
|
16
|
-
remote?: string;
|
|
17
|
-
};
|
|
18
|
-
flameTemplate?: {
|
|
19
|
-
remote?: string;
|
|
20
|
-
};
|
|
21
|
-
teethPb?: {
|
|
22
|
-
remote?: string;
|
|
23
|
-
};
|
|
24
|
-
teethNpz?: {
|
|
25
|
-
remote?: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
interface CharacterDataResult {
|
|
29
|
-
shape: ArrayBuffer;
|
|
30
|
-
pointCloud: ArrayBuffer;
|
|
31
|
-
idleAnimation?: ArrayBuffer;
|
|
32
|
-
}
|
|
33
|
-
export interface PreloadResult {
|
|
34
|
-
templateResources: TemplateResources;
|
|
35
|
-
characterData: CharacterDataResult;
|
|
36
|
-
preloadCameraSettings?: PreloadCameraSettings;
|
|
37
|
-
characterSettings?: CharacterSettings;
|
|
38
|
-
}
|
|
39
1
|
export declare class AvatarDownloader {
|
|
40
2
|
private baseAssetsPath;
|
|
41
3
|
constructor(baseAssetsPath?: string);
|
|
42
|
-
/**
|
|
43
|
-
* Load template resources from CharacterMeta flame CDN URLs
|
|
44
|
-
* Falls back to global CDN config if not provided by API
|
|
45
|
-
*/
|
|
46
|
-
loadTemplateResources(flameResources?: FlameResources, progressCallback?: ProgressCallback | null): Promise<TemplateResources>;
|
|
47
|
-
/**
|
|
48
|
-
* Load camera settings from CharacterMeta (optional)
|
|
49
|
-
*/
|
|
50
|
-
loadCameraSettings(characterMeta: CharacterMeta): Promise<PreloadCameraSettings | undefined>;
|
|
51
|
-
/**
|
|
52
|
-
* Load character data from CharacterMeta (iOS compatible)
|
|
53
|
-
*/
|
|
54
|
-
loadCharacterData(characterMeta: CharacterMeta, options?: {
|
|
55
|
-
progressCallback?: ProgressCallback | null;
|
|
56
|
-
}): Promise<CharacterDataResult>;
|
|
57
|
-
/**
|
|
58
|
-
* Preload all resources (template + character data + camera info + settings)
|
|
59
|
-
*/
|
|
60
|
-
preloadResources(characterMeta: CharacterMeta, options?: {
|
|
61
|
-
progressCallback?: ProgressCallback | null;
|
|
62
|
-
}): Promise<PreloadResult>;
|
|
63
|
-
/**
|
|
64
|
-
* Clear cached assets (no-op, kept for API compatibility)
|
|
65
|
-
*/
|
|
66
|
-
clear(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Get SPAvatarKit SDK API Client (api.open.spatialwalk.top for cn, api.open.spatialwalk.cloud for intl)
|
|
69
|
-
* Used for: character details and resource URLs (public endpoints, no auth required)
|
|
70
|
-
*/
|
|
71
4
|
private getSdkApiClient;
|
|
72
|
-
/**
|
|
73
|
-
* Get single character by ID from SPAvatarKit SDK API (v2, iOS compatible)
|
|
74
|
-
* Domain: api.open.spatialwalk.top (cn) / api.open.spatialwalk.cloud (intl)
|
|
75
|
-
* Auth: Public endpoint, no authentication required
|
|
76
|
-
* Returns CharacterMeta with nested resource structure
|
|
77
|
-
*/
|
|
78
|
-
getCharacterById(characterId: string): Promise<CharacterMeta>;
|
|
79
5
|
}
|
|
80
|
-
export {};
|
|
@@ -3,20 +3,13 @@ import { Avatar } from './Avatar';
|
|
|
3
3
|
export declare class AvatarManager {
|
|
4
4
|
private static _instance;
|
|
5
5
|
private avatarDownloader;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
6
|
+
private avatarCache;
|
|
7
|
+
private loadingPromises;
|
|
9
8
|
static get shared(): AvatarManager;
|
|
10
|
-
/**
|
|
11
|
-
* 加载数字人
|
|
12
|
-
* @param id 数字人 ID
|
|
13
|
-
* @param onProgress 进度回调
|
|
14
|
-
* @param options 加载选项
|
|
15
|
-
* @returns Promise<Avatar>
|
|
16
|
-
*/
|
|
17
9
|
load(id: string, onProgress?: (progress: LoadProgressInfo) => void): Promise<Avatar>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
private doLoad;
|
|
11
|
+
retrieve(id: string): Avatar | undefined;
|
|
12
|
+
clear(id: string): void;
|
|
13
|
+
clearAll(): void;
|
|
21
14
|
clearCache(): void;
|
|
22
15
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Configuration } from '../types';
|
|
2
|
+
export declare class AvatarSDK {
|
|
3
|
+
private static _isInitialized;
|
|
4
|
+
private static _configuration;
|
|
5
|
+
private static readonly _version;
|
|
6
|
+
private static _avatarCore;
|
|
7
|
+
private static _dynamicSdkConfig;
|
|
8
|
+
static initialize(appId: string, configuration: Configuration): Promise<void>;
|
|
9
|
+
private static initializeWASMModule;
|
|
10
|
+
private static initializeTemplateResources;
|
|
11
|
+
static setSessionToken(token: string): void;
|
|
12
|
+
static setUserId(userId: string): void;
|
|
13
|
+
static get isInitialized(): boolean;
|
|
14
|
+
static get appId(): string | null;
|
|
15
|
+
static get configuration(): Configuration | null;
|
|
16
|
+
static get sessionToken(): string | null;
|
|
17
|
+
static get userId(): string | null;
|
|
18
|
+
static get version(): string;
|
|
19
|
+
static cleanup(): void;
|
|
20
|
+
private static _fetchSdkConfig;
|
|
21
|
+
}
|
|
@@ -26,138 +26,39 @@ export declare class AvatarView {
|
|
|
26
26
|
private idleCurrentFrameIndex;
|
|
27
27
|
private characterHandle;
|
|
28
28
|
private characterId;
|
|
29
|
-
|
|
30
|
-
* 对齐两端 Flame 维度:标量统一长度,expression 取最大长度并零填充
|
|
31
|
-
*/
|
|
29
|
+
private _isOpaque;
|
|
32
30
|
private alignFlamePair;
|
|
33
|
-
/**
|
|
34
|
-
* 生成并对齐过渡帧,确保首尾帧与起止帧完全一致
|
|
35
|
-
*/
|
|
36
31
|
private generateAndAlignTransitionFrames;
|
|
37
|
-
/**
|
|
38
|
-
* 获取缓存的 Idle 首帧,如果未缓存则获取并缓存
|
|
39
|
-
*/
|
|
40
32
|
private getCachedIdleFirstFrame;
|
|
41
|
-
/**
|
|
42
|
-
* 构造函数
|
|
43
|
-
* 创建统一的 AvatarController,内部根据配置自动组合网络层
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* 构造函数
|
|
47
|
-
* 创建统一的 AvatarController,内部根据配置自动组合网络层
|
|
48
|
-
* @param avatar - Avatar 实例
|
|
49
|
-
* @param container - Canvas 容器元素(必选)
|
|
50
|
-
*/
|
|
51
33
|
constructor(avatar: Avatar, container: HTMLElement);
|
|
52
|
-
/**
|
|
53
|
-
* 获取控制器(公共接口)
|
|
54
|
-
*/
|
|
55
34
|
get controller(): AvatarController;
|
|
56
|
-
/**
|
|
57
|
-
* 创建canvas元素
|
|
58
|
-
*/
|
|
59
35
|
private createCanvas;
|
|
60
|
-
/**
|
|
61
|
-
* 初始化视图系统
|
|
62
|
-
*/
|
|
63
36
|
private initializeView;
|
|
64
|
-
/**
|
|
65
|
-
* 初始化渲染系统
|
|
66
|
-
*/
|
|
67
37
|
private initializeRenderSystem;
|
|
68
|
-
/**
|
|
69
|
-
* 获取默认相机配置
|
|
70
|
-
*/
|
|
71
38
|
private getDefaultCameraConfig;
|
|
72
|
-
/**
|
|
73
|
-
* 根据资源解析最终的相机配置,优先使用角色设置,其次 camera.json
|
|
74
|
-
*/
|
|
75
39
|
private resolveCameraConfig;
|
|
76
|
-
/**
|
|
77
|
-
* 从角色设置中推导相机配置
|
|
78
|
-
*/
|
|
79
40
|
private deriveCameraConfigFromSettings;
|
|
80
|
-
/**
|
|
81
|
-
* 渲染第一帧
|
|
82
|
-
*/
|
|
83
41
|
private renderFirstFrame;
|
|
84
|
-
/**
|
|
85
|
-
* 更新 FPS 统计(在 requestAnimationFrame 回调中调用)
|
|
86
|
-
*/
|
|
87
42
|
private updateFPS;
|
|
88
|
-
/**
|
|
89
|
-
* 初始化 FPS 计算
|
|
90
|
-
*/
|
|
91
43
|
private initFPS;
|
|
92
|
-
/**
|
|
93
|
-
* 开始idle动画循环
|
|
94
|
-
*/
|
|
95
44
|
private startIdleAnimationLoop;
|
|
96
|
-
/**
|
|
97
|
-
* 开始实时对话动画循环
|
|
98
|
-
*/
|
|
99
45
|
private startRealtimeAnimationLoop;
|
|
100
|
-
/**
|
|
101
|
-
* 停止idle动画循环
|
|
102
|
-
*/
|
|
103
46
|
private stopIdleAnimationLoop;
|
|
104
|
-
/**
|
|
105
|
-
* 停止实时对话动画循环
|
|
106
|
-
*/
|
|
107
47
|
private stopRealtimeAnimationLoop;
|
|
108
|
-
/**
|
|
109
|
-
* 停止所有动画循环
|
|
110
|
-
*/
|
|
111
48
|
private stopAllAnimationLoops;
|
|
112
|
-
/**
|
|
113
|
-
* 渲染实时帧(由播放层回调调用)
|
|
114
|
-
*/
|
|
115
49
|
private renderRealtimeFrame;
|
|
116
|
-
/**
|
|
117
|
-
* 状态转换方法
|
|
118
|
-
* 统一管理状态转换,确保状态一致性
|
|
119
|
-
*/
|
|
120
50
|
private setState;
|
|
121
|
-
/**
|
|
122
|
-
* 检查是否在实时播放状态(Speaking 或过渡到 Speaking)
|
|
123
|
-
*/
|
|
124
51
|
private get isRealtimePlaying();
|
|
125
|
-
/**
|
|
126
|
-
* 检查是否在过渡中
|
|
127
|
-
*/
|
|
128
52
|
private get isTransitioning();
|
|
129
|
-
/**
|
|
130
|
-
* 检查过渡结束后是否回到 Idle
|
|
131
|
-
*/
|
|
132
53
|
private get endToIdleAfterTransition();
|
|
133
|
-
/**
|
|
134
|
-
* 处理打断
|
|
135
|
-
* 打断时应该生成过渡动画,而不是直接跳回 Idle
|
|
136
|
-
*/
|
|
137
54
|
private handleInterrupt;
|
|
138
|
-
/**
|
|
139
|
-
* 设置 AvatarController 事件监听器
|
|
140
|
-
*/
|
|
141
55
|
private setupControllerEventListeners;
|
|
142
|
-
/**
|
|
143
|
-
* 准备实时渲染(生成 Idle -> Speaking 过渡)
|
|
144
|
-
*/
|
|
145
56
|
private prepareRealtimeRendering;
|
|
146
|
-
/**
|
|
147
|
-
* 开始实时渲染循环
|
|
148
|
-
*/
|
|
149
57
|
private startRealtimeRendering;
|
|
150
|
-
/**
|
|
151
|
-
* 停止实时对话渲染
|
|
152
|
-
*/
|
|
153
58
|
private stopRealtimeRendering;
|
|
154
|
-
/**
|
|
155
|
-
* 清理视图资源
|
|
156
|
-
* 关闭 avatarController 并清理所有相关资源
|
|
157
|
-
*/
|
|
158
59
|
dispose(): void;
|
|
159
|
-
/**
|
|
160
|
-
* 处理尺寸变化:通知渲染系统更新视口与投影
|
|
161
|
-
*/
|
|
162
60
|
private handleResize;
|
|
61
|
+
get isOpaque(): boolean;
|
|
62
|
+
set isOpaque(value: boolean);
|
|
63
|
+
setBackgroundImage(image: HTMLImageElement | string | null): void;
|
|
163
64
|
}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NetworkLayer - Network communication layer
|
|
3
|
-
* Responsible for WebSocket connections, protocol handling, and data retrieval
|
|
4
|
-
* Automatically calls AvatarController (playback layer) interfaces after obtaining data
|
|
5
|
-
* @internal Not part of public API
|
|
6
|
-
*/
|
|
7
1
|
export {};
|
|
@@ -9,29 +9,19 @@ export declare enum MessageType {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function messageTypeFromJSON(object: any): MessageType;
|
|
11
11
|
export declare function messageTypeToJSON(object: MessageType): string;
|
|
12
|
-
|
|
13
|
-
* 兼容流式传输,只要 req_id 相同,客户端可以将音频分段发若干个 ClientAudioInputData
|
|
14
|
-
* 新 req_id 出现后,老 req_id 的请求将被忽略
|
|
15
|
-
*/
|
|
12
|
+
|
|
16
13
|
export interface ClientAudioInputData {
|
|
17
14
|
reqId: string;
|
|
18
15
|
audio: Uint8Array;
|
|
19
16
|
end: boolean;
|
|
20
17
|
}
|
|
21
18
|
export interface Flame {
|
|
22
|
-
/** 平移 */
|
|
23
19
|
translation: number[];
|
|
24
|
-
/** 旋转 */
|
|
25
20
|
rotation: number[];
|
|
26
|
-
/** 脖子 */
|
|
27
21
|
neckPose: number[];
|
|
28
|
-
/** 下巴 */
|
|
29
22
|
jawPose: number[];
|
|
30
|
-
/** 眼睛 */
|
|
31
23
|
eyePose: number[];
|
|
32
|
-
/** 眼皮 */
|
|
33
24
|
eyeLid: number[];
|
|
34
|
-
/** 表情参数 */
|
|
35
25
|
expression: number[];
|
|
36
26
|
}
|
|
37
27
|
export interface FlameAnimation {
|
|
@@ -5,9 +5,7 @@ export interface GetCharacterInfoRequest {
|
|
|
5
5
|
characterId: string;
|
|
6
6
|
}
|
|
7
7
|
export interface CharacterAsset {
|
|
8
|
-
/** 资产ID,例如 "v1/xxx" */
|
|
9
8
|
characterId: string;
|
|
10
|
-
/** 资产版本,例如 "1.0.0" */
|
|
11
9
|
version: string;
|
|
12
10
|
createdAt?: Timestamp | undefined;
|
|
13
11
|
updatedAt?: Timestamp | undefined;
|
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
2
|
export declare const protobufPackage = "google.protobuf";
|
|
3
|
-
|
|
4
|
-
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
5
|
-
* `Value` type union.
|
|
6
|
-
*
|
|
7
|
-
* The JSON representation for `NullValue` is JSON `null`.
|
|
8
|
-
*/
|
|
3
|
+
|
|
9
4
|
export declare enum NullValue {
|
|
10
|
-
|
|
5
|
+
|
|
11
6
|
NULL_VALUE = 0,
|
|
12
7
|
UNRECOGNIZED = -1
|
|
13
8
|
}
|
|
14
9
|
export declare function nullValueFromJSON(object: any): NullValue;
|
|
15
10
|
export declare function nullValueToJSON(object: NullValue): string;
|
|
16
|
-
|
|
17
|
-
* `Struct` represents a structured data value, consisting of fields
|
|
18
|
-
* which map to dynamically typed values. In some languages, `Struct`
|
|
19
|
-
* might be supported by a native representation. For example, in
|
|
20
|
-
* scripting languages like JS a struct is represented as an
|
|
21
|
-
* object. The details of that representation are described together
|
|
22
|
-
* with the proto support for the language.
|
|
23
|
-
*
|
|
24
|
-
* The JSON representation for `Struct` is JSON object.
|
|
25
|
-
*/
|
|
11
|
+
|
|
26
12
|
export interface Struct {
|
|
27
|
-
/** Unordered map of dynamically typed values. */
|
|
28
13
|
fields: {
|
|
29
14
|
[key: string]: any | undefined;
|
|
30
15
|
};
|
|
@@ -33,37 +18,19 @@ export interface Struct_FieldsEntry {
|
|
|
33
18
|
key: string;
|
|
34
19
|
value?: any | undefined;
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
* `Value` represents a dynamically typed value which can be either
|
|
38
|
-
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
39
|
-
* list of values. A producer of value is expected to set one of these
|
|
40
|
-
* variants. Absence of any variant indicates an error.
|
|
41
|
-
*
|
|
42
|
-
* The JSON representation for `Value` is JSON value.
|
|
43
|
-
*/
|
|
21
|
+
|
|
44
22
|
export interface Value {
|
|
45
|
-
/** Represents a null value. */
|
|
46
23
|
nullValue?: NullValue | undefined;
|
|
47
|
-
/** Represents a double value. */
|
|
48
24
|
numberValue?: number | undefined;
|
|
49
|
-
/** Represents a string value. */
|
|
50
25
|
stringValue?: string | undefined;
|
|
51
|
-
/** Represents a boolean value. */
|
|
52
26
|
boolValue?: boolean | undefined;
|
|
53
|
-
/** Represents a structured value. */
|
|
54
27
|
structValue?: {
|
|
55
28
|
[key: string]: any;
|
|
56
29
|
} | undefined;
|
|
57
|
-
/** Represents a repeated `Value`. */
|
|
58
30
|
listValue?: Array<any> | undefined;
|
|
59
31
|
}
|
|
60
|
-
|
|
61
|
-
* `ListValue` is a wrapper around a repeated field of values.
|
|
62
|
-
*
|
|
63
|
-
* The JSON representation for `ListValue` is JSON array.
|
|
64
|
-
*/
|
|
32
|
+
|
|
65
33
|
export interface ListValue {
|
|
66
|
-
/** Repeated field of dynamically typed values. */
|
|
67
34
|
values: any[];
|
|
68
35
|
}
|
|
69
36
|
export declare const Struct: MessageFns<Struct> & StructWrapperFns;
|