zlargon / google-tts

Google TTS (Text-To-Speech) for node.js
https://www.npmjs.com/package/google-tts-api
MIT License
279 stars 56 forks source link

Add support for "auto" language #46

Open SuspiciousLookingOwl opened 3 years ago

SuspiciousLookingOwl commented 3 years ago

This can be done by sending a request with data:

[[["MkEWBc","[[\"WORD_TO_CHECK\",\"auto\",\"TARGET_LANGUAGE\",true],[null]]",null,"generic"]]]

example result

)]}'

393
[["wrb.fr","MkEWBc","[[null,null,\"en\",[[[0,[[[null,7]\n]\n,[true]\n]\n]\n]\n,7]\n]\n,[[[null,null,null,null,null,[[\"pengujian\",[\"pengujian\"]\n]\n]\n]\n]\n,\"id\",1,\"auto\",[\"testing\",\"auto\",\"id\",true]\n]\n,\"en\",[\"testing\",null,null,[[\"test\"]\n,null,1]\n,null,null,null,null,\"en\",1]\n]\n",null,null,null,"generic"]
,["di",29]
,["af.httprm",28,"-2444905251841777356",28]
]
26
[["e",4,null,null,430]
]

where the detected language seems to be in ...[[null,null,\"en\"...

But this also mean that we need to send 2 requests, first to get the detected language, second to get the base64 data

zlargon commented 3 years ago

@SuspiciousLookingOwl Thank you for the information. It's interesting! I think it would be nice to have this language detection feature!