File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 9
9
Example:
10
10
(original female) <a href =" /?text=こんにちは&lang=ja " >/?text=こんにちは&lang=ja</a >
11
11
(male pitch) <a href =" /?text=こんにちは&lang=ja&pitch=0.8 " >/?text=こんにちは&lang=ja&pitch=0.8</a >
12
- Repostory:
13
- <a href =" https://github.com/sglkc/tts-api " >https://github.com/sglkc/tts-api</a >
12
+ (json) { "text": "Selamat dunia", "lang": "id" }
13
+ Repository:
14
+ Please leave a star <a href =" https://github.com/sglkc/tts-api " >https://github.com/sglkc/tts-api</a > ;)
14
15
</pre >
Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ import * as TTS from '@sefinek/google-tts-api'
9
9
10
10
export default async function main ( payload , ffmpegPath = null ) {
11
11
const { text, lang = 'en' , speed, pitch = 1 } = payload
12
- const cors = {
12
+ const headers = {
13
13
'Access-Control-Allow-Origin' : '*' ,
14
14
'Access-Control-Allow-Headers' : '*' ,
15
15
'Access-Control-Allow-Methods' : '*' ,
16
+ 'Cache-Control' : 'public, max-age=31536000, immutable'
16
17
}
17
18
18
19
if ( ! text || ! text . length ) {
@@ -21,7 +22,7 @@ export default async function main(payload, ffmpegPath = null) {
21
22
statusText : '`text` is missing' ,
22
23
headers : {
23
24
'content-type' : 'text/html; charset=utf-8' ,
24
- ...cors
25
+ ...headers
25
26
}
26
27
} )
27
28
}
@@ -61,6 +62,6 @@ export default async function main(payload, ffmpegPath = null) {
61
62
headers : {
62
63
'content-type' : 'audio/mp3' ,
63
64
'content-disposition' : 'inline' ,
64
- ...cors
65
+ ...headers
65
66
}
66
67
} ) }
You can’t perform that action at this time.
0 commit comments