UNPKG

@hahnpro/ms-speech-sdk

Version:
1 lines 2.91 kB
{"version":3,"sources":["src/common.speech/SynthesizerConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAEH,sBAAsB,EACtB,mBAAmB,EAClB,MAAM,cAAc,CAAC;AAE1B,oBAAY,oBAAoB;IAC5B,QAAQ,IAAA;IACR,MAAM,IAAA;CACT;AAED,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,wBAAwB,CAAuD;IACvF,OAAO,CAAC,uBAAuB,CAAsB;IACrD,OAAO,CAAC,cAAc,CAAqB;IACpC,aAAa,EAAE,OAAO,CAAS;gBAGlC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,kBAAkB;IAKlC,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED,IAAW,oBAAoB,IAAI,oBAAoB,CAEtD;IAED,IAAW,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,EAE1D;IAED,IAAW,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,EAI7D;IAED,IAAW,mBAAmB,IAAI,mBAAmB,CAEpD;IAEM,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAkBhE","file":"SynthesizerConfig.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { PropertyCollection } from \"../sdk/Exports.js\";\nimport {\n Context,\n ISynthesisSectionVideo,\n SpeechServiceConfig\n } from \"./Exports.js\";\n\nexport enum SynthesisServiceType {\n Standard,\n Custom,\n}\n\nexport class SynthesizerConfig {\n private privSynthesisServiceType: SynthesisServiceType = SynthesisServiceType.Standard;\n private privSpeechServiceConfig: SpeechServiceConfig;\n private privParameters: PropertyCollection;\n public avatarEnabled: boolean = false;\n\n public constructor(\n speechServiceConfig: SpeechServiceConfig,\n parameters: PropertyCollection) {\n this.privSpeechServiceConfig = speechServiceConfig ? speechServiceConfig : new SpeechServiceConfig(new Context(null));\n this.privParameters = parameters;\n }\n\n public get parameters(): PropertyCollection {\n return this.privParameters;\n }\n\n public get synthesisServiceType(): SynthesisServiceType {\n return this.privSynthesisServiceType;\n }\n\n public set synthesisServiceType(value: SynthesisServiceType) {\n this.privSynthesisServiceType = value;\n }\n\n public set synthesisVideoSection(value: ISynthesisSectionVideo) {\n this.privSpeechServiceConfig.Context.synthesis = {\n video: value\n };\n }\n\n public get SpeechServiceConfig(): SpeechServiceConfig {\n return this.privSpeechServiceConfig;\n }\n\n public setContextFromJson(contextJson: string | object): void {\n const context: Context = JSON.parse(contextJson as string) as Context;\n if (context.system) {\n this.privSpeechServiceConfig.Context.system = context.system;\n }\n\n if (context.os) {\n this.privSpeechServiceConfig.Context.os = context.os;\n }\n\n if (context.audio) {\n this.privSpeechServiceConfig.Context.audio = context.audio;\n }\n\n if (context.synthesis) {\n this.privSpeechServiceConfig.Context.synthesis = context.synthesis;\n }\n }\n}\n"]}