@spatialwalk/avatarkit 1.0.0-beta.56 → 1.0.0-beta.57
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 +7 -0
- package/dist/{StreamingAudioPlayer-BL5cZ22i.js → StreamingAudioPlayer-Co3xec_k.js} +1 -1
- package/dist/core/AvatarView.d.ts +2 -0
- package/dist/docs/render-flame-api-example.d.ts +28 -0
- package/dist/{index-C4RgEOS1.js → index-cfYSlUmQ.js} +29 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.0-beta.57] - 2026-01-09
|
|
6
|
+
|
|
7
|
+
### 🐛 Bugfixes
|
|
8
|
+
- **Idle Animation Jiggle Fix** - Fixed issue where idle animation would "jiggle" before transitioning to speaking when external audio and animation data were sent. The `handleInterrupt()` method now correctly skips processing when already in `Idle` state, preventing unnecessary idle loop restarts.
|
|
9
|
+
|
|
10
|
+
## [1.0.0-beta.56] - 2026-01-09
|
|
11
|
+
|
|
5
12
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
13
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
14
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-
|
|
4
|
+
import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-cfYSlUmQ.js";
|
|
5
5
|
class StreamingAudioPlayer {
|
|
6
6
|
constructor(options) {
|
|
7
7
|
__publicField(this, "audioContext", null);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Flame } from '../generated/driveningress/v1/driveningress';
|
|
1
2
|
import { Avatar } from './Avatar';
|
|
2
3
|
import { AvatarController } from './AvatarController';
|
|
3
4
|
export declare class AvatarView {
|
|
@@ -56,6 +57,7 @@ export declare class AvatarView {
|
|
|
56
57
|
private startRealtimeRendering;
|
|
57
58
|
private stopRealtimeRendering;
|
|
58
59
|
dispose(): void;
|
|
60
|
+
renderFlame(flame: Flame): Promise<void>;
|
|
59
61
|
private rerenderCurrentFrameWithNewCamera;
|
|
60
62
|
private handleResize;
|
|
61
63
|
get transform(): {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AvatarView, Flame } from '@spatialwalk/avatarkit';
|
|
2
|
+
declare function initializeSDK(): Promise<void>;
|
|
3
|
+
declare function createAvatarView(characterId: string, container: HTMLElement): Promise<AvatarView>;
|
|
4
|
+
declare function fetchFlameDataFromServer(characterId: string, audioData: ArrayBuffer): Promise<Flame[]>;
|
|
5
|
+
declare class FlameRenderer {
|
|
6
|
+
private avatarView;
|
|
7
|
+
private keyframes;
|
|
8
|
+
private currentFrameIndex;
|
|
9
|
+
private animationFrameId;
|
|
10
|
+
private isPlaying;
|
|
11
|
+
private fps;
|
|
12
|
+
private frameInterval;
|
|
13
|
+
private lastRenderTime;
|
|
14
|
+
constructor(avatarView: AvatarView);
|
|
15
|
+
setKeyframes(keyframes: Flame[]): void;
|
|
16
|
+
start(): void;
|
|
17
|
+
stop(): void;
|
|
18
|
+
renderFrame(frameIndex: number): Promise<void>;
|
|
19
|
+
private renderLoop;
|
|
20
|
+
setFPS(fps: number): void;
|
|
21
|
+
seek(frameIndex: number): void;
|
|
22
|
+
getCurrentFrameIndex(): number;
|
|
23
|
+
getTotalFrames(): number;
|
|
24
|
+
}
|
|
25
|
+
declare function main(): Promise<void>;
|
|
26
|
+
declare function fetchAudioData(): Promise<ArrayBuffer>;
|
|
27
|
+
|
|
28
|
+
export { initializeSDK, createAvatarView, fetchFlameDataFromServer, FlameRenderer, main, fetchAudioData };
|
|
@@ -7639,7 +7639,7 @@ const _AnimationPlayer = class _AnimationPlayer {
|
|
|
7639
7639
|
if (this.streamingPlayer) {
|
|
7640
7640
|
return;
|
|
7641
7641
|
}
|
|
7642
|
-
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-
|
|
7642
|
+
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-Co3xec_k.js");
|
|
7643
7643
|
const { AvatarSDK: AvatarSDK2 } = await Promise.resolve().then(() => AvatarSDK$1);
|
|
7644
7644
|
const audioFormat = AvatarSDK2.getAudioFormat();
|
|
7645
7645
|
this.streamingPlayer = new StreamingAudioPlayer({
|
|
@@ -9062,7 +9062,7 @@ class AvatarSDK {
|
|
|
9062
9062
|
}
|
|
9063
9063
|
__publicField(AvatarSDK, "_isInitialized", false);
|
|
9064
9064
|
__publicField(AvatarSDK, "_configuration", null);
|
|
9065
|
-
__publicField(AvatarSDK, "_version", "1.0.0-beta.
|
|
9065
|
+
__publicField(AvatarSDK, "_version", "1.0.0-beta.57");
|
|
9066
9066
|
__publicField(AvatarSDK, "_avatarCore", null);
|
|
9067
9067
|
__publicField(AvatarSDK, "_dynamicSdkConfig", null);
|
|
9068
9068
|
const AvatarSDK$1 = Object.freeze(Object.defineProperty({
|
|
@@ -14500,6 +14500,9 @@ class AvatarView {
|
|
|
14500
14500
|
}
|
|
14501
14501
|
handleInterrupt() {
|
|
14502
14502
|
const state = this.renderingState;
|
|
14503
|
+
if (state === "idle") {
|
|
14504
|
+
return;
|
|
14505
|
+
}
|
|
14503
14506
|
if (state === "transitioningToIdle") {
|
|
14504
14507
|
return;
|
|
14505
14508
|
}
|
|
@@ -14680,6 +14683,30 @@ class AvatarView {
|
|
|
14680
14683
|
}
|
|
14681
14684
|
}
|
|
14682
14685
|
}
|
|
14686
|
+
async renderFlame(flame) {
|
|
14687
|
+
if (!this.isInitialized || !this.renderSystem) {
|
|
14688
|
+
throw new Error("AvatarView not initialized");
|
|
14689
|
+
}
|
|
14690
|
+
try {
|
|
14691
|
+
const processedFlame = this.avatarController.applyPostProcessingToFlame(flame);
|
|
14692
|
+
const wasmParams = convertProtoFlameToWasmParams(processedFlame);
|
|
14693
|
+
const avatarCore = AvatarSDK.getAvatarCore();
|
|
14694
|
+
if (!avatarCore) {
|
|
14695
|
+
throw new Error("AvatarCore not available");
|
|
14696
|
+
}
|
|
14697
|
+
const splatData = await avatarCore.computeFrameFlatFromParams(
|
|
14698
|
+
wasmParams,
|
|
14699
|
+
this.characterHandle ?? void 0
|
|
14700
|
+
);
|
|
14701
|
+
if (splatData) {
|
|
14702
|
+
this.renderSystem.loadSplatsFromPackedData(splatData);
|
|
14703
|
+
this.renderSystem.renderFrame();
|
|
14704
|
+
}
|
|
14705
|
+
} catch (error) {
|
|
14706
|
+
logger.error("[AvatarView] Failed to render flame:", error instanceof Error ? error.message : String(error));
|
|
14707
|
+
throw error;
|
|
14708
|
+
}
|
|
14709
|
+
}
|
|
14683
14710
|
async rerenderCurrentFrameWithNewCamera() {
|
|
14684
14711
|
if (this.avatarController.state !== AvatarState.paused || this.renderingState !== "speaking" || !this.renderSystem) {
|
|
14685
14712
|
return;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED