diff --git a/src/modules/tts-modes/azure.ts b/src/modules/tts-modes/azure.ts index 9b881aa..dea6032 100644 --- a/src/modules/tts-modes/azure.ts +++ b/src/modules/tts-modes/azure.ts @@ -28,6 +28,13 @@ interface PendingRequest { audioBuff: Buffer[]; } +interface VoiceInfo { + Name: string; + // ShortName: string, + // Gender: string, + // Locale: string, +} + class AzureTTS implements TTSModule { private voices: Array | undefined = undefined; @@ -81,7 +88,7 @@ class AzureTTS implements TTSModule { res.on('data', (chunk) => chunks.push(chunk)); res.on('end', () => { const body = Buffer.concat(chunks).toString(); - this.voices = JSON.parse(body).map((v: any) => v.ShortName) + this.voices = JSON.parse(body).map((v: VoiceInfo) => v.ShortName); resolve(this.voices); }); req.on('error', (err) => {