Vonage / vonage-node-sdk

Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Apache License 2.0
375 stars 178 forks source link

[Bug]: Differences between documentation and implementation #925

Closed ThingUroboros closed 1 month ago

ThingUroboros commented 3 months ago

Node Version

20.x

Platform

Docker Container

SDK Version

@vonage/voice@1.11.1

Code Sample

...

  'af', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'ar', // 
  'bg', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'bn', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'ca', //
  'cmn', //
  'cs', //
  'cy', //
  'da', //
  'de', //
  'el', //
  'en', //
  'es', //
  'eu', //
  'fi', //
  'fil', //
  'fr', //
  'gl', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'gu', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'he', //
  'hi', //
  'hu', //
  'id', //
  'is', //
  'it', //
  'ja', //
  'kn', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'ko', // 
  'lv', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'ml', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'ms', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'nb', //
  'nl', //
  'no', //
  'pa', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'pl', //
  'pt', //
  'ro', //
  'ru', //
  'sk', // 
  'sr', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'sv', //
  'ta', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'te', // missing https://github.com/Vonage/vonage-node-sdk/blob/%40vonage/voice%401.11.1/packages/voice/lib/enums/TTSLanguages.ts
  'th', //
  'tr', //
  'uk', //
  'vi', //
  'yue', //

Expected Behavior

I have come across discrepancies in the documentation regarding language support in the library's. What should I base it on?

https://developer.vonage.com/en/voice/voice-api/concepts/text-to-speech#supported-languages https://github.com/nexmo-community/vapi-tts-voices/blob/main/voices.json https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/voice/lib/enums/TTSLanguages.ts

Actual Behavior

I don't know.

manchuck commented 3 months ago

@ThingUroboros We continue to keep adding new TTS voices. The enum to help ensure the correct voice/language is passed in. You should be able to pass in any string you like with out any issues. Are you having a hard time compiling? If not, then the next time we do work on the voice package, we will update the list.

ThingUroboros commented 3 months ago

@manchuck The error lies in the type of the 'language' parameter.

Snímek obrazovky 2024-03-20 v 23 08 51
NCCOAction 
...
language?: TTSLanguages | undefined
...

export type TalkAction = {
    action: NCCOActions.TALK;
    text: string;
    bargeIn?: boolean;
    loop?: number;
    level?: string;
    language?: TTSLanguages;
    style?: string;
    premium?: boolean;
};
manchuck commented 1 month ago

@ThingUroboros I will update the type to accept either the enum or a string to avoid this problem. We are constantly adding languages faster than we can deploy new updates to this list.

manchuck commented 1 month ago

@ThingUroboros v3.14.1 of the @vonage/server-sdk (v1.12.1 of @vonage/voice) has been released with these languages update