@streamoji/aitwin 0.6.2 → 0.6.3
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 +18 -1
- package/dist/aitwin.cjs +6 -6
- package/dist/aitwin.js +2555 -2454
- package/dist/index.d.ts +286 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -89,6 +89,11 @@ export declare type AiTwinProps = {
|
|
|
89
89
|
* `ttsEngineId:voiceId` (e.g. `visemetts:eve`).
|
|
90
90
|
*/
|
|
91
91
|
voiceId?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Default TTS language for `speakText()` and voice `connect()`.
|
|
94
|
+
* Uniform code for visemetts and Cartesia (`en`, `es-MX`, `auto`, …).
|
|
95
|
+
*/
|
|
96
|
+
language?: TtsLanguage;
|
|
92
97
|
/** API speakingRate (default: 0.85). */
|
|
93
98
|
speakingRate?: number;
|
|
94
99
|
className?: string;
|
|
@@ -205,6 +210,11 @@ export declare type AiTwinWidgetProps = {
|
|
|
205
210
|
apiBase?: string;
|
|
206
211
|
/** TTS voice id override. */
|
|
207
212
|
voiceId?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Default TTS language for `speakText()` and voice `connect()`.
|
|
215
|
+
* Uniform code for visemetts and Cartesia (`en`, `es-MX`, `auto`, …).
|
|
216
|
+
*/
|
|
217
|
+
language?: TtsLanguage;
|
|
208
218
|
/** API speakingRate (default 0.85). */
|
|
209
219
|
speakingRate?: number;
|
|
210
220
|
/**
|
|
@@ -281,6 +291,11 @@ export declare type AvatarTtsSpeakOptions = {
|
|
|
281
291
|
speakingRate?: number;
|
|
282
292
|
/** Overrides controller default for this request. */
|
|
283
293
|
ttsEngineId?: TtsEngineId;
|
|
294
|
+
/**
|
|
295
|
+
* Uniform TTS language code (`en`, `es-MX`, `auto`, …).
|
|
296
|
+
* Sent as `language` on `/avatar_ttsWithPoses`.
|
|
297
|
+
*/
|
|
298
|
+
language?: TtsLanguage;
|
|
284
299
|
};
|
|
285
300
|
|
|
286
301
|
/** Pair transitions for playback, including sil→first and last→sil bookends. */
|
|
@@ -307,6 +322,8 @@ export declare function createRealtimeVoiceLipsyncController(onStatus: (status:
|
|
|
307
322
|
|
|
308
323
|
export declare const DEFAULT_TTS_ENGINE_ID: TtsEngineId;
|
|
309
324
|
|
|
325
|
+
export declare const DEFAULT_TTS_LANGUAGE: TtsLanguage;
|
|
326
|
+
|
|
310
327
|
export declare const EMOTION_TO_EYEBROW: Record<ExpressionEmotion, number>;
|
|
311
328
|
|
|
312
329
|
export declare function emotionToEyebrow(emotion: ExpressionEmotion): number;
|
|
@@ -398,6 +415,10 @@ export declare function getAiTwinSourceUrl(faceId: string, cdnBase?: string, ext
|
|
|
398
415
|
/** Public CDN thumbnail for custom-faces/{faceId}/ (same id as pipeline avatarId). */
|
|
399
416
|
export declare function getAiTwinThumbnailUrl(faceId: string, cdnBase?: string): string;
|
|
400
417
|
|
|
418
|
+
export declare function isTtsLanguageCode(raw: string): raw is TtsLanguage;
|
|
419
|
+
|
|
420
|
+
export declare function isTtsLanguageSupported(engineId: TtsEngineId, language: string): boolean;
|
|
421
|
+
|
|
401
422
|
export declare function listSkippedVisemeEntries(queue: VisemeQueueItem[]): SkippedVisemeEntry[];
|
|
402
423
|
|
|
403
424
|
/** Visemes removed by compaction (for debug). */
|
|
@@ -410,6 +431,9 @@ export declare function normalizeOculusViseme(symbol: string | null | undefined)
|
|
|
410
431
|
|
|
411
432
|
export declare function normalizeStreamEmotion(raw: string | undefined | null, fallback?: ExpressionEmotion): ExpressionEmotion;
|
|
412
433
|
|
|
434
|
+
/** Trimmed language code, or undefined when empty. */
|
|
435
|
+
export declare function normalizeTtsLanguage(raw?: string | null): TtsLanguage | undefined;
|
|
436
|
+
|
|
413
437
|
/** Oculus viseme ids for Talking Lady stills and pair transitions (15 standard). */
|
|
414
438
|
export declare const OCULUS_VISEME_IDS: readonly ["aa", "CH", "DD", "E", "FF", "I", "O", "PP", "RR", "SS", "TH", "U", "kk", "nn", "sil"];
|
|
415
439
|
|
|
@@ -538,8 +562,265 @@ export declare const TTS_ENGINE_INWORLD = "eng_d4e8f3a2";
|
|
|
538
562
|
/** streamoji-ai-avatar viseme TTS (`POST /avatar_ttsWithPoses`). */
|
|
539
563
|
export declare const TTS_ENGINE_VISEMETTS = "visemetts";
|
|
540
564
|
|
|
565
|
+
/**
|
|
566
|
+
* Uniform TTS language codes for visemetts and Cartesia (`eng_c9b1e6d4`).
|
|
567
|
+
* Passed as `language` on `/avatar_ttsWithPoses` and `/ws/voice`.
|
|
568
|
+
*/
|
|
569
|
+
export declare const TTS_LANGUAGE_CATALOG: readonly [{
|
|
570
|
+
readonly code: "en";
|
|
571
|
+
readonly label: "English";
|
|
572
|
+
readonly visemetts: true;
|
|
573
|
+
readonly cartesia: true;
|
|
574
|
+
}, {
|
|
575
|
+
readonly code: "es";
|
|
576
|
+
readonly label: "Spanish";
|
|
577
|
+
readonly visemetts: true;
|
|
578
|
+
readonly cartesia: true;
|
|
579
|
+
}, {
|
|
580
|
+
readonly code: "es-MX";
|
|
581
|
+
readonly label: "Spanish (Mexico)";
|
|
582
|
+
readonly visemetts: true;
|
|
583
|
+
readonly cartesia: true;
|
|
584
|
+
}, {
|
|
585
|
+
readonly code: "es-ES";
|
|
586
|
+
readonly label: "Spanish (Spain)";
|
|
587
|
+
readonly visemetts: true;
|
|
588
|
+
readonly cartesia: true;
|
|
589
|
+
}, {
|
|
590
|
+
readonly code: "pt";
|
|
591
|
+
readonly label: "Portuguese";
|
|
592
|
+
readonly visemetts: true;
|
|
593
|
+
readonly cartesia: true;
|
|
594
|
+
}, {
|
|
595
|
+
readonly code: "pt-BR";
|
|
596
|
+
readonly label: "Portuguese (Brazil)";
|
|
597
|
+
readonly visemetts: true;
|
|
598
|
+
readonly cartesia: true;
|
|
599
|
+
}, {
|
|
600
|
+
readonly code: "pt-PT";
|
|
601
|
+
readonly label: "Portuguese (Portugal)";
|
|
602
|
+
readonly visemetts: true;
|
|
603
|
+
readonly cartesia: true;
|
|
604
|
+
}, {
|
|
605
|
+
readonly code: "fr";
|
|
606
|
+
readonly label: "French";
|
|
607
|
+
readonly visemetts: true;
|
|
608
|
+
readonly cartesia: true;
|
|
609
|
+
}, {
|
|
610
|
+
readonly code: "de";
|
|
611
|
+
readonly label: "German";
|
|
612
|
+
readonly visemetts: true;
|
|
613
|
+
readonly cartesia: true;
|
|
614
|
+
}, {
|
|
615
|
+
readonly code: "it";
|
|
616
|
+
readonly label: "Italian";
|
|
617
|
+
readonly visemetts: true;
|
|
618
|
+
readonly cartesia: true;
|
|
619
|
+
}, {
|
|
620
|
+
readonly code: "zh";
|
|
621
|
+
readonly label: "Chinese";
|
|
622
|
+
readonly visemetts: true;
|
|
623
|
+
readonly cartesia: true;
|
|
624
|
+
}, {
|
|
625
|
+
readonly code: "ja";
|
|
626
|
+
readonly label: "Japanese";
|
|
627
|
+
readonly visemetts: true;
|
|
628
|
+
readonly cartesia: true;
|
|
629
|
+
}, {
|
|
630
|
+
readonly code: "hi";
|
|
631
|
+
readonly label: "Hindi";
|
|
632
|
+
readonly visemetts: true;
|
|
633
|
+
readonly cartesia: true;
|
|
634
|
+
}, {
|
|
635
|
+
readonly code: "ko";
|
|
636
|
+
readonly label: "Korean";
|
|
637
|
+
readonly visemetts: true;
|
|
638
|
+
readonly cartesia: true;
|
|
639
|
+
}, {
|
|
640
|
+
readonly code: "ru";
|
|
641
|
+
readonly label: "Russian";
|
|
642
|
+
readonly visemetts: true;
|
|
643
|
+
readonly cartesia: true;
|
|
644
|
+
}, {
|
|
645
|
+
readonly code: "tr";
|
|
646
|
+
readonly label: "Turkish";
|
|
647
|
+
readonly visemetts: true;
|
|
648
|
+
readonly cartesia: true;
|
|
649
|
+
}, {
|
|
650
|
+
readonly code: "id";
|
|
651
|
+
readonly label: "Indonesian";
|
|
652
|
+
readonly visemetts: true;
|
|
653
|
+
readonly cartesia: true;
|
|
654
|
+
}, {
|
|
655
|
+
readonly code: "ar";
|
|
656
|
+
readonly label: "Arabic";
|
|
657
|
+
readonly visemetts: true;
|
|
658
|
+
readonly cartesia: true;
|
|
659
|
+
}, {
|
|
660
|
+
readonly code: "ar-EG";
|
|
661
|
+
readonly label: "Arabic (Egypt)";
|
|
662
|
+
readonly visemetts: true;
|
|
663
|
+
readonly cartesia: true;
|
|
664
|
+
}, {
|
|
665
|
+
readonly code: "ar-AE";
|
|
666
|
+
readonly label: "Arabic (UAE)";
|
|
667
|
+
readonly visemetts: true;
|
|
668
|
+
readonly cartesia: true;
|
|
669
|
+
}, {
|
|
670
|
+
readonly code: "vi";
|
|
671
|
+
readonly label: "Vietnamese";
|
|
672
|
+
readonly visemetts: true;
|
|
673
|
+
readonly cartesia: true;
|
|
674
|
+
}, {
|
|
675
|
+
readonly code: "bn";
|
|
676
|
+
readonly label: "Bengali";
|
|
677
|
+
readonly visemetts: true;
|
|
678
|
+
readonly cartesia: true;
|
|
679
|
+
}, {
|
|
680
|
+
readonly code: "auto";
|
|
681
|
+
readonly label: "Auto-detect";
|
|
682
|
+
readonly visemetts: true;
|
|
683
|
+
readonly cartesia: false;
|
|
684
|
+
}, {
|
|
685
|
+
readonly code: "nl";
|
|
686
|
+
readonly label: "Dutch";
|
|
687
|
+
readonly visemetts: false;
|
|
688
|
+
readonly cartesia: true;
|
|
689
|
+
}, {
|
|
690
|
+
readonly code: "pl";
|
|
691
|
+
readonly label: "Polish";
|
|
692
|
+
readonly visemetts: false;
|
|
693
|
+
readonly cartesia: true;
|
|
694
|
+
}, {
|
|
695
|
+
readonly code: "sv";
|
|
696
|
+
readonly label: "Swedish";
|
|
697
|
+
readonly visemetts: false;
|
|
698
|
+
readonly cartesia: true;
|
|
699
|
+
}, {
|
|
700
|
+
readonly code: "tl";
|
|
701
|
+
readonly label: "Tagalog";
|
|
702
|
+
readonly visemetts: false;
|
|
703
|
+
readonly cartesia: true;
|
|
704
|
+
}, {
|
|
705
|
+
readonly code: "bg";
|
|
706
|
+
readonly label: "Bulgarian";
|
|
707
|
+
readonly visemetts: false;
|
|
708
|
+
readonly cartesia: true;
|
|
709
|
+
}, {
|
|
710
|
+
readonly code: "ro";
|
|
711
|
+
readonly label: "Romanian";
|
|
712
|
+
readonly visemetts: false;
|
|
713
|
+
readonly cartesia: true;
|
|
714
|
+
}, {
|
|
715
|
+
readonly code: "cs";
|
|
716
|
+
readonly label: "Czech";
|
|
717
|
+
readonly visemetts: false;
|
|
718
|
+
readonly cartesia: true;
|
|
719
|
+
}, {
|
|
720
|
+
readonly code: "el";
|
|
721
|
+
readonly label: "Greek";
|
|
722
|
+
readonly visemetts: false;
|
|
723
|
+
readonly cartesia: true;
|
|
724
|
+
}, {
|
|
725
|
+
readonly code: "fi";
|
|
726
|
+
readonly label: "Finnish";
|
|
727
|
+
readonly visemetts: false;
|
|
728
|
+
readonly cartesia: true;
|
|
729
|
+
}, {
|
|
730
|
+
readonly code: "hr";
|
|
731
|
+
readonly label: "Croatian";
|
|
732
|
+
readonly visemetts: false;
|
|
733
|
+
readonly cartesia: true;
|
|
734
|
+
}, {
|
|
735
|
+
readonly code: "ms";
|
|
736
|
+
readonly label: "Malay";
|
|
737
|
+
readonly visemetts: false;
|
|
738
|
+
readonly cartesia: true;
|
|
739
|
+
}, {
|
|
740
|
+
readonly code: "sk";
|
|
741
|
+
readonly label: "Slovak";
|
|
742
|
+
readonly visemetts: false;
|
|
743
|
+
readonly cartesia: true;
|
|
744
|
+
}, {
|
|
745
|
+
readonly code: "da";
|
|
746
|
+
readonly label: "Danish";
|
|
747
|
+
readonly visemetts: false;
|
|
748
|
+
readonly cartesia: true;
|
|
749
|
+
}, {
|
|
750
|
+
readonly code: "ta";
|
|
751
|
+
readonly label: "Tamil";
|
|
752
|
+
readonly visemetts: false;
|
|
753
|
+
readonly cartesia: true;
|
|
754
|
+
}, {
|
|
755
|
+
readonly code: "uk";
|
|
756
|
+
readonly label: "Ukrainian";
|
|
757
|
+
readonly visemetts: false;
|
|
758
|
+
readonly cartesia: true;
|
|
759
|
+
}, {
|
|
760
|
+
readonly code: "hu";
|
|
761
|
+
readonly label: "Hungarian";
|
|
762
|
+
readonly visemetts: false;
|
|
763
|
+
readonly cartesia: true;
|
|
764
|
+
}, {
|
|
765
|
+
readonly code: "no";
|
|
766
|
+
readonly label: "Norwegian";
|
|
767
|
+
readonly visemetts: false;
|
|
768
|
+
readonly cartesia: true;
|
|
769
|
+
}, {
|
|
770
|
+
readonly code: "th";
|
|
771
|
+
readonly label: "Thai";
|
|
772
|
+
readonly visemetts: false;
|
|
773
|
+
readonly cartesia: true;
|
|
774
|
+
}, {
|
|
775
|
+
readonly code: "he";
|
|
776
|
+
readonly label: "Hebrew";
|
|
777
|
+
readonly visemetts: false;
|
|
778
|
+
readonly cartesia: true;
|
|
779
|
+
}, {
|
|
780
|
+
readonly code: "ka";
|
|
781
|
+
readonly label: "Georgian";
|
|
782
|
+
readonly visemetts: false;
|
|
783
|
+
readonly cartesia: true;
|
|
784
|
+
}, {
|
|
785
|
+
readonly code: "te";
|
|
786
|
+
readonly label: "Telugu";
|
|
787
|
+
readonly visemetts: false;
|
|
788
|
+
readonly cartesia: true;
|
|
789
|
+
}, {
|
|
790
|
+
readonly code: "gu";
|
|
791
|
+
readonly label: "Gujarati";
|
|
792
|
+
readonly visemetts: false;
|
|
793
|
+
readonly cartesia: true;
|
|
794
|
+
}, {
|
|
795
|
+
readonly code: "kn";
|
|
796
|
+
readonly label: "Kannada";
|
|
797
|
+
readonly visemetts: false;
|
|
798
|
+
readonly cartesia: true;
|
|
799
|
+
}, {
|
|
800
|
+
readonly code: "ml";
|
|
801
|
+
readonly label: "Malayalam";
|
|
802
|
+
readonly visemetts: false;
|
|
803
|
+
readonly cartesia: true;
|
|
804
|
+
}, {
|
|
805
|
+
readonly code: "mr";
|
|
806
|
+
readonly label: "Marathi";
|
|
807
|
+
readonly visemetts: false;
|
|
808
|
+
readonly cartesia: true;
|
|
809
|
+
}, {
|
|
810
|
+
readonly code: "pa";
|
|
811
|
+
readonly label: "Punjabi";
|
|
812
|
+
readonly visemetts: false;
|
|
813
|
+
readonly cartesia: true;
|
|
814
|
+
}];
|
|
815
|
+
|
|
816
|
+
export declare const TTS_LANGUAGE_CODES: readonly TtsLanguage[];
|
|
817
|
+
|
|
541
818
|
export declare type TtsEngineId = typeof TTS_ENGINE_GOOGLE | typeof TTS_ENGINE_INWORLD | typeof TTS_ENGINE_CARTESIA | typeof TTS_ENGINE_VISEMETTS;
|
|
542
819
|
|
|
820
|
+
export declare type TtsLanguage = (typeof TTS_LANGUAGE_CATALOG)[number]["code"];
|
|
821
|
+
|
|
822
|
+
export declare function ttsLanguagesForEngine(engineId: TtsEngineId): TtsLanguage[];
|
|
823
|
+
|
|
543
824
|
/** Runtime face bundle URLs (R2 custom-faces or local /twins/…). */
|
|
544
825
|
export declare type TwinAssetUrls = {
|
|
545
826
|
/** Plain assets: sil.png, idle.mp4, atlas.json */
|
|
@@ -582,6 +863,11 @@ export declare type VoiceConnectOptions = {
|
|
|
582
863
|
ttsEngineId?: TtsEngineId;
|
|
583
864
|
/** Cartesia voice UUID, or visemetts name (e.g. `eve`). */
|
|
584
865
|
voiceId?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Uniform TTS language code (`en`, `es-MX`, `auto`, …).
|
|
868
|
+
* Sent as `language` on `/ws/voice` and redirected `/avatar_ttsWithPoses` calls.
|
|
869
|
+
*/
|
|
870
|
+
language?: TtsLanguage;
|
|
585
871
|
/** Persona / knowledge context id (from getAiTwin `knowledgeContextId`). */
|
|
586
872
|
personaId?: string;
|
|
587
873
|
speakingRate?: number;
|