1 | ## 2.0.2 (Mar 20, 2021)
|
2 |
|
3 | - Change default language to `en` ([#45](https://github.com/zlargon/google-tts/issues/45))
|
4 | - Typescript: Remove type `Language` since API doesn't fully support language codes listed in the document
|
5 |
|
6 | ## 2.0.1 (Jan 6, 2021)
|
7 |
|
8 | - Fix the vulnerabilities by upgrading the dependencies (#42, #44)
|
9 |
|
10 | ## 2.0.0 (Dec 8, 2020)
|
11 |
|
12 | - Add new APIs (Please see the **Break Change** below)
|
13 |
|
14 | | Method | Options (optional) | Return Type | Handle Long Text |
|
15 | | ------------------- | ----------------------------------------------- | --------------------------------------------------- | :--------------: |
|
16 | | `getAudioUrl` | `lang`, `slow`, `host` | `string` | |
|
17 | | `getAudioBase64` | `lang`, `slow`, `host`, `timeout` | `Promise<string>` | |
|
18 | | `getAllAudioUrls` | `lang`, `slow`, `host`, `splitPunct` | `{ shortText: string; url: string; }[]` | ✅ |
|
19 | | `getAllAudioBase64` | `lang`, `slow`, `host`, `timeout`, `splitPunct` | `Promise<{ shortText: string; base64: string; }[]>` | ✅ |
|
20 |
|
21 | - Support new Google TTS API to get audio Base64 text ([#35](https://github.com/zlargon/google-tts/issues/35))
|
22 | - Support long text input: `getAllAudioUrls` and `getAllAudioBase64` ([#30](https://github.com/zlargon/google-tts/issues/30))
|
23 | - Support changing the `host` in option ([#16](https://github.com/zlargon/google-tts/issues/16))
|
24 | - Support Typescript
|
25 | - Add dependency [axios](https://github.com/axios/axios)
|
26 |
|
27 | ### **Break Change from 0.x.x to 2.x.x**
|
28 |
|
29 | `googleTTS()` is changed to `googleTTS.getAudioUrl()`.
|
30 |
|
31 | ```js
|
32 | const googleTTS = require('google-tts-api');
|
33 |
|
34 | // Before version 0.0.6
|
35 | // Original googleTTS is a promise function
|
36 | const url = await googleTTS('Hello World', 'en', 1);
|
37 |
|
38 | // After version 2.0.0
|
39 | // Now googleTTS is an object with 4 new methods (getAudioUrl, getAudioBase64, getAllAudioUrls, getAllAudioBase64)
|
40 | // googleTTS.getAudioUrl is a non-promise function
|
41 | const url = googleTTS.getAudioUrl('Hello World', {
|
42 | lang: 'en-US',
|
43 | slow: false, // speed (number) is changed to slow (boolean)
|
44 | host: 'https://translate.google.com', // allow to change the host
|
45 | });
|
46 | ```
|
47 |
|
48 | ## 0.0.6 (Dec 5, 2020)
|
49 |
|
50 | - `timeout` parameter is deprecated.
|
51 | - Remove dependency `isomorphic-fetch`.
|
52 | - Fix the change of Google Translate API ([@freddiefujiwara](https://github.com/freddiefujiwara) in [#37](https://github.com/zlargon/google-tts/pull/37)). Read more in [#35](https://github.com/zlargon/google-tts/issues/35)
|
53 |
|
54 | ## 0.0.5 (Nov 8, 2020)
|
55 |
|
56 | - Upgrade the dependencies and fix the vulnerability. ([#32](https://github.com/zlargon/google-tts/issues/32))
|
57 | - Add retry mechanism to prevent fetching token key failed too frequently. ([#33](https://github.com/zlargon/google-tts/issues/33))
|
58 |
|
59 | ## 0.0.4 (Nov 29, 2018)
|
60 |
|
61 | - Fix the change of Google Translate API ([@ncpierson](https://github.com/ncpierson) in [#19](https://github.com/zlargon/google-tts/pull/19))
|
62 |
|
63 | ## 0.0.3 (Sep 21, 2018)
|
64 |
|
65 | - Add package-lock.lock file
|
66 | - Fix the change of Google Translate API ([@ncpierson](https://github.com/ncpierson) in [#14](https://github.com/zlargon/google-tts/pull/14))
|
67 |
|
68 | ## 0.0.2 (Aug 25, 2017)
|
69 |
|
70 | - Add yarn.lock file
|
71 | - If length of input text is over than 200 characters, throw a `RangeError` with error messsage. ([#5](https://github.com/zlargon/google-tts/issues/5))
|