UNPKG
@minto-ai/xunfei-tts
Version:
latest (2.2.1)
2.2.1
2.1.1
2.0.33
2.0.32
2.0.31
2.0.3
2.0.2
1.0.55
1.0.54
1.0.53
1.0.52
1.0.51
1.0.50
1.0.2
1.0.1
借助“讯飞在线语音合成API”实现浏览器端“文本转语音
@minto-ai/xunfei-tts
/
src
/
utils
/
encode.ts
11 lines
(8 loc)
•
203 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{
Base64
}
from
'js-base64'
function
encodeText
(
text
:
string
,
encoding
:
string
) {
if
(encoding ===
'UTF8'
) {
return
Base64
.
encode
(text) }
return
text }
export
{ encodeText }