@convai/web-sdk 0.3.1-beta.3 → 0.3.2-beta.1
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/README.md +535 -1077
- package/dist/core/AudioManager.d.ts.map +1 -0
- package/dist/core/AudioManager.js +262 -0
- package/dist/core/AudioManager.js.map +1 -0
- package/dist/core/BlendshapeQueue.d.ts +112 -0
- package/dist/core/BlendshapeQueue.d.ts.map +1 -0
- package/dist/core/BlendshapeQueue.js +172 -0
- package/dist/core/BlendshapeQueue.js.map +1 -0
- package/dist/{types/core → core}/ConvaiClient.d.ts +5 -15
- package/dist/core/ConvaiClient.d.ts.map +1 -0
- package/dist/core/ConvaiClient.js +602 -0
- package/dist/core/ConvaiClient.js.map +1 -0
- package/dist/core/EventEmitter.d.ts.map +1 -0
- package/dist/core/EventEmitter.js +68 -0
- package/dist/core/EventEmitter.js.map +1 -0
- package/dist/{types/core → core}/MessageHandler.d.ts +7 -0
- package/dist/core/MessageHandler.d.ts.map +1 -0
- package/dist/core/MessageHandler.js +332 -0
- package/dist/core/MessageHandler.js.map +1 -0
- package/dist/core/ScreenShareManager.d.ts.map +1 -0
- package/dist/core/ScreenShareManager.js +207 -0
- package/dist/core/ScreenShareManager.js.map +1 -0
- package/dist/core/VideoManager.d.ts.map +1 -0
- package/dist/core/VideoManager.js +205 -0
- package/dist/core/VideoManager.js.map +1 -0
- package/dist/{types/core → core}/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +14 -1970
- package/dist/core/index.js.map +1 -0
- package/dist/{types/core → core}/types.d.ts +9 -23
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/dev.d.ts +12 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +12 -0
- package/dist/dev.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lipsync-helpers/arkitOrder61.d.ts.map +1 -0
- package/dist/lipsync-helpers/arkitOrder61.js +287 -0
- package/dist/lipsync-helpers/arkitOrder61.js.map +1 -0
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +86 -0
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts.map +1 -0
- package/dist/lipsync-helpers/createBlendshapeQueue.js +126 -0
- package/dist/lipsync-helpers/createBlendshapeQueue.js.map +1 -0
- package/dist/lipsync-helpers/declarativeMapping.d.ts +93 -0
- package/dist/lipsync-helpers/declarativeMapping.d.ts.map +1 -0
- package/dist/lipsync-helpers/declarativeMapping.js +228 -0
- package/dist/lipsync-helpers/declarativeMapping.js.map +1 -0
- package/dist/lipsync-helpers/index.d.ts +15 -0
- package/dist/lipsync-helpers/index.d.ts.map +1 -0
- package/dist/lipsync-helpers/index.js +31 -1164
- package/dist/lipsync-helpers/index.js.map +1 -0
- package/dist/lipsync-helpers/mappingTypes.d.ts +64 -0
- package/dist/lipsync-helpers/mappingTypes.d.ts.map +1 -0
- package/dist/lipsync-helpers/mappingTypes.js +28 -0
- package/dist/lipsync-helpers/mappingTypes.js.map +1 -0
- package/dist/lipsync-helpers/metahumanOrder251.d.ts +115 -0
- package/dist/lipsync-helpers/metahumanOrder251.d.ts.map +1 -0
- package/dist/lipsync-helpers/metahumanOrder251.js +432 -0
- package/dist/lipsync-helpers/metahumanOrder251.js.map +1 -0
- package/dist/lipsync-helpers/presetMappers.d.ts +24 -0
- package/dist/lipsync-helpers/presetMappers.d.ts.map +1 -0
- package/dist/lipsync-helpers/presetMappers.js +38 -0
- package/dist/lipsync-helpers/presetMappers.js.map +1 -0
- package/dist/react/components/ConvaiWidget.d.ts +68 -0
- package/dist/react/components/ConvaiWidget.d.ts.map +1 -0
- package/dist/react/components/ConvaiWidget.js +505 -0
- package/dist/react/components/ConvaiWidget.js.map +1 -0
- package/dist/react/components/index.d.ts +2 -0
- package/dist/react/components/index.d.ts.map +1 -0
- package/dist/react/components/index.js +3 -0
- package/dist/react/components/index.js.map +1 -0
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +10 -0
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +316 -0
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js.map +1 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +36 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js +259 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +1 -0
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +10 -0
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/ConviMessage.js +14 -0
- package/dist/react/components/rtc-widget/components/ConviMessage.js.map +1 -0
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +9 -0
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +122 -0
- package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +1 -0
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +7 -0
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +68 -0
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +1 -0
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +10 -0
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/MessageBubble.js +23 -0
- package/dist/react/components/rtc-widget/components/MessageBubble.js.map +1 -0
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +11 -0
- package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/MessageList.js +89 -0
- package/dist/react/components/rtc-widget/components/MessageList.js.map +1 -0
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts +9 -0
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/UserMessage.js +15 -0
- package/dist/react/components/rtc-widget/components/UserMessage.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +6 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +15 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +25 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +172 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +17 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +66 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +12 -0
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +68 -0
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +12 -0
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +255 -0
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +6 -0
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/index.js +6 -0
- package/dist/react/components/rtc-widget/components/conviComponents/index.js.map +1 -0
- package/dist/react/components/rtc-widget/components/index.d.ts +9 -0
- package/dist/react/components/rtc-widget/components/index.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/index.js +15 -0
- package/dist/react/components/rtc-widget/components/index.js.map +1 -0
- package/dist/react/components/rtc-widget/index.d.ts +6 -0
- package/dist/react/components/rtc-widget/index.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/index.js +9 -0
- package/dist/react/components/rtc-widget/index.js.map +1 -0
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +116 -0
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/styles/framerConfig.js +73 -0
- package/dist/react/components/rtc-widget/styles/framerConfig.js.map +1 -0
- package/dist/react/components/rtc-widget/styles/icons.d.ts +28 -0
- package/dist/react/components/rtc-widget/styles/icons.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/styles/icons.js +257 -0
- package/dist/react/components/rtc-widget/styles/icons.js.map +1 -0
- package/dist/react/components/rtc-widget/styles/index.d.ts +6 -0
- package/dist/react/components/rtc-widget/styles/index.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/styles/index.js +9 -0
- package/dist/react/components/rtc-widget/styles/index.js.map +1 -0
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +90 -0
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/styles/styledComponents.js +663 -0
- package/dist/react/components/rtc-widget/styles/styledComponents.js.map +1 -0
- package/dist/react/components/rtc-widget/styles/theme.d.ts +188 -0
- package/dist/react/components/rtc-widget/styles/theme.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/styles/theme.js +290 -0
- package/dist/react/components/rtc-widget/styles/theme.js.map +1 -0
- package/dist/react/components/rtc-widget/types/index.d.ts +60 -0
- package/dist/react/components/rtc-widget/types/index.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/types/index.js +2 -0
- package/dist/react/components/rtc-widget/types/index.js.map +1 -0
- package/dist/react/hooks/index.d.ts +4 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/index.js +6 -0
- package/dist/react/hooks/index.js.map +1 -0
- package/dist/react/hooks/useCharacterInfo.d.ts +17 -0
- package/dist/react/hooks/useCharacterInfo.d.ts.map +1 -0
- package/dist/react/hooks/useCharacterInfo.js +60 -0
- package/dist/react/hooks/useCharacterInfo.js.map +1 -0
- package/dist/react/hooks/useConvaiClient.d.ts +35 -0
- package/dist/react/hooks/useConvaiClient.d.ts.map +1 -0
- package/dist/react/hooks/useConvaiClient.js +179 -0
- package/dist/react/hooks/useConvaiClient.js.map +1 -0
- package/dist/react/hooks/useLocalCameraTrack.d.ts +22 -0
- package/dist/react/hooks/useLocalCameraTrack.d.ts.map +1 -0
- package/dist/react/hooks/useLocalCameraTrack.js +34 -0
- package/dist/react/hooks/useLocalCameraTrack.js.map +1 -0
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +13 -0
- package/dist/react/index.js.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/LatencyMonitor.d.ts.map +1 -0
- package/dist/utils/LatencyMonitor.js +136 -0
- package/dist/utils/LatencyMonitor.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +96 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/speakerManagement.d.ts.map +1 -0
- package/dist/utils/speakerManagement.js +64 -0
- package/dist/utils/speakerManagement.js.map +1 -0
- package/dist/{types/vanilla → vanilla}/AudioRenderer.d.ts +5 -0
- package/dist/vanilla/AudioRenderer.d.ts.map +1 -0
- package/dist/vanilla/AudioRenderer.js +135 -0
- package/dist/vanilla/AudioRenderer.js.map +1 -0
- package/dist/{types/vanilla → vanilla}/ConvaiWidget.d.ts +13 -6
- package/dist/vanilla/ConvaiWidget.d.ts.map +1 -0
- package/dist/vanilla/ConvaiWidget.js +1823 -0
- package/dist/vanilla/ConvaiWidget.js.map +1 -0
- package/dist/vanilla/icons.d.ts.map +1 -0
- package/dist/vanilla/icons.js +222 -0
- package/dist/vanilla/icons.js.map +1 -0
- package/dist/{types/vanilla → vanilla}/index.d.ts +1 -3
- package/dist/vanilla/index.d.ts.map +1 -0
- package/dist/vanilla/index.js +20 -5509
- package/dist/vanilla/index.js.map +1 -0
- package/dist/vanilla/styles.d.ts.map +1 -0
- package/dist/vanilla/styles.js +287 -0
- package/dist/vanilla/styles.js.map +1 -0
- package/dist/vanilla/types.d.ts +63 -0
- package/dist/vanilla/types.d.ts.map +1 -0
- package/dist/vanilla/types.js +2 -0
- package/dist/vanilla/types.js.map +1 -0
- package/package.json +33 -38
- package/CHANGELOG.md +0 -165
- package/dist/core/index.cjs +0 -1977
- package/dist/lipsync-helpers/index.cjs +0 -1195
- package/dist/types/core/AudioManager.d.ts.map +0 -1
- package/dist/types/core/ConvaiClient.d.ts.map +0 -1
- package/dist/types/core/EventEmitter.d.ts.map +0 -1
- package/dist/types/core/MessageHandler.d.ts.map +0 -1
- package/dist/types/core/ScreenShareManager.d.ts.map +0 -1
- package/dist/types/core/VideoManager.d.ts.map +0 -1
- package/dist/types/core/index.d.ts.map +0 -1
- package/dist/types/core/types.d.ts.map +0 -1
- package/dist/types/lipsync-helpers/arkitBlendshapeHelpers.d.ts +0 -80
- package/dist/types/lipsync-helpers/arkitBlendshapeHelpers.d.ts.map +0 -1
- package/dist/types/lipsync-helpers/arkitOrder61.d.ts.map +0 -1
- package/dist/types/lipsync-helpers/arkitPhonemeReference.d.ts +0 -155
- package/dist/types/lipsync-helpers/arkitPhonemeReference.d.ts.map +0 -1
- package/dist/types/lipsync-helpers/index.d.ts +0 -9
- package/dist/types/lipsync-helpers/index.d.ts.map +0 -1
- package/dist/types/lipsync-helpers/neurosyncBlendshapeMapper.d.ts +0 -30
- package/dist/types/lipsync-helpers/neurosyncBlendshapeMapper.d.ts.map +0 -1
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/LatencyMonitor.d.ts.map +0 -1
- package/dist/types/utils/logger.d.ts.map +0 -1
- package/dist/types/utils/speakerManagement.d.ts.map +0 -1
- package/dist/types/vanilla/AudioRenderer.d.ts.map +0 -1
- package/dist/types/vanilla/ConvaiWidget.d.ts.map +0 -1
- package/dist/types/vanilla/icons.d.ts.map +0 -1
- package/dist/types/vanilla/index.d.ts.map +0 -1
- package/dist/types/vanilla/styles.d.ts.map +0 -1
- package/dist/types/vanilla/types.d.ts +0 -106
- package/dist/types/vanilla/types.d.ts.map +0 -1
- package/dist/umd/convai.umd.js +0 -1
- package/dist/vanilla/index.cjs +0 -5559
- /package/dist/{types/core → core}/AudioManager.d.ts +0 -0
- /package/dist/{types/core → core}/EventEmitter.d.ts +0 -0
- /package/dist/{types/core → core}/ScreenShareManager.d.ts +0 -0
- /package/dist/{types/core → core}/VideoManager.d.ts +0 -0
- /package/dist/{types/lipsync-helpers → lipsync-helpers}/arkitOrder61.d.ts +0 -0
- /package/dist/types/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/utils → utils}/LatencyMonitor.d.ts +0 -0
- /package/dist/{types/utils → utils}/logger.d.ts +0 -0
- /package/dist/{types/utils → utils}/speakerManagement.d.ts +0 -0
- /package/dist/{types/vanilla → vanilla}/icons.d.ts +0 -0
- /package/dist/{types/vanilla → vanilla}/styles.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,4CAA4C;AAC5C,cAAc,SAAS,CAAC;AAKxB,gCAAgC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,+BAA+B;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qCAAqC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Room } from 'livekit-client';
|
|
2
2
|
import { LatencyMonitor } from '../utils/LatencyMonitor';
|
|
3
|
+
import { BlendshapeQueue } from './BlendshapeQueue';
|
|
3
4
|
/**
|
|
4
5
|
* Audio processing settings for the microphone input.
|
|
5
6
|
* These settings help optimize the audio quality and reduce interruptions.
|
|
@@ -70,8 +71,12 @@ export interface ConvaiConfig {
|
|
|
70
71
|
startWithAudioOn?: boolean;
|
|
71
72
|
/** Enable text-to-speech audio generation (default: true) */
|
|
72
73
|
ttsEnabled?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Enable lipsync/facial animation blendshapes (default: false).
|
|
76
|
+
* When true, sets blendshape_provider to "neurosync".
|
|
77
|
+
* When false, sets blendshape_provider to "none" (no facial animation data).
|
|
78
|
+
*/
|
|
79
|
+
enableLipsync?: boolean;
|
|
75
80
|
/** Blendshape configuration for facial animation format */
|
|
76
81
|
blendshapeConfig?: {
|
|
77
82
|
/** Format of blendshapes: "arkit" or "mha" (Meta Human Animation, default: "mha") */
|
|
@@ -280,21 +285,8 @@ export interface IConvaiClient {
|
|
|
280
285
|
readonly screenShareControls: ScreenShareControls;
|
|
281
286
|
/** Latency monitoring (dev tool) */
|
|
282
287
|
readonly latencyMonitor: LatencyMonitor;
|
|
283
|
-
/**
|
|
284
|
-
|
|
285
|
-
* Convenience property - equivalent to audioControls.isAudioMuted
|
|
286
|
-
*/
|
|
287
|
-
readonly isAudioMuted: boolean;
|
|
288
|
-
/**
|
|
289
|
-
* Whether the user's video is currently enabled.
|
|
290
|
-
* Convenience property - equivalent to videoControls.isVideoEnabled
|
|
291
|
-
*/
|
|
292
|
-
readonly isVideoEnabled: boolean;
|
|
293
|
-
/**
|
|
294
|
-
* Whether screen sharing is currently active.
|
|
295
|
-
* Convenience property - equivalent to screenShareControls.isScreenShareActive
|
|
296
|
-
*/
|
|
297
|
-
readonly isScreenShareActive: boolean;
|
|
288
|
+
/** Blendshape queue for time-based lipsync synchronization */
|
|
289
|
+
readonly blendshapeQueue: BlendshapeQueue;
|
|
298
290
|
/**
|
|
299
291
|
* Connect to a Convai character.
|
|
300
292
|
*/
|
|
@@ -350,11 +342,5 @@ export interface IConvaiClient {
|
|
|
350
342
|
* @param callback Callback function to remove
|
|
351
343
|
*/
|
|
352
344
|
off: (event: string, callback: (...args: any[]) => void) => void;
|
|
353
|
-
/**
|
|
354
|
-
* Emit an event
|
|
355
|
-
* @param event Event name
|
|
356
|
-
* @param args Event arguments
|
|
357
|
-
*/
|
|
358
|
-
emit: (event: string, ...args: any[]) => void;
|
|
359
345
|
}
|
|
360
346
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0EAA0E;IAC1E,gBAAgB,CA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,CAAC;IAEtE;;;OAGG;IACH,iBAAiB,EAAE,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAE3D;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEtC;;;;;OAKG;IACH,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IAEtE;;;;OAIG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAAK,IAAI,CAAC;CAClE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development-only exports
|
|
3
|
+
*
|
|
4
|
+
* This module contains tools and utilities for development and debugging.
|
|
5
|
+
* Import from '@convai/web-sdk/dev' to access these features.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module dev
|
|
9
|
+
*/
|
|
10
|
+
export { LatencyMonitor } from "./utils/LatencyMonitor";
|
|
11
|
+
export type { LatencyMeasurement, LatencyStats } from "./utils/LatencyMonitor";
|
|
12
|
+
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development-only exports
|
|
3
|
+
*
|
|
4
|
+
* This module contains tools and utilities for development and debugging.
|
|
5
|
+
* Import from '@convai/web-sdk/dev' to access these features.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module dev
|
|
9
|
+
*/
|
|
10
|
+
// Export LatencyMonitor for development/debugging
|
|
11
|
+
export { LatencyMonitor } from "./utils/LatencyMonitor";
|
|
12
|
+
//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kDAAkD;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AAGxB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG/F,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Default export: React version for backward compatibility
|
|
2
|
+
// Existing users can continue using: import { useConvaiClient } from '@convai/web-sdk';
|
|
3
|
+
export * from './react';
|
|
4
|
+
// Export lipsync helpers
|
|
5
|
+
export * from './lipsync-helpers';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,wFAAwF;AACxF,cAAc,SAAS,CAAC;AAKxB,yBAAyB;AACzB,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 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|
|
3
|
+
* Maps the custom 61-element ARKit blendshape array to standard ARKit indices
|
|
4
|
+
*
|
|
5
|
+
* This ordering includes:
|
|
6
|
+
* - 52 standard ARKit facial blendshapes (in custom order)
|
|
7
|
+
* - 9 additional values for head and eye rotations
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Custom ARKit 61-element ordering
|
|
11
|
+
* This is the order in which blendshapes are received from the server
|
|
12
|
+
*/
|
|
13
|
+
export const ARKIT_ORDER_61 = [
|
|
14
|
+
"EyeBlinkLeft", // 0
|
|
15
|
+
"EyeLookDownLeft", // 1
|
|
16
|
+
"EyeLookInLeft", // 2
|
|
17
|
+
"EyeLookOutLeft", // 3
|
|
18
|
+
"EyeLookUpLeft", // 4
|
|
19
|
+
"EyeSquintLeft", // 5
|
|
20
|
+
"EyeWideLeft", // 6
|
|
21
|
+
"EyeBlinkRight", // 7
|
|
22
|
+
"EyeLookDownRight", // 8
|
|
23
|
+
"EyeLookInRight", // 9
|
|
24
|
+
"EyeLookOutRight", // 10
|
|
25
|
+
"EyeLookUpRight", // 11
|
|
26
|
+
"EyeSquintRight", // 12
|
|
27
|
+
"EyeWideRight", // 13
|
|
28
|
+
"JawForward", // 14
|
|
29
|
+
"JawRight", // 15
|
|
30
|
+
"JawLeft", // 16
|
|
31
|
+
"JawOpen", // 17 🔑 KEY for mouth opening
|
|
32
|
+
"MouthClose", // 18 🔑 KEY for mouth closing
|
|
33
|
+
"MouthFunnel", // 19 🔑 KEY for "O" sounds
|
|
34
|
+
"MouthPucker", // 20 🔑 KEY for "U" sounds
|
|
35
|
+
"MouthRight", // 21
|
|
36
|
+
"MouthLeft", // 22
|
|
37
|
+
"MouthSmileLeft", // 23 🔑 KEY for "ee" sounds
|
|
38
|
+
"MouthSmileRight", // 24 🔑 KEY for "ee" sounds
|
|
39
|
+
"MouthFrownLeft", // 25
|
|
40
|
+
"MouthFrownRight", // 26
|
|
41
|
+
"MouthDimpleLeft", // 27
|
|
42
|
+
"MouthDimpleRight", // 28
|
|
43
|
+
"MouthStretchLeft", // 29 🔑 KEY for wide mouth
|
|
44
|
+
"MouthStretchRight", // 30 🔑 KEY for wide mouth
|
|
45
|
+
"MouthRollLower", // 31
|
|
46
|
+
"MouthRollUpper", // 32
|
|
47
|
+
"MouthShrugLower", // 33
|
|
48
|
+
"MouthShrugUpper", // 34
|
|
49
|
+
"MouthPressLeft", // 35
|
|
50
|
+
"MouthPressRight", // 36
|
|
51
|
+
"MouthLowerDownLeft", // 37
|
|
52
|
+
"MouthLowerDownRight", // 38
|
|
53
|
+
"MouthUpperUpLeft", // 39
|
|
54
|
+
"MouthUpperUpRight", // 40
|
|
55
|
+
"BrowDownLeft", // 41
|
|
56
|
+
"BrowDownRight", // 42
|
|
57
|
+
"BrowInnerUp", // 43
|
|
58
|
+
"BrowOuterUpLeft", // 44
|
|
59
|
+
"BrowOuterUpRight", // 45
|
|
60
|
+
"CheekPuff", // 46
|
|
61
|
+
"CheekSquintLeft", // 47
|
|
62
|
+
"CheekSquintRight", // 48
|
|
63
|
+
"NoseSneerLeft", // 49
|
|
64
|
+
"NoseSneerRight", // 50
|
|
65
|
+
"TongueOut", // 51 🔑 KEY for "th" sounds
|
|
66
|
+
"HeadYaw", // 52 - Head rotation left/right
|
|
67
|
+
"HeadPitch", // 53 - Head rotation up/down
|
|
68
|
+
"HeadRoll", // 54 - Head rotation tilt
|
|
69
|
+
"LeftEyeYaw", // 55 - Left eye rotation left/right
|
|
70
|
+
"LeftEyePitch", // 56 - Left eye rotation up/down
|
|
71
|
+
"LeftEyeRoll", // 57 - Left eye rotation roll
|
|
72
|
+
"RightEyeYaw", // 58 - Right eye rotation left/right
|
|
73
|
+
"RightEyePitch", // 59 - Right eye rotation up/down
|
|
74
|
+
"RightEyeRoll", // 60 - Right eye rotation roll
|
|
75
|
+
];
|
|
76
|
+
/**
|
|
77
|
+
* Standard ARKit blendshape order (52 elements)
|
|
78
|
+
* This is Apple's official ordering
|
|
79
|
+
*/
|
|
80
|
+
export const STANDARD_ARKIT_ORDER = [
|
|
81
|
+
"BrowDownLeft", // 0
|
|
82
|
+
"BrowDownRight", // 1
|
|
83
|
+
"BrowInnerUp", // 2
|
|
84
|
+
"BrowOuterUpLeft", // 3
|
|
85
|
+
"BrowOuterUpRight", // 4
|
|
86
|
+
"CheekPuff", // 5
|
|
87
|
+
"CheekSquintLeft", // 6
|
|
88
|
+
"CheekSquintRight", // 7
|
|
89
|
+
"EyeBlinkLeft", // 8
|
|
90
|
+
"EyeBlinkRight", // 9
|
|
91
|
+
"EyeLookDownLeft", // 10
|
|
92
|
+
"EyeLookDownRight", // 11
|
|
93
|
+
"EyeLookInLeft", // 12
|
|
94
|
+
"EyeLookInRight", // 13
|
|
95
|
+
"EyeLookOutLeft", // 14
|
|
96
|
+
"EyeLookOutRight", // 15
|
|
97
|
+
"EyeLookUpLeft", // 16
|
|
98
|
+
"EyeLookUpRight", // 17
|
|
99
|
+
"EyeSquintLeft", // 18
|
|
100
|
+
"EyeSquintRight", // 19
|
|
101
|
+
"EyeWideLeft", // 20
|
|
102
|
+
"EyeWideRight", // 21
|
|
103
|
+
"JawForward", // 22
|
|
104
|
+
"JawLeft", // 23
|
|
105
|
+
"JawOpen", // 24
|
|
106
|
+
"JawRight", // 25
|
|
107
|
+
"MouthClose", // 26
|
|
108
|
+
"MouthDimpleLeft", // 27
|
|
109
|
+
"MouthDimpleRight", // 28
|
|
110
|
+
"MouthFrownLeft", // 29
|
|
111
|
+
"MouthFrownRight", // 30
|
|
112
|
+
"MouthFunnel", // 31
|
|
113
|
+
"MouthLeft", // 32
|
|
114
|
+
"MouthLowerDownLeft", // 33
|
|
115
|
+
"MouthLowerDownRight", // 34
|
|
116
|
+
"MouthPressLeft", // 35
|
|
117
|
+
"MouthPressRight", // 36
|
|
118
|
+
"MouthPucker", // 37
|
|
119
|
+
"MouthRight", // 38
|
|
120
|
+
"MouthRollLower", // 39
|
|
121
|
+
"MouthRollUpper", // 40
|
|
122
|
+
"MouthShrugLower", // 41
|
|
123
|
+
"MouthShrugUpper", // 42
|
|
124
|
+
"MouthSmileLeft", // 43
|
|
125
|
+
"MouthSmileRight", // 44
|
|
126
|
+
"MouthStretchLeft", // 45
|
|
127
|
+
"MouthStretchRight", // 46
|
|
128
|
+
"MouthUpperUpLeft", // 47
|
|
129
|
+
"MouthUpperUpRight", // 48
|
|
130
|
+
"NoseSneerLeft", // 49
|
|
131
|
+
"NoseSneerRight", // 50
|
|
132
|
+
"TongueOut", // 51
|
|
133
|
+
];
|
|
134
|
+
/**
|
|
135
|
+
* Mapping from custom 61-order indices to standard ARKit indices
|
|
136
|
+
* Maps ARKIT_ORDER_61[i] -> STANDARD_ARKIT_ORDER[j]
|
|
137
|
+
*/
|
|
138
|
+
const ORDER_61_TO_STANDARD_MAP = new Map();
|
|
139
|
+
// Build the mapping at module initialization
|
|
140
|
+
for (let i = 0; i < ARKIT_ORDER_61.length; i++) {
|
|
141
|
+
const name = ARKIT_ORDER_61[i];
|
|
142
|
+
// Only map the first 52 (standard ARKit blendshapes)
|
|
143
|
+
if (i < 52) {
|
|
144
|
+
const standardIndex = STANDARD_ARKIT_ORDER.indexOf(name);
|
|
145
|
+
if (standardIndex !== -1) {
|
|
146
|
+
ORDER_61_TO_STANDARD_MAP.set(i, standardIndex);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Convert 61-element custom order array to standard 52-element ARKit array
|
|
152
|
+
* @param values61 - 61-element array in custom order
|
|
153
|
+
* @returns 52-element array in standard ARKit order
|
|
154
|
+
*/
|
|
155
|
+
export function convertOrder61ToStandard(values61) {
|
|
156
|
+
const standardArray = new Array(52).fill(0);
|
|
157
|
+
for (let i = 0; i < Math.min(52, values61.length); i++) {
|
|
158
|
+
const standardIndex = ORDER_61_TO_STANDARD_MAP.get(i);
|
|
159
|
+
if (standardIndex !== undefined) {
|
|
160
|
+
standardArray[standardIndex] = values61[i];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return standardArray;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Map 61-element array to named object (all 61 values)
|
|
167
|
+
* @param values61 - 61-element array in custom order
|
|
168
|
+
* @returns Object with blendshape/rotation names as keys
|
|
169
|
+
*/
|
|
170
|
+
export function mapOrder61ToNames(values61) {
|
|
171
|
+
const mapped = {};
|
|
172
|
+
for (let i = 0; i < Math.min(values61.length, ARKIT_ORDER_61.length); i++) {
|
|
173
|
+
// Convert to camelCase (lowercase first letter)
|
|
174
|
+
const name = ARKIT_ORDER_61[i];
|
|
175
|
+
const camelCaseName = name.charAt(0).toLowerCase() + name.slice(1);
|
|
176
|
+
mapped[camelCaseName] = values61[i];
|
|
177
|
+
}
|
|
178
|
+
return mapped;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get specific blendshape value by name from 61-element array
|
|
182
|
+
* @param values61 - 61-element array in custom order
|
|
183
|
+
* @param name - Name of the blendshape (case-insensitive)
|
|
184
|
+
* @returns The value, or 0 if not found
|
|
185
|
+
*/
|
|
186
|
+
export function getBlendshapeValueFromOrder61(values61, name) {
|
|
187
|
+
const upperName = name.charAt(0).toUpperCase() + name.slice(1);
|
|
188
|
+
const index = ARKIT_ORDER_61.indexOf(upperName);
|
|
189
|
+
if (index !== -1 && index < values61.length) {
|
|
190
|
+
return values61[index];
|
|
191
|
+
}
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Extract head rotation values from 61-element array
|
|
196
|
+
* @param values61 - 61-element array in custom order
|
|
197
|
+
* @returns Object with head rotation values (yaw, pitch, roll)
|
|
198
|
+
*/
|
|
199
|
+
export function getHeadRotation(values61) {
|
|
200
|
+
return {
|
|
201
|
+
yaw: values61[52] || 0,
|
|
202
|
+
pitch: values61[53] || 0,
|
|
203
|
+
roll: values61[54] || 0,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Extract eye rotation values from 61-element array
|
|
208
|
+
* @param values61 - 61-element array in custom order
|
|
209
|
+
* @returns Object with left and right eye rotation values
|
|
210
|
+
*/
|
|
211
|
+
export function getEyeRotations(values61) {
|
|
212
|
+
return {
|
|
213
|
+
left: {
|
|
214
|
+
yaw: values61[55] || 0,
|
|
215
|
+
pitch: values61[56] || 0,
|
|
216
|
+
roll: values61[57] || 0,
|
|
217
|
+
},
|
|
218
|
+
right: {
|
|
219
|
+
yaw: values61[58] || 0,
|
|
220
|
+
pitch: values61[59] || 0,
|
|
221
|
+
roll: values61[60] || 0,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Get key lip-sync blendshapes from 61-element array
|
|
227
|
+
* These are the most important values for facial animation
|
|
228
|
+
*/
|
|
229
|
+
export function getLipSyncValuesFromOrder61(values61) {
|
|
230
|
+
return {
|
|
231
|
+
jawOpen: values61[17] || 0,
|
|
232
|
+
mouthClose: values61[18] || 0,
|
|
233
|
+
mouthFunnel: values61[19] || 0,
|
|
234
|
+
mouthPucker: values61[20] || 0,
|
|
235
|
+
mouthSmileLeft: values61[23] || 0,
|
|
236
|
+
mouthSmileRight: values61[24] || 0,
|
|
237
|
+
mouthStretchLeft: values61[29] || 0,
|
|
238
|
+
mouthStretchRight: values61[30] || 0,
|
|
239
|
+
mouthRollLower: values61[31] || 0,
|
|
240
|
+
mouthRollUpper: values61[32] || 0,
|
|
241
|
+
tongueOut: values61[51] || 0,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get active blendshapes from 61-element array (above threshold)
|
|
246
|
+
* @param values61 - 61-element array in custom order
|
|
247
|
+
* @param threshold - Minimum value to consider "active" (default: 0.01)
|
|
248
|
+
* @returns Sorted array of active blendshapes
|
|
249
|
+
*/
|
|
250
|
+
export function getActiveBlendshapesFromOrder61(values61, threshold = 0.01) {
|
|
251
|
+
const active = [];
|
|
252
|
+
for (let i = 0; i < Math.min(values61.length, ARKIT_ORDER_61.length); i++) {
|
|
253
|
+
if (Math.abs(values61[i]) > threshold) {
|
|
254
|
+
const name = ARKIT_ORDER_61[i];
|
|
255
|
+
const camelCaseName = name.charAt(0).toLowerCase() + name.slice(1);
|
|
256
|
+
active.push({
|
|
257
|
+
name: camelCaseName,
|
|
258
|
+
value: values61[i],
|
|
259
|
+
index: i,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Sort by absolute value (descending)
|
|
264
|
+
return active.sort((a, b) => Math.abs(b.value) - Math.abs(a.value));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Format 61-element array for logging
|
|
268
|
+
* @param values61 - 61-element array in custom order
|
|
269
|
+
* @param threshold - Only show values above this (default: 0.01)
|
|
270
|
+
* @param maxEntries - Maximum entries to show (default: 20)
|
|
271
|
+
*/
|
|
272
|
+
export function formatOrder61ForLogging(values61, threshold = 0.01, maxEntries = 20) {
|
|
273
|
+
const active = getActiveBlendshapesFromOrder61(values61, threshold)
|
|
274
|
+
.slice(0, maxEntries)
|
|
275
|
+
.reduce((acc, item) => {
|
|
276
|
+
acc[item.name] = Number(item.value.toFixed(4));
|
|
277
|
+
return acc;
|
|
278
|
+
}, {});
|
|
279
|
+
return {
|
|
280
|
+
active,
|
|
281
|
+
total: values61.length,
|
|
282
|
+
activeCount: Object.keys(active).length,
|
|
283
|
+
headRotation: getHeadRotation(values61),
|
|
284
|
+
eyeRotations: getEyeRotations(values61),
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=arkitOrder61.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arkitOrder61.js","sourceRoot":"","sources":["../../src/lipsync-helpers/arkitOrder61.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,cAAc,EAAY,IAAI;IAC9B,iBAAiB,EAAS,IAAI;IA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CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAAkB,EAClB,YAAoB,IAAI,EACxB,aAAqB,EAAE;IAWvB,MAAM,MAAM,GAAG,+BAA+B,CAAC,QAAQ,EAAE,SAAS,CAAC;SAChE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;SACpB,MAAM,CACL,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACZ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAA4B,CAC7B,CAAC;IAEJ,OAAO;QACL,MAAM;QACN,KAAK,EAAE,QAAQ,CAAC,MAAM;QACtB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;QACvC,YAAY,EAAE,eAAe,CAAC,QAAQ,CAAC;QACvC,YAAY,EAAE,eAAe,CAAC,QAAQ,CAAC;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory functions for creating BlendshapeQueue with preset mappings
|
|
3
|
+
*
|
|
4
|
+
* This provides a convenient API for creating queues with common configurations:
|
|
5
|
+
* - ARKit passthrough
|
|
6
|
+
* - MetaHuman passthrough
|
|
7
|
+
* - Custom mapper
|
|
8
|
+
*/
|
|
9
|
+
import { BlendshapeQueue } from '../core/BlendshapeQueue';
|
|
10
|
+
import { BlendshapeMappingConfig, BlendshapeMapper } from './mappingTypes';
|
|
11
|
+
/**
|
|
12
|
+
* Create a BlendshapeQueue with the specified mapping configuration
|
|
13
|
+
*
|
|
14
|
+
* @param config - Blendshape mapping configuration
|
|
15
|
+
* @returns Configured BlendshapeQueue instance
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // ARKit passthrough (no mapping)
|
|
20
|
+
* const queue = createBlendshapeQueue({
|
|
21
|
+
* inputFormat: 'arkit',
|
|
22
|
+
* outputFormat: 'arkit'
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // MetaHuman passthrough
|
|
26
|
+
* const queue = createBlendshapeQueue({
|
|
27
|
+
* inputFormat: 'mha',
|
|
28
|
+
* outputFormat: 'mha'
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Custom mapper
|
|
32
|
+
* const queue = createBlendshapeQueue({
|
|
33
|
+
* inputFormat: 'arkit',
|
|
34
|
+
* outputFormat: 'custom',
|
|
35
|
+
* mapper: (input) => {
|
|
36
|
+
* // Your custom mapping logic
|
|
37
|
+
* return new Float32Array(input);
|
|
38
|
+
* }
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function createBlendshapeQueue(config: BlendshapeMappingConfig): BlendshapeQueue;
|
|
43
|
+
/**
|
|
44
|
+
* Create a BlendshapeQueue for ARKit format (61 elements)
|
|
45
|
+
* Server sends 61-element array, queue stores 61-element array
|
|
46
|
+
*/
|
|
47
|
+
export declare function createARKitBlendshapeQueue(): BlendshapeQueue;
|
|
48
|
+
/**
|
|
49
|
+
* Create a BlendshapeQueue for MetaHuman format (251 elements)
|
|
50
|
+
* Server sends 251-element array, queue stores 251-element array
|
|
51
|
+
*/
|
|
52
|
+
export declare function createMetaHumanBlendshapeQueue(): BlendshapeQueue;
|
|
53
|
+
/**
|
|
54
|
+
* Create a BlendshapeQueue with a custom mapper function
|
|
55
|
+
*
|
|
56
|
+
* @param mapper - Custom mapping function
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const queue = createCustomBlendshapeQueue((input) => {
|
|
61
|
+
* // Map ARKit to your custom rig
|
|
62
|
+
* const output = new Float32Array(30); // Your rig has 30 blendshapes
|
|
63
|
+
* output[0] = input[17]; // Map JawOpen
|
|
64
|
+
* output[1] = input[18]; // Map MouthClose
|
|
65
|
+
* // ... more mappings
|
|
66
|
+
* return output;
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function createCustomBlendshapeQueue(mapper: BlendshapeMapper): BlendshapeQueue;
|
|
71
|
+
/**
|
|
72
|
+
* Create a BlendshapeQueue with no mapping (identity/passthrough)
|
|
73
|
+
* Frames are stored as-is without transformation
|
|
74
|
+
*/
|
|
75
|
+
export declare function createPassthroughBlendshapeQueue(): BlendshapeQueue;
|
|
76
|
+
/**
|
|
77
|
+
* Infer mapping config from ConvaiConfig blendshape settings
|
|
78
|
+
* This is used internally by ConvaiClient to auto-configure the queue
|
|
79
|
+
*
|
|
80
|
+
* @param blendshapeConfig - Blendshape config from ConvaiConfig
|
|
81
|
+
* @returns Mapping configuration for createBlendshapeQueue
|
|
82
|
+
*/
|
|
83
|
+
export declare function inferMappingFromConfig(blendshapeConfig?: {
|
|
84
|
+
format?: 'arkit' | 'mha';
|
|
85
|
+
}): BlendshapeMappingConfig;
|
|
86
|
+
//# sourceMappingURL=createBlendshapeQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBlendshapeQueue.d.ts","sourceRoot":"","sources":["../../src/lipsync-helpers/createBlendshapeQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAO3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,GAAG,eAAe,CAYtF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,eAAe,CAE5D;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,eAAe,CAEhE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,gBAAgB,GAAG,eAAe,CAErF;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,eAAe,CAElE;AAwBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,gBAAgB,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAAE,GAC9C,uBAAuB,CAOzB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory functions for creating BlendshapeQueue with preset mappings
|
|
3
|
+
*
|
|
4
|
+
* This provides a convenient API for creating queues with common configurations:
|
|
5
|
+
* - ARKit passthrough
|
|
6
|
+
* - MetaHuman passthrough
|
|
7
|
+
* - Custom mapper
|
|
8
|
+
*/
|
|
9
|
+
import { BlendshapeQueue } from '../core/BlendshapeQueue';
|
|
10
|
+
import { arkitPassthroughMapper, metahumanPassthroughMapper, identityMapper } from './presetMappers';
|
|
11
|
+
/**
|
|
12
|
+
* Create a BlendshapeQueue with the specified mapping configuration
|
|
13
|
+
*
|
|
14
|
+
* @param config - Blendshape mapping configuration
|
|
15
|
+
* @returns Configured BlendshapeQueue instance
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // ARKit passthrough (no mapping)
|
|
20
|
+
* const queue = createBlendshapeQueue({
|
|
21
|
+
* inputFormat: 'arkit',
|
|
22
|
+
* outputFormat: 'arkit'
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // MetaHuman passthrough
|
|
26
|
+
* const queue = createBlendshapeQueue({
|
|
27
|
+
* inputFormat: 'mha',
|
|
28
|
+
* outputFormat: 'mha'
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Custom mapper
|
|
32
|
+
* const queue = createBlendshapeQueue({
|
|
33
|
+
* inputFormat: 'arkit',
|
|
34
|
+
* outputFormat: 'custom',
|
|
35
|
+
* mapper: (input) => {
|
|
36
|
+
* // Your custom mapping logic
|
|
37
|
+
* return new Float32Array(input);
|
|
38
|
+
* }
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function createBlendshapeQueue(config) {
|
|
43
|
+
let mapper;
|
|
44
|
+
// If custom mapper provided, use it
|
|
45
|
+
if (config.mapper) {
|
|
46
|
+
mapper = config.mapper;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Select preset mapper based on input/output format
|
|
50
|
+
mapper = selectPresetMapper(config.inputFormat, config.outputFormat);
|
|
51
|
+
}
|
|
52
|
+
return new BlendshapeQueue(mapper);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a BlendshapeQueue for ARKit format (61 elements)
|
|
56
|
+
* Server sends 61-element array, queue stores 61-element array
|
|
57
|
+
*/
|
|
58
|
+
export function createARKitBlendshapeQueue() {
|
|
59
|
+
return new BlendshapeQueue(arkitPassthroughMapper);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create a BlendshapeQueue for MetaHuman format (251 elements)
|
|
63
|
+
* Server sends 251-element array, queue stores 251-element array
|
|
64
|
+
*/
|
|
65
|
+
export function createMetaHumanBlendshapeQueue() {
|
|
66
|
+
return new BlendshapeQueue(metahumanPassthroughMapper);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a BlendshapeQueue with a custom mapper function
|
|
70
|
+
*
|
|
71
|
+
* @param mapper - Custom mapping function
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const queue = createCustomBlendshapeQueue((input) => {
|
|
76
|
+
* // Map ARKit to your custom rig
|
|
77
|
+
* const output = new Float32Array(30); // Your rig has 30 blendshapes
|
|
78
|
+
* output[0] = input[17]; // Map JawOpen
|
|
79
|
+
* output[1] = input[18]; // Map MouthClose
|
|
80
|
+
* // ... more mappings
|
|
81
|
+
* return output;
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export function createCustomBlendshapeQueue(mapper) {
|
|
86
|
+
return new BlendshapeQueue(mapper);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Create a BlendshapeQueue with no mapping (identity/passthrough)
|
|
90
|
+
* Frames are stored as-is without transformation
|
|
91
|
+
*/
|
|
92
|
+
export function createPassthroughBlendshapeQueue() {
|
|
93
|
+
return new BlendshapeQueue(identityMapper);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Select the appropriate preset mapper based on input/output formats
|
|
97
|
+
* @private
|
|
98
|
+
*/
|
|
99
|
+
function selectPresetMapper(inputFormat, outputFormat) {
|
|
100
|
+
// Same input and output format = passthrough
|
|
101
|
+
if (inputFormat === outputFormat) {
|
|
102
|
+
if (inputFormat === 'arkit') {
|
|
103
|
+
return arkitPassthroughMapper;
|
|
104
|
+
}
|
|
105
|
+
if (inputFormat === 'mha') {
|
|
106
|
+
return metahumanPassthroughMapper;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// No mapper needed for unknown combinations
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Infer mapping config from ConvaiConfig blendshape settings
|
|
114
|
+
* This is used internally by ConvaiClient to auto-configure the queue
|
|
115
|
+
*
|
|
116
|
+
* @param blendshapeConfig - Blendshape config from ConvaiConfig
|
|
117
|
+
* @returns Mapping configuration for createBlendshapeQueue
|
|
118
|
+
*/
|
|
119
|
+
export function inferMappingFromConfig(blendshapeConfig) {
|
|
120
|
+
const format = blendshapeConfig?.format || 'mha';
|
|
121
|
+
return {
|
|
122
|
+
inputFormat: format,
|
|
123
|
+
outputFormat: format, // Passthrough by default
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=createBlendshapeQueue.js.map
|