該軟件包提供了一種簡單的方法,可以從node.js中的tiktok的文本到語音(TTS)API生成文本到語音音頻文件。
npm i tiktok-tts
const {config,createaudiofromtext} = require('tiktok-tts')config('your tiktok session in there there''); createAudiiofromtext('要說的文本toke toke toke there the eke there'');
const {config,createaudiofromtext} = require('tiktok-tts')config('your tiktok session in there there'); createaudiiofromtext(要說的'text tock to to to to to to to to to tome there there there'' myaudio''myaudio');
生成的音頻文件將保存為myAudio.mp3
const {config,createaudiofromtext} = require('tiktok-tts')config('your tiktok sessionid there there''''''''); createAudiiofromtext('要說的文本to to to to there oker there there'' ,'./mydirectory/myaudio');
生成的音頻文件將在myDirectory
目錄中保存為myAudio.mp3
。
myDirectory
需要成為現有目錄。const {config,createaudiofromtext} = require('tiktok-tts')config('your tiktok session in there there'); createAudiiofromText(要說的'text tock tock toke toke toke there there','myaudio','myaudio' ,'en_us_us_stormtorper'');
createAudioFromText()
函數一起await
const {config,createAudiofromText} = require('tiktok-tts')config('your tiktok session in there there on there'); async函數yourfunction yourfunction yourfunction()生成!”);} yourfunction();
為瀏覽器安裝Cookie編輯器擴展程序。
登錄到Tiktok Web
在Tiktok Web上,打開擴展名並查找sessionid
複製sessionid
值。 (應該是字母數值)
config(tiktoksessionid,custombaseurl)
範圍 | 描述 | 預設 | 類型 |
---|---|---|---|
tiktoksessionid | 您的tiktok sessionid | null | 細繩 |
CustomBaseurl | 自定義Tiktok API URL optional | - | 細繩 |
默認情況下,如果未指定customBaseUrl
,將使用https://api16-normal-c-useast1a.tiktokv.com/media/api/text/speech/invoke
使用。
https://api16-normal-c-useast1a.tiktokv.com/media/api/paix/text/speech/invoke
https://api16-core-c-useast1a.tiktokv.com/media/api/pai/text/speech/invoke
https://api16-normal-useast5.us.tiktokv.com/media/api/api/text/speech/invoke
https://api16-core.tiktokv.com/media/api/text/speech/invoke
https://api16-core-useast5.us.tiktokv.com/media/api/text/speech/invoke
https://api19-core-c-useast1a.tiktokv.com/media/api/api/text/speech/invoke
https://api-core.tiktokv.com/media/api/text/speech/invoke
https://api-normal.tiktokv.com/media/api/text/speech/invoke
https://api19-normal-c-useast1a.tiktokv.com/media/api/paix/text/speech/invoke
https://api16-core-core-c-yasg.tiktokv.com/media/api/text/speech/invoke
https://api16-normal-c-alisg.tiktokv.com/media/api/text/speech/invoke
https://api22-core-core-cy-alisg.tiktokv.com/media/api/text/speech/invoke
https://api16-normal-c-useast2a.tiktokv.com/media/api/pai/text/speech/invoke
CreateAudioFromText(文本,文件名,揚聲器)
範圍 | 描述 | 預設 | 類型 |
---|---|---|---|
文字 | 要轉換為音頻的文字 | null | 細繩 |
文件名 | 生成的音頻文件的文件名/路徑optional | audio | 細繩 |
揚聲器 | tiktok揚聲器代碼optional | en_us_001 | 細繩 |
支持以下揚聲器代碼:
語言 | 揚聲器 | 揚聲器代碼 |
---|---|---|
英語 | 遊戲開啟 | en_male_jomboy |
傑西 | en_us_002 | |
溫暖的 | ES_MX_002 | |
古怪 | en_male_funny | |
尖叫 | en_us_ghostface | |
善解人意 | en_female_samc | |
嚴肅的 | en_male_cody | |
美容大師 | en_female_makeup | |
好朋友 | en_female_richgirl | |
騙子 | en_male_grinch | |
喬伊 | en_us_006 | |
故事櫃員 | en_male_narration | |
古德先生 | en_male_deadpool | |
敘述者 | en_uk_001 | |
英國男性英國 | en_uk_003 | |
地鐵 | en_au_001 | |
阿爾弗雷德 | en_male_jarvis | |
Ashmagic | en_male_ashmagic | |
Olantekkers | en_male_olantekkers | |
勳爵克林格 | en_male_ukneighbor | |
細緻先生 | en_male_ukbutler | |
處女座 | en_female_shenna | |
大學 | en_female_pansino | |
馬蒂 | en_male_trevor | |
流行催眠曲 | en_female_f08_twinkle | |
經典電氣 | en_male_m03_classical | |
貝 | en_female_betty | |
丘比特 | en_male_cupid | |
奶奶 | en_female_grandma | |
舒適 | en_male_m2_xhxs_m03_christmas | |
作者 | en_male_santa_narration | |
頌歌 | en_male_sing_deep_jingle | |
聖誕老人 | en_male_santa_effect | |
NYE 2023 | en_female_ht_f08_newyear | |
魔術師 | en_male_wizard | |
歌劇 | EN_FEMALE_HT_F08_HALLOEN | |
欣快 | en_female_ht_f08_glorious | |
高度 | en_male_sing_funny_it_goes_up | |
情節劇 | en_female_ht_f08_wonderful_world | |
古怪的時間 | en_male_m2_xhxs_m03_silly | |
和平 | en_female_emotional | |
Toon Beat | en_male_m03_sunshine_soon | |
打開麥克風 | en_female_f08_warmy_breeze | |
叮噹聲 | en_male_m03_lobby | |
感恩 | en_male_sing_funny_thanksgiving | |
Cottagecore | en_female_f08_salut_damour | |
教授 | en_us_007 | |
科學家 | en_us_009 | |
信心 | en_us_010 | |
光滑的 | en_au_002 | |
迪士尼 | 鬼臉 | en_us_ghostface |
Chewbacca | en_us_chewbacca | |
C3PO | en_us_c3po | |
縫 | en_us_stitch | |
突擊隊員 | EN_US_STORMTROOPER | |
火箭 | en_us_rocket | |
leota夫人 | en_female_madam_leota | |
幽靈主持人 | en_male_ghosthost | |
海盜 | en_male_pirate | |
法語 | 法語 - 男性1 | FR_001 |
法語 - 男性2 | FR_002 | |
西班牙語 | 西班牙(西班牙) - 男性 | ES_002 |
西班牙MX-男性 | ES_MX_002 | |
葡萄牙語 | 葡萄牙BR-女1 | BR_001 |
葡萄牙BR-女性2 | BR_003 | |
葡萄牙BR-女性3 | BR_004 | |
葡萄牙BR-男性 | BR_005 | |
Ivete Sangalo | bp_female_ivete | |
盧德米拉 | bp_female_ludmilla | |
LHAYS MACEDO | pt_female_lhays | |
laizza | pt_female_laizza | |
GalvãoBueno | pt_male_bueno | |
德語 | 德語 - 女 | de_001 |
德語 - 男性 | de_002 | |
印度尼西亞 | 印尼 - 女性 | ID_001 |
日本人 | 日語 - 女1 | JP_001 |
日語 - 女2 | JP_003 | |
日語 - 女性3 | JP_005 | |
日語 - 男性 | JP_006 | |
りーさ | jp_female_fujicochan | |
世羅鈴 | jp_female_hasegawariona | |
莫里奧的廚房 | jp_male_keiichinakano | |
夏絵ココ | JP_FEMALE_OOMAEAIKA | |
低音ボイス | jp_male_yujinchigusa | |
四郎 | jp_female_shirou | |
玉川壽紀 | jp_male_tamawakazuki | |
莊司果織 | jp_female_kaorishoji | |
八木沙季 | jp_female_yagishaki | |
ヒカキン | jp_male_hikakin | |
丸山禮 | jp_female_rei | |
修一朗 | jp_male_shuichiro | |
マツダ家の日常 | jp_male_matsudake | |
まちこりーた | jp_female_machikoriiita | |
モジャオ | jp_male_matsuo | |
モリスケ | jp_male_osada | |
韓國人 | 韓文 - 男性1 | KR_002 |
韓語 - 女性 | KR_003 | |
韓語 - 男性2 | KR_004 | |
越南人 | 女性 | bv074_streaming |
男性 | bv075_streaming | |
其他 | 阿爾托 | en_female_f08_salut_damour |
男高音 | en_male_m03_lobby | |
陽光很快 | en_male_m03_sunshine_soon | |
溫暖的微風 | en_female_f08_warmy_breeze | |
輝煌 | en_female_ht_f08_glorious | |
它上升了 | en_male_sing_funny_it_goes_up | |
花栗鼠 | en_male_m2_xhxs_m03_silly | |
戲劇性 | en_female_ht_f08_wonderful_world |