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AAe,EAAE,OAAO,CAAC;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,oBAAoB,EAAE,MAAM,CAAC;QAC7B,UAAU,EAAE;YACR,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,CAAC,EAAE;gBACJ,GAAG,EAAE,MAAM,CAAC;aACf,CAAC;SACL,CAAC;QACF,KAAK,CAAC,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;SACrB,CAAC;KACL,CAAC;CACL","file":"SpeechServiceConfig.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\n/* eslint-disable max-classes-per-file */\r\n\r\n// The config is serialized and sent as the Speech.Config\r\nexport class SpeechServiceConfig {\r\n    private context: Context;\r\n    private recognition: string;\r\n\r\n    public constructor(context: Context) {\r\n        this.context = context;\r\n    }\r\n\r\n    public serialize(): string {\r\n        return JSON.stringify(this, (key: any, value: { [k: string]: any }): any => {\r\n            if (value && typeof value === \"object\" && !Array.isArray(value)) {\r\n                const replacement: { [k: string ]: any } = {};\r\n                for (const k in value) {\r\n                    if (Object.hasOwnProperty.call(value, k)) {\r\n                        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\r\n                        replacement[k && k.charAt(0).toLowerCase() + k.substring(1)] = value[k];\r\n                    }\r\n                }\r\n                return replacement;\r\n            }\r\n            return value;\r\n        });\r\n    }\r\n\r\n    public get Context(): Context {\r\n        return this.context;\r\n    }\r\n\r\n    public get Recognition(): string {\r\n        return this.recognition;\r\n    }\r\n\r\n    public set Recognition(value: string) {\r\n        this.recognition = value.toLowerCase();\r\n    }\r\n}\r\n\r\nexport class Context {\r\n    public system: System;\r\n    public os: OS;\r\n    public audio: ISpeechConfigAudio;\r\n    public synthesis: {\r\n        video: ISynthesisSectionVideo;\r\n    };\r\n\r\n    public constructor(os: OS) {\r\n        this.system = new System();\r\n        this.os = os;\r\n    }\r\n}\r\n\r\nexport class System {\r\n    public name: string;\r\n    public version: string;\r\n    public build: string;\r\n    public lang: string;\r\n\r\n    public constructor() {\r\n        // Note: below will be patched for official builds.\r\n        const SPEECHSDK_CLIENTSDK_VERSION = \"1.50.0\";\r\n\r\n        this.name = \"SpeechSDK\";\r\n        this.version = SPEECHSDK_CLIENTSDK_VERSION;\r\n        this.build = \"JavaScript\";\r\n        this.lang = \"JavaScript\";\r\n    }\r\n}\r\n\r\nexport class OS {\r\n    public platform: string;\r\n    public name: string;\r\n    public version: string;\r\n\r\n    public constructor(platform: string, name: string, version: string) {\r\n        this.platform = platform;\r\n        this.name = name;\r\n        this.version = version;\r\n    }\r\n}\r\n\r\nexport class Device {\r\n    public manufacturer: string;\r\n    public model: string;\r\n    public version: string;\r\n\r\n    public constructor(manufacturer: string, model: string, version: string) {\r\n        this.manufacturer = manufacturer;\r\n        this.model = model;\r\n        this.version = version;\r\n    }\r\n}\r\n\r\nexport interface ISpeechConfigAudio {\r\n    source?: ISpeechConfigAudioDevice;\r\n    playback?: ISpeechConfigAudioDevice;\r\n}\r\n\r\nexport interface ISpeechConfigAudioDevice {\r\n    manufacturer: string;\r\n    model: string;\r\n    connectivity: connectivity;\r\n    type: type;\r\n    samplerate: number;\r\n    bitspersample: number;\r\n    channelcount: number;\r\n}\r\n\r\nexport enum connectivity {\r\n    Bluetooth = \"Bluetooth\",\r\n    Wired = \"Wired\",\r\n    WiFi = \"WiFi\",\r\n    Cellular = \"Cellular\",\r\n    InBuilt = \"InBuilt\",\r\n    Unknown = \"Unknown\",\r\n}\r\n\r\nexport enum type {\r\n    Phone = \"Phone\",\r\n    Speaker = \"Speaker\",\r\n    Car = \"Car\",\r\n    Headset = \"Headset\",\r\n    Thermostat = \"Thermostat\",\r\n    Microphones = \"Microphones\",\r\n    Deskphone = \"Deskphone\",\r\n    RemoteControl = \"RemoteControl\",\r\n    Unknown = \"Unknown\",\r\n    File = \"File\",\r\n    Stream = \"Stream\",\r\n}\r\n\r\nexport interface ICoordinate {\r\n    x: number;\r\n    y: number;\r\n}\r\n\r\n// For avatar synthesis\r\nexport interface ISynthesisSectionVideo {\r\n    protocol: {\r\n        name: string;\r\n        webrtcConfig: {\r\n            clientDescription: string;\r\n            iceServers: {\r\n                urls: string[];\r\n                username: string;\r\n                credential: string;\r\n            }[];\r\n        };\r\n    };\r\n    format: {\r\n        bitrate: number;\r\n        codec: string;\r\n        crop: {\r\n            topLeft: ICoordinate;\r\n            bottomRight: ICoordinate;\r\n        };\r\n        resolution: {\r\n            width: number;\r\n            height: number;\r\n        };\r\n    };\r\n    talkingAvatar: {\r\n        character: string;\r\n        customized: boolean;\r\n        useBuiltInVoice: boolean;\r\n        style: string;\r\n        photoAvatarBaseModel: string;\r\n        background: {\r\n            color: string;\r\n            image?: {\r\n                url: string;\r\n            };\r\n        };\r\n        scene?: {\r\n            zoom: number;\r\n            positionX: number;\r\n            positionY: number;\r\n            rotationX: number;\r\n            rotationY: number;\r\n            rotationZ: number;\r\n            amplitude: number;\r\n        };\r\n    };\r\n}\r\n"]}