@ssml-builder-js/ssml-editor-elements 2.7.0 → 2.8.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/dist/index.mjs CHANGED
@@ -69,6 +69,7 @@ var INTRINSICALLY_EMPTY_ELEMENTS = /* @__PURE__ */ new Set([
69
69
  "lexicon",
70
70
  "mark",
71
71
  "mstts:silence",
72
+ "mstts:audioduration",
72
73
  "mstts:viseme",
73
74
  "silence",
74
75
  "viseme"
@@ -727,6 +728,8 @@ function updateEditableText(document2, value) {
727
728
  // ../ssml-editor-react/src/constants/ssmlPresets.ts
728
729
  var ssmlPresets_exports = {};
729
730
  __export(ssmlPresets_exports, {
731
+ AUDIO_DURATION_DESCRIPTIONS: () => AUDIO_DURATION_DESCRIPTIONS,
732
+ AUDIO_DURATION_PRESETS: () => AUDIO_DURATION_PRESETS,
730
733
  BREAK_STRENGTH_PRESETS: () => BREAK_STRENGTH_PRESETS,
731
734
  BREAK_TIME_DESCRIPTIONS: () => BREAK_TIME_DESCRIPTIONS,
732
735
  BREAK_TIME_PRESETS: () => BREAK_TIME_PRESETS,
@@ -759,6 +762,103 @@ __export(ssmlPresets_exports, {
759
762
  getExpressAsStyleCategory: () => getExpressAsStyleCategory,
760
763
  resolveExpressAsStyles: () => resolveExpressAsStyles
761
764
  });
765
+
766
+ // ../ssml-editor-react/src/constants/azureVoiceStyleMap.generated.ts
767
+ var AZURE_VOICE_STYLE_MAP = {
768
+ "de-DE-ConradNeural": ["cheerful", "sad"],
769
+ "de-DE-KatjaNeural": ["cheerful", "sad"],
770
+ "en-US-AndrewNeural": ["empathetic", "relieved"],
771
+ "en-US-GuyNeural": [
772
+ "angry",
773
+ "cheerful",
774
+ "excited",
775
+ "friendly",
776
+ "hopeful",
777
+ "newscast",
778
+ "sad",
779
+ "shouting",
780
+ "terrified",
781
+ "unfriendly",
782
+ "whispering"
783
+ ],
784
+ "en-US-JennyMultilingualNeural": [
785
+ "cheerful",
786
+ "empathetic",
787
+ "excited",
788
+ "friendly",
789
+ "hopeful",
790
+ "sad",
791
+ "shouting",
792
+ "terrified",
793
+ "unfriendly",
794
+ "whispering"
795
+ ],
796
+ "en-US-JennyNeural": [
797
+ "assistant",
798
+ "chat",
799
+ "customerservice",
800
+ "newscast",
801
+ "cheerful",
802
+ "empathetic",
803
+ "excited",
804
+ "friendly",
805
+ "hopeful",
806
+ "sad",
807
+ "shouting",
808
+ "terrified",
809
+ "unfriendly",
810
+ "whispering"
811
+ ],
812
+ "es-ES-ElviraNeural": [],
813
+ "fil-PH-AngeloNeural": [],
814
+ "fr-FR-DeniseNeural": ["cheerful", "sad"],
815
+ "fr-FR-HenriNeural": ["cheerful", "sad"],
816
+ "id-ID-GadisNeural": [],
817
+ "it-IT-ElsaNeural": ["cheerful", "sad"],
818
+ "ja-JP-KeitaNeural": ["chat"],
819
+ "ja-JP-MayuNeural": ["calm", "cheerful", "sad"],
820
+ "ja-JP-NanamiNeural": ["chat", "customerservice", "cheerful", "whispering", "sad"],
821
+ "ko-KR-SunHiNeural": ["cheerful", "sad"],
822
+ "ms-MY-YasminNeural": [],
823
+ "pt-BR-FranciscaNeural": ["calm"],
824
+ "ru-RU-SvetlanaNeural": ["cheerful", "sad", "angry", "disgruntled", "embarrassed", "fearful"],
825
+ "th-TH-PremwadeeNeural": [],
826
+ "vi-VN-HoaiMyNeural": [],
827
+ "zh-CN-XiaoxiaoNeural": [
828
+ "assistant",
829
+ "chat",
830
+ "customerservice",
831
+ "newscast",
832
+ "cheerful",
833
+ "empathetic",
834
+ "excited",
835
+ "friendly",
836
+ "hopeful",
837
+ "sad",
838
+ "terrified",
839
+ "whispering",
840
+ "poetry-reading",
841
+ "sports_commentary",
842
+ "sports_commentary_excited",
843
+ "story"
844
+ ],
845
+ "zh-CN-YunxiNeural": [
846
+ "narration-relaxed",
847
+ "embarrassed",
848
+ "fearful",
849
+ "sad",
850
+ "disgruntled",
851
+ "serious",
852
+ "angry",
853
+ "depressed",
854
+ "chat",
855
+ "cheerful",
856
+ "assistant"
857
+ ],
858
+ "zh-TW-HsiaoChenNeural": []
859
+ };
860
+
861
+ // ../ssml-editor-react/src/constants/ssmlPresets.ts
762
862
  var SSML_PRESETS = [
763
863
  {
764
864
  id: "basic",
@@ -858,7 +958,7 @@ function getExpressAsStyleCategory(style) {
858
958
  }
859
959
  return "other";
860
960
  }
861
- var VOICE_STYLE_MAP = {
961
+ var LEGACY_VOICE_STYLE_MAP = {
862
962
  "ja-JP-MayuNeural": ["calm", "cheerful", "sad"],
863
963
  "ja-JP-KeitaNeural": ["chat"],
864
964
  "ja-JP-NanamiNeural": ["chat", "customerservice", "cheerful", "whispering", "sad"],
@@ -944,6 +1044,7 @@ var VOICE_STYLE_MAP = {
944
1044
  "de-DE-ConradNeural": ["cheerful", "sad"],
945
1045
  "ru-RU-SvetlanaNeural": ["cheerful", "sad", "angry", "disgruntled", "embarrassed", "fearful"]
946
1046
  };
1047
+ var VOICE_STYLE_MAP = Object.keys(AZURE_VOICE_STYLE_MAP).length > 0 ? AZURE_VOICE_STYLE_MAP : LEGACY_VOICE_STYLE_MAP;
947
1048
  var VOICE_STYLE_MAP_BY_NORMALIZED_NAME = new Map(
948
1049
  Object.entries(VOICE_STYLE_MAP).map(([voiceName, styles]) => [voiceName.toLowerCase(), styles])
949
1050
  );
@@ -986,6 +1087,7 @@ var SAY_AS_PRESETS = [
986
1087
  ];
987
1088
  var LANGUAGE_PRESETS = ["ja-JP", "en-US", "de-DE", "fr-FR"];
988
1089
  var SILENCE_VALUE_PRESETS = ["300ms", "500ms", "1s"];
1090
+ var AUDIO_DURATION_PRESETS = ["5s", "10s", "30s"];
989
1091
  var SILENCE_TYPE_PRESETS = [
990
1092
  "Leading",
991
1093
  "Tailing",
@@ -994,6 +1096,11 @@ var SILENCE_TYPE_PRESETS = [
994
1096
  "Semicolon",
995
1097
  "Enumerationcomma"
996
1098
  ];
1099
+ var AUDIO_DURATION_DESCRIPTIONS = {
1100
+ "5s": { ja: "5\u79D2", en: "5 seconds" },
1101
+ "10s": { ja: "10\u79D2", en: "10 seconds" },
1102
+ "30s": { ja: "30\u79D2", en: "30 seconds" }
1103
+ };
997
1104
  var PHONEME_ALPHABET_PRESETS = ["ipa", "sapi", "ups", "x-sampa"];
998
1105
  var VISEME_TYPE_PRESETS = ["redlips_front", "FacialExpression"];
999
1106
  var SSML_ATTRIBUTE_PRESETS = {
@@ -1037,6 +1144,9 @@ var SSML_ATTRIBUTE_PRESETS = {
1037
1144
  type: SILENCE_TYPE_PRESETS,
1038
1145
  value: SILENCE_VALUE_PRESETS
1039
1146
  },
1147
+ "mstts:audioduration": {
1148
+ value: AUDIO_DURATION_PRESETS
1149
+ },
1040
1150
  silence: {
1041
1151
  type: SILENCE_TYPE_PRESETS,
1042
1152
  value: SILENCE_VALUE_PRESETS
@@ -1524,6 +1634,10 @@ var SSML_COMPLETION_SNIPPETS = [
1524
1634
  label: "mstts:express-as",
1525
1635
  insertText: `<mstts:express-as style="cheerful">\${1:text}</mstts:express-as>`
1526
1636
  },
1637
+ {
1638
+ label: "mstts:audioduration",
1639
+ insertText: '<mstts:audioduration value="10s" />'
1640
+ },
1527
1641
  {
1528
1642
  label: "sub",
1529
1643
  insertText: `<sub alias="\${1:\u8AAD\u307F}">\${2:\u6F22\u5B57}</sub>`
@@ -1791,6 +1905,13 @@ var SSML_HOVER_COPY = {
1791
1905
  parameters: {
1792
1906
  type: { title: "type", description: "\u30D3\u30BC\u30FC\u30E0\u30A4\u30D9\u30F3\u30C8\u306E\u5F62\u5F0F\u3002" }
1793
1907
  }
1908
+ },
1909
+ "mstts:audioduration": {
1910
+ title: "\u97F3\u58F0\u9577",
1911
+ description: "\u5408\u6210\u97F3\u58F0\u306E\u76EE\u6A19\u6642\u9593\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002",
1912
+ parameters: {
1913
+ value: { title: "value", description: "\u76EE\u6A19\u6642\u9593\u3002\u4F8B: `10s`\u3001`5000ms`\u3001`00:00:10`\u3002" }
1914
+ }
1794
1915
  }
1795
1916
  }
1796
1917
  },
@@ -1948,6 +2069,13 @@ var SSML_HOVER_COPY = {
1948
2069
  parameters: {
1949
2070
  type: { title: "type", description: "The viseme event format." }
1950
2071
  }
2072
+ },
2073
+ "mstts:audioduration": {
2074
+ title: "Audio duration",
2075
+ description: "Sets the target duration of synthesized audio.",
2076
+ parameters: {
2077
+ value: { title: "value", description: "The target duration, such as `10s`, `5000ms`, or `00:00:10`." }
2078
+ }
1951
2079
  }
1952
2080
  }
1953
2081
  }
@@ -2244,6 +2372,17 @@ var SSML_TAG_DEFINITIONS = [
2244
2372
  values: VISEME_TYPE_PRESETS2
2245
2373
  }
2246
2374
  ]
2375
+ },
2376
+ {
2377
+ name: "mstts:audioduration",
2378
+ description: "Sets the target duration of synthesized audio.",
2379
+ parameters: [
2380
+ {
2381
+ name: "value",
2382
+ description: "The target duration, such as `10s`, `5000ms`, or `00:00:10`.",
2383
+ example: "10s"
2384
+ }
2385
+ ]
2247
2386
  }
2248
2387
  ];
2249
2388
  var definitionsByName = /* @__PURE__ */ new Map();
@@ -2785,13 +2924,34 @@ var SSML_INSERTIONS = [
2785
2924
  suffix: "",
2786
2925
  mode: "insert"
2787
2926
  })
2927
+ },
2928
+ {
2929
+ id: "mstts:audioduration",
2930
+ icon: "\u25F7",
2931
+ tagName: "mstts:audioduration",
2932
+ selfClosing: true,
2933
+ labels: { ja: "\u97F3\u58F0\u9577", en: "Audio duration" },
2934
+ descriptions: {
2935
+ ja: "\u5408\u6210\u97F3\u58F0\u306E\u76EE\u6A19\u6642\u9593\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002",
2936
+ en: "Sets the target duration of synthesized audio."
2937
+ },
2938
+ parameterDescription: {
2939
+ ja: "\u76EE\u6A19\u6642\u9593\u3092\u9078\u629E\u3057\u307E\u3059\u3002",
2940
+ en: "Selects the target duration."
2941
+ },
2942
+ options: createInsertionOptions(AUDIO_DURATION_PRESETS, AUDIO_DURATION_DESCRIPTIONS),
2943
+ createTemplate: (value) => ({
2944
+ prefix: `<mstts:audioduration value="${value}"/>`,
2945
+ suffix: "",
2946
+ mode: "insert"
2947
+ })
2788
2948
  }
2789
2949
  ];
2790
2950
  var DEFAULT_INSERTION_GROUPS = [
2791
2951
  {
2792
2952
  id: "pauses",
2793
2953
  labels: { ja: "\u9593\u30FB\u7121\u97F3", en: "Pauses" },
2794
- insertionIds: ["break", "mstts:silence"]
2954
+ insertionIds: ["break", "mstts:silence", "mstts:audioduration"]
2795
2955
  },
2796
2956
  {
2797
2957
  id: "prosody",