1 | import url from 'url';
|
2 | interface Option {
|
3 | lang?: string;
|
4 | slow?: boolean;
|
5 | host?: string;
|
6 | }
|
7 | /**
|
8 | * Generate "Google TTS" audio URL
|
9 | *
|
10 | * @param {string} text length should be less than 200 characters
|
11 | * @param {object?} option
|
12 | * @param {string?} option.lang default is "en"
|
13 | * @param {boolean?} option.slow default is false
|
14 | * @param {string?} option.host default is "https://translate.google.com"
|
15 | * @return {string} url
|
16 | */
|
17 | export declare const getAudioUrl: (text: string, { lang, slow, host }?: Option) => string;
|
18 | interface LongTextOption extends Option {
|
19 | splitPunct?: string;
|
20 | }
|
21 | /**
|
22 | * @typedef {object} Result
|
23 | * @property {string} shortText
|
24 | * @property {string} url
|
25 | */
|
26 | /**
|
27 | * Split the long text into multiple short text and generate audio URL list
|
28 | *
|
29 | * @param {string} text
|
30 | * @param {object?} option
|
31 | * @param {string?} option.lang default is "en"
|
32 | * @param {boolean?} option.slow default is false
|
33 | * @param {string?} option.host default is "https://translate.google.com"
|
34 | * @param {string?} option.splitPunct split punctuation
|
35 | * @return {Result[]} the list with short text and audio url
|
36 | */
|
37 | export declare const getAllAudioUrls: (text: string, { lang, slow, host, splitPunct, }?: LongTextOption) => {
|
38 | shortText: string;
|
39 | url: string;
|
40 | }[];
|
41 | export {};
|
42 | //# sourceMappingURL=getAudioUrl.d.ts.map |
\ | No newline at end of file |