9f2fb22987e49b1ea860123b8ca30ca8e69ac56211c339a0bd5caa242c077538.json 13 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VoiceInfo = exports.SynthesisVoiceType = exports.SynthesisVoiceGender = void 0;\n/**\n * Defines the gender of synthesis voices.\n * Added in version 1.20.0.\n */\nvar SynthesisVoiceGender;\n(function (SynthesisVoiceGender) {\n /** Gender unknown */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Unknown\"] = 0] = \"Unknown\";\n /** Female voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Female\"] = 1] = \"Female\";\n /** Male voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Male\"] = 2] = \"Male\";\n /** Neutral voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Neutral\"] = 3] = \"Neutral\";\n})(SynthesisVoiceGender = exports.SynthesisVoiceGender || (exports.SynthesisVoiceGender = {}));\nvar SynthesisVoiceType;\n(function (SynthesisVoiceType) {\n SynthesisVoiceType[SynthesisVoiceType[\"OnlineNeural\"] = 1] = \"OnlineNeural\";\n SynthesisVoiceType[SynthesisVoiceType[\"OnlineStandard\"] = 2] = \"OnlineStandard\";\n SynthesisVoiceType[SynthesisVoiceType[\"OfflineNeural\"] = 3] = \"OfflineNeural\";\n SynthesisVoiceType[SynthesisVoiceType[\"OfflineStandard\"] = 4] = \"OfflineStandard\";\n})(SynthesisVoiceType = exports.SynthesisVoiceType || (exports.SynthesisVoiceType = {}));\nconst GENDER_LOOKUP = {\n [SynthesisVoiceGender[SynthesisVoiceGender.Neutral]]: SynthesisVoiceGender.Neutral,\n [SynthesisVoiceGender[SynthesisVoiceGender.Male]]: SynthesisVoiceGender.Male,\n [SynthesisVoiceGender[SynthesisVoiceGender.Female]]: SynthesisVoiceGender.Female\n};\n/**\n * Information about Speech Synthesis voice\n * Added in version 1.20.0.\n * @class VoiceInfo\n */\nclass VoiceInfo {\n constructor(json) {\n this.privStyleList = [];\n if (!!json) {\n this.privName = json.Name;\n this.privLocale = json.Locale;\n this.privShortName = json.ShortName;\n this.privLocaleName = json.LocaleName;\n this.privDisplayName = json.DisplayName;\n this.privLocalName = json.LocalName;\n this.privVoiceType = json.VoiceType.endsWith(\"Standard\") ? SynthesisVoiceType.OnlineStandard : SynthesisVoiceType.OnlineNeural;\n this.privGender = GENDER_LOOKUP[json.Gender] || SynthesisVoiceGender.Unknown;\n if (!!json.StyleList && Array.isArray(json.StyleList)) {\n for (const style of json.StyleList) {\n this.privStyleList.push(style);\n }\n }\n this.privSampleRateHertz = json.SampleRateHertz;\n this.privStatus = json.Status;\n if (json.ExtendedPropertyMap) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.privExtendedPropertyMap = json.ExtendedPropertyMap;\n }\n this.privWordsPerMinute = json.WordsPerMinute;\n if (Array.isArray(json.SecondaryLocaleList)) {\n this.privSecondaryLocaleList = [...json.SecondaryLocaleList];\n }\n if (Array.isArray(json.RolePlayList)) {\n this.privRolePlayList = [...json.RolePlayList];\n }\n }\n }\n get name() {\n return this.privName;\n }\n get locale() {\n return this.privLocale;\n }\n get shortName() {\n return this.privShortName;\n }\n get displayName() {\n return this.privDisplayName;\n }\n get localName() {\n return this.privLocalName;\n }\n get localeName() {\n return this.privLocaleName;\n }\n get gender() {\n return this.privGender;\n }\n get voiceType() {\n return this.privVoiceType;\n }\n get styleList() {\n return this.privStyleList;\n }\n get sampleRateHertz() {\n return this.privSampleRateHertz;\n }\n get status() {\n return this.privStatus;\n }\n get extendedPropertyMap() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.privExtendedPropertyMap;\n }\n get wordsPerMinute() {\n return this.privWordsPerMinute;\n }\n get secondaryLocaleList() {\n return this.privSecondaryLocaleList;\n }\n get rolePlayList() {\n return this.privRolePlayList;\n }\n}\nexports.VoiceInfo = VoiceInfo;","map":{"version":3,"names":["Object","defineProperty","exports","value","VoiceInfo","SynthesisVoiceType","SynthesisVoiceGender","GENDER_LOOKUP","Neutral","Male","Female","constructor","json","privStyleList","privName","Name","privLocale","Locale","privShortName","ShortName","privLocaleName","LocaleName","privDisplayName","DisplayName","privLocalName","LocalName","privVoiceType","VoiceType","endsWith","OnlineStandard","OnlineNeural","privGender","Gender","Unknown","StyleList","Array","isArray","style","push","privSampleRateHertz","SampleRateHertz","privStatus","Status","ExtendedPropertyMap","privExtendedPropertyMap","privWordsPerMinute","WordsPerMinute","SecondaryLocaleList","privSecondaryLocaleList","RolePlayList","privRolePlayList","name","locale","shortName","displayName","localName","localeName","gender","voiceType","styleList","sampleRateHertz","status","extendedPropertyMap","wordsPerMinute","secondaryLocaleList","rolePlayList"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/VoiceInfo.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VoiceInfo = exports.SynthesisVoiceType = exports.SynthesisVoiceGender = void 0;\n/**\n * Defines the gender of synthesis voices.\n * Added in version 1.20.0.\n */\nvar SynthesisVoiceGender;\n(function (SynthesisVoiceGender) {\n /** Gender unknown */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Unknown\"] = 0] = \"Unknown\";\n /** Female voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Female\"] = 1] = \"Female\";\n /** Male voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Male\"] = 2] = \"Male\";\n /** Neutral voice */\n SynthesisVoiceGender[SynthesisVoiceGender[\"Neutral\"] = 3] = \"Neutral\";\n})(SynthesisVoiceGender = exports.SynthesisVoiceGender || (exports.SynthesisVoiceGender = {}));\nvar SynthesisVoiceType;\n(function (SynthesisVoiceType) {\n SynthesisVoiceType[SynthesisVoiceType[\"OnlineNeural\"] = 1] = \"OnlineNeural\";\n SynthesisVoiceType[SynthesisVoiceType[\"OnlineStandard\"] = 2] = \"OnlineStandard\";\n SynthesisVoiceType[SynthesisVoiceType[\"OfflineNeural\"] = 3] = \"OfflineNeural\";\n SynthesisVoiceType[SynthesisVoiceType[\"OfflineStandard\"] = 4] = \"OfflineStandard\";\n})(SynthesisVoiceType = exports.SynthesisVoiceType || (exports.SynthesisVoiceType = {}));\nconst GENDER_LOOKUP = {\n [SynthesisVoiceGender[SynthesisVoiceGender.Neutral]]: SynthesisVoiceGender.Neutral,\n [SynthesisVoiceGender[SynthesisVoiceGender.Male]]: SynthesisVoiceGender.Male,\n [SynthesisVoiceGender[SynthesisVoiceGender.Female]]: SynthesisVoiceGender.Female,\n};\n/**\n * Information about Speech Synthesis voice\n * Added in version 1.20.0.\n * @class VoiceInfo\n */\nclass VoiceInfo {\n constructor(json) {\n this.privStyleList = [];\n if (!!json) {\n this.privName = json.Name;\n this.privLocale = json.Locale;\n this.privShortName = json.ShortName;\n this.privLocaleName = json.LocaleName;\n this.privDisplayName = json.DisplayName;\n this.privLocalName = json.LocalName;\n this.privVoiceType = json.VoiceType.endsWith(\"Standard\") ? SynthesisVoiceType.OnlineStandard : SynthesisVoiceType.OnlineNeural;\n this.privGender = GENDER_LOOKUP[json.Gender] || SynthesisVoiceGender.Unknown;\n if (!!json.StyleList && Array.isArray(json.StyleList)) {\n for (const style of json.StyleList) {\n this.privStyleList.push(style);\n }\n }\n this.privSampleRateHertz = json.SampleRateHertz;\n this.privStatus = json.Status;\n if (json.ExtendedPropertyMap) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.privExtendedPropertyMap = json.ExtendedPropertyMap;\n }\n this.privWordsPerMinute = json.WordsPerMinute;\n if (Array.isArray(json.SecondaryLocaleList)) {\n this.privSecondaryLocaleList = [...json.SecondaryLocaleList];\n }\n if (Array.isArray(json.RolePlayList)) {\n this.privRolePlayList = [...json.RolePlayList];\n }\n }\n }\n get name() {\n return this.privName;\n }\n get locale() {\n return this.privLocale;\n }\n get shortName() {\n return this.privShortName;\n }\n get displayName() {\n return this.privDisplayName;\n }\n get localName() {\n return this.privLocalName;\n }\n get localeName() {\n return this.privLocaleName;\n }\n get gender() {\n return this.privGender;\n }\n get voiceType() {\n return this.privVoiceType;\n }\n get styleList() {\n return this.privStyleList;\n }\n get sampleRateHertz() {\n return this.privSampleRateHertz;\n }\n get status() {\n return this.privStatus;\n }\n get extendedPropertyMap() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.privExtendedPropertyMap;\n }\n get wordsPerMinute() {\n return this.privWordsPerMinute;\n }\n get secondaryLocaleList() {\n return this.privSecondaryLocaleList;\n }\n get rolePlayList() {\n return this.privRolePlayList;\n }\n}\nexports.VoiceInfo = VoiceInfo;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,SAAS,GAAGF,OAAO,CAACG,kBAAkB,GAAGH,OAAO,CAACI,oBAAoB,GAAG,KAAK,CAAC;AACtF;AACA;AACA;AACA;AACA,IAAIA,oBAAoB;AACxB,CAAC,UAAUA,oBAAoB,EAAE;EAC7B;EACAA,oBAAoB,CAACA,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;EACrE;EACAA,oBAAoB,CAACA,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;EACnE;EACAA,oBAAoB,CAACA,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;EAC/D;EACAA,oBAAoB,CAACA,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzE,CAAC,EAAEA,oBAAoB,GAAGJ,OAAO,CAACI,oBAAoB,KAAKJ,OAAO,CAACI,oBAAoB,GAAG,CAAC,CAAC,CAA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