Koodo Reader

Audio Plugins

Read books aloud with Azure TTS, Amazon Polly, MultiTTS, ChatTTS, GPT-Sovitz, and other voice plugins.

Azure TTS (API Key)

Features: Use official API Key and API interface

Website: Azure Speech in Foundry Tools | Microsoft Azure

Configuration Steps: Modify the region and apiKey in the config field to your own configuration

{
  "identifier": "azure-tts-voice-plugin",
  "type": "voice",
  "displayName": "Azure TTS",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {
    "region": "eastus",
    "apiKey": ""
  },
  "voiceList": [],
  "scriptSHA256": "0847cea0a9ff28f65f377a7dc9a19a281a7c9371bacf20a7a86a6b1265b117eb",
  "script": "const getAudioPath=async(e,t,o,i)=>{let a=require(\"path\"),s=require(\"fs\"),n=new Date().getTime()+\".mp3\";return s.existsSync(a.join(o,\"tts\"))?(s.writeFileSync(a.join(o,\"tts\",n),await getTTSAudio(e,t,i)),console.log(\"folder already exists\")):(s.mkdirSync(a.join(o,\"tts\")),s.writeFileSync(a.join(o,\"tts\",n),await getTTSAudio(e,t,i)),console.log(\"folder created successfully\")),a.join(o,\"tts\",n)},getTTSAudio=async(e,t,o)=>{let i=o.region||\"eastus\",a=o.apiKey||\"\",s=o.voiceName||\"en-US-AvaMultilingualNeural\",n=\"audio-16khz-128kbitrate-mono-mp3\",r=`<speak version='1.0' xml:lang='en-US'><voice name='${s}'><prosody rate='${t?`${Math.round((t-1)*100)}%`:\"0%\"}'>${e}<\/prosody><\/voice><\/speak>`,c=`https:\/\/${i}.tts.speech.microsoft.com\/cognitiveservices\/v1`,l=require(\"axios\");return new Promise((e,t)=>{l.post(c,r,{headers:{\"Ocp-Apim-Subscription-Key\":a,\"Content-Type\":\"application\/ssml+xml\",\"X-Microsoft-OutputFormat\":n,\"User-Agent\":\"koodo-reader\"},responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(e=>{console.log(e),t(\"\")})})},getTTSVoice=async e=>{let t=e.region||\"eastus\",o=e.apiKey||\"\",i=`https:\/\/${t}.tts.speech.microsoft.com\/cognitiveservices\/voices\/list`,a=require(\"axios\");return new Promise((t,s)=>{a.get(i,{headers:{\"Ocp-Apim-Subscription-Key\":o}}).then(o=>{console.log(o);t(o.data.map(t=>({name:t.ShortName,gender:t.Gender.toLowerCase(),locale:t.Locale,displayName:`Azure TTS - ${t.LocalName} (${t.Locale}) - ${t.Gender}`,plugin:\"azure-tts-voice-plugin\",config:{...e,voiceName:t.ShortName}})))}).catch(e=>{console.log(e),s(\"\")})})};global.getAudioPath=getAudioPath,global.getTTSVoice=getTTSVoice;"
}

Amazon Polly (API Key)

Features: Use official API Key and API interface

Website: AI Voice Generator and Text-to-Speech Tool - Amazon Polly - AWS

Configuration Steps: Modify the accessKeyId, secretAccessKey and region in the config field to your own configuration

{
  "identifier": "amazon-polly-voice-plugin",
  "type": "voice",
  "displayName": "Amazon Polly",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {
    "accessKeyId": "[Your Access Key ID]",
    "secretAccessKey": "[Your Secret Access Key]",
    "region": "[Your Region Code]"
  },
  "voiceList": [],
  "scriptSHA256": "643c336766c147d153235bb232ff2e4078f12609c7c803a49779539f39bf01c1",
  "script": "const getAudioPath=async(e,t,a,s)=>{const n=require(\"path\"),o=require(\"fs\");let i=(new Date).getTime()+\".mp3\";return o.existsSync(n.join(a,\"tts\"))?(o.writeFileSync(n.join(a,\"tts\",i),await getTTSAudio(e,t,s)),console.log(\"folder already exists\")):(o.mkdirSync(n.join(a,\"tts\")),o.writeFileSync(n.join(a,\"tts\",i),await getTTSAudio(e,t,s)),console.log(\"folder created successfully\")),n.join(a,\"tts\",i)},getSignatureKey=(e,t,a,s,n)=>{const o=e.createHmac(\"sha256\",\"AWS4\"+t).update(a).digest(),i=e.createHmac(\"sha256\",o).update(s).digest(),r=e.createHmac(\"sha256\",i).update(n).digest();return e.createHmac(\"sha256\",r).update(\"aws4_request\").digest()},getAmzDateTime=()=>{const e=(new Date).toISOString().replace(/[:\\-]|\\.\\d{3}/g,\"\").slice(0,15)+\"Z\",t=e.slice(0,8);return{amzDate:e,dateStamp:t}},getTTSAudio=async(e,t,a)=>{const s=require(\"crypto\"),n=require(\"axios\");let o=a.region||\"us-east-1\",i=a.accessKeyId||\"\",r=a.secretAccessKey||\"\",c=a.voiceId||\"Joanna\",d=a.engine||\"neural\",g=t?`${Math.round(100*t)}%`:\"100%\";const l=\"polly\",u=`polly.${o}.amazonaws.com`,p=`https://${u}/v1/speech`,m=\"application/json\",h=JSON.stringify({Engine:d,OutputFormat:\"mp3\",Text:`<speak><prosody rate=\"${g}\">${e}</prosody></speak>`,TextType:\"ssml\",VoiceId:c}),{amzDate:y,dateStamp:$}=getAmzDateTime(),S=s.createHash(\"sha256\").update(h).digest(\"hex\"),A=\"content-type;host;x-amz-date\",T=[\"POST\",\"/v1/speech\",\"\",`content-type:${m}\\nhost:${u}\\nx-amz-date:${y}\\n`,A,S].join(\"\\n\"),z=\"AWS4-HMAC-SHA256\",x=`${$}/${o}/${l}/aws4_request`,H=[z,y,x,s.createHash(\"sha256\").update(T).digest(\"hex\")].join(\"\\n\"),w=getSignatureKey(s,r,$,o,l),j=`${z} Credential=${i}/${x}, SignedHeaders=${A}, Signature=${s.createHmac(\"sha256\",w).update(H).digest(\"hex\")}`;return new Promise((e,t)=>{n.post(p,h,{headers:{\"Content-Type\":m,\"X-Amz-Date\":y,Authorization:j},responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(e=>{console.log(e),t(\"\")})})},getTTSVoice=async e=>{const t=require(\"crypto\"),a=require(\"axios\");let s=e.region||\"us-east-1\",n=e.accessKeyId||\"\",o=e.secretAccessKey||\"\";const i=\"polly\",r=`polly.${s}.amazonaws.com`,c=\"/v1/voices\",d=\"Engine=neural\",{amzDate:g,dateStamp:l}=getAmzDateTime(),u=t.createHash(\"sha256\").update(\"\").digest(\"hex\"),p=\"host;x-amz-date\",m=[\"GET\",c,d,`host:${r}\\nx-amz-date:${g}\\n`,p,u].join(\"\\n\"),h=\"AWS4-HMAC-SHA256\",y=`${l}/${s}/${i}/aws4_request`,$=[h,g,y,t.createHash(\"sha256\").update(m).digest(\"hex\")].join(\"\\n\"),S=getSignatureKey(t,o,l,s,i),A=`${h} Credential=${n}/${y}, SignedHeaders=${p}, Signature=${t.createHmac(\"sha256\",S).update($).digest(\"hex\")}`,T=`https://${r}${c}?${d}`;return new Promise((t,s)=>{a.get(T,{headers:{\"X-Amz-Date\":g,Authorization:A}}).then(a=>{console.log(a);let s=a.data.Voices;t(s.map(t=>({name:t.Id,gender:t.Gender.toLowerCase(),locale:t.LanguageCode,displayName:`Amazon Polly - ${t.Name} (${t.LanguageCode}) - ${t.Gender}`,plugin:\"amazon-polly-voice-plugin\",config:{...e,voiceId:t.Id,engine:(t.SupportedEngines||[]).includes(\"neural\")?\"neural\":\"standard\"}})))}).catch(e=>{console.log(e),s(\"\")})})};global.getAudioPath=getAudioPath,global.getTTSVoice=getTTSVoice;"
}

MultiTTS

Features: Utilizes the voice engine on Andorid phone for Text-to-Speech

Website: Telegram: View @MultiTTS_channel

Configuration Steps:

  1. Download and install the APK package from the channel.
  2. Download the voice pack from the MultiTTS resource channel: Telegram: View @MultiTTS_resource
  3. Import the voice pack into MultiTTS
  4. From the voice list, select any voice as the narrator speaker
  5. Launch the TTS forwarder from the sidebar.
  6. Obtain the local area network (LAN) IP address of your Android phone (You can obtain it from the router's admin panel or the WiFi details on your phone) and copy it into the config→host field below. Use the default 8774 as the port.
  7. Please note that this plugin is only applicable when both the computer and the phone are on the same local network.
{
  "identifier": "multitts-voice-plugin",
  "type": "voice",
  "displayName": "MultiTTS",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {
    "host": "192.168.28.41",
    "port": "8774"
  },
  "voiceList": [],
  "scriptSHA256": "90b4e099af96e543b63be449b2988ba27b4e17583b19eb331914ad3492d5c84e",
  "script": "const getAudioPath=async(t,e,o,i)=>{let a=require(\"path\"),l=require(\"fs\"),n=new Date().getTime()+\".wav\";return l.existsSync(a.join(o,\"tts\"))?(l.writeFileSync(a.join(o,\"tts\",n),await getTTSAudio(t,e,i)),console.log(\"folder already exists\")):(l.mkdirSync(a.join(o,\"tts\")),l.writeFileSync(a.join(o,\"tts\",n),await getTTSAudio(t,e,i)),console.log(\"folder created successfully\")),a.join(o,\"tts\",n)},objectToQueryString=t=>{let e=[];for(let o in t)if(t.hasOwnProperty(o)){let i=t[o],a=encodeURIComponent(o),l=encodeURIComponent(i);e.push(`${a}=${l}`)}return e.join(\"&\")},getTTSAudio=async(t,e,o)=>{let i,a=\"http://\"+(o.host||\"127.0.0.1\")+\":\"+(o.url||\"8774\")+\"/forward\",l=o.pitch||\"50\",n=50*e||\"50\",r=o.volume||\"50\",s=o.voice||\"\",c=require(\"axios\");return new Promise((e,o)=>{c.get(a+\"?\"+objectToQueryString({volume:r,pitch:l,speed:n,voice:s,text:t}),{responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(t=>{console.log(t),o(\"\")})})},getTTSVoice=async t=>{let e,o=\"http://\"+(t.host||\"127.0.0.1\")+\":\"+(t.url||\"8774\")+\"/voices\",i=require(\"axios\");return new Promise((e,a)=>{i.get(o).then(o=>{console.log(o);let i=o.data;(console.log(i,\"result\"),i.success)?e(Object.values(i.data.catalog).flat().map(e=>({name:e.id,gender:e.gender,locale:e.locale,displayName:e.name,plugin:\"multitts-voice-plugin\",config:t}))):e([])}).catch(t=>{console.log(t),a(\"\")})})};global.getAudioPath=getAudioPath,global.getTTSVoice=getTTSVoice;"
}

TTS Server Android

Features: Utilizes the voice engine on Andorid phone for Text-to-Speech

Website: jing332/tts-server-android: This is an Android TTS application.(github.com)

Configuration Steps:

  1. Download and install the APK package.
  2. Launch the system TTS forwarder, copy the Legado reading link into the config→url field below.
  3. Obtain the local area network (LAN) IP address of your Android phone and copy it into the config→host field below.
  4. Please note that this plugin is only applicable when both the computer and the phone are on the same local network.
{
  "identifier": "ttsserver-voice-plugin",
  "type": "voice",
  "displayName": "TTS Server",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {},
  "voiceList": [
    {
      "name": "xiaoxiao",
      "gender": "female",
      "locale": "zh-CN",
      "displayName": "Xiaoxiao",
      "plugin": "ttsserver-voice-plugin",
      "config": {
        "host": "192.168.31.21",
        "url": "http://localhost:1221/api/legado?api=http://localhost:1221/api/tts&name=TTS Server (com.github.jing332.tts_server_android)&engine=com.github.jing332.tts_server_android&pitch=100&voice=⚠️请在右上角打开多语音!晓晓(zh-CN-XiaoxiaoNeural)_1690331046541"
      }
    }
  ],
  "scriptSHA256": "101e5baea3973b7e79d4dc620b0961671c8ba7b97fe3ff85286245289d6ad925",
  "script": "const getAudioPath=async(t,e,r,o)=>{let i=require(\"path\"),a=require(\"fs\"),n=new Date().getTime()+\".wav\";return a.existsSync(i.join(r,\"tts\"))?(a.writeFileSync(i.join(r,\"tts\",n),await getTTSAudio(t,e,o)),console.log(\"folder already exists\")):(a.mkdirSync(i.join(r,\"tts\")),a.writeFileSync(i.join(r,\"tts\",n),await getTTSAudio(t,e,o)),console.log(\"folder created successfully\")),i.join(r,\"tts\",n)},objectToQueryString=t=>{let e=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],i=encodeURIComponent(r),a=encodeURIComponent(o);e.push(`${i}=${a}`)}return e.join(\"&\")},getTTSAudio=async(t,e,r)=>{let o=r.host||\"127.0.0.1\",i=parseUrlParams(r.url||\"\"),a=i.api||\"http://localhost:1221/api/tts\",n=i.engine||\"com.github.jing332.tts_server_android\",s=i.pitch||\"100\",l=i.rate||\"50\",c=i.voice||\"\";a=a.replace(\"localhost\",o);let u=require(\"axios\");return new Promise((e,r)=>{u.get(a+\"?\"+objectToQueryString({engine:n,pitch:s,rate:l,voice:c,text:t}),{responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(t=>{console.log(t),r(\"\")})})};function parseUrlParams(t){let e=new URL(t),r=new URLSearchParams(e.search),o={};for(let[i,a]of r.entries())o[i]=decodeURIComponent(a);return o}global.getAudioPath=getAudioPath;"
}

ChatTTS UI

Features: Realistic AI Voice, requires self-deployment and configuration,only recommemded for professional user

Website: jianchang512/ChatTTS-ui: A simple native web interface that uses ChatTTS to synthesize text into speech, along with support for external API interfaces. (github.com)

Configuration: jianchang512/ChatTTS-ui: A simple native web interface that uses ChatTTS to synthesize text into speech, along with support for external API interfaces. (github.com)

{
  "identifier": "chatttsui-voice-plugin",
  "type": "voice",
  "displayName": "ChatTTS UI",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {},
  "voiceList": [
    {
      "name": "xiaoxiao",
      "gender": "Female",
      "locale": "zh-CN",
      "displayName": "Xiaoxiao",
      "plugin": "chatttsui-voice-plugin",
      "config": {
        "url": "http://127.0.0.1:9966/tts",
        "prompt": "",
        "voice": "3333",
        "temperature": 0.3,
        "top_p": 0.7,
        "top_k": 20,
        "skip_refine": 0,
        "custom_voice": 0
      }
    }
  ],
  "scriptSHA256": "a41e7c5998e8f734b6293cde75e5e8d767c76a4cb23689a1d853ad380cf0eeb9",
  "script": "const getAudioPath=async(t,e,o,i)=>{let p=i.url||\"http://127.0.0.1:9966/tts\",a=i.prompt||\"\",r=i.voice||\"3333\",s=i.temperature||.3,c=i.top_p||.7,u=i.top_k||20,n=i.skip_refine||0,$=i.custom_voice||0,d=require(\"qs\"),m=require(\"axios\");return new Promise((e,o)=>{m.post(p,d.stringify({text:t,prompt:a,voice:r,temperature:s,top_p:c,top_k:u,skip_refine:n,custom_voice:$})).then(t=>{console.log(t),0==t.data.code?e(t.data.audio_files[0].filename):e(\"\")}).catch(t=>{console.log(t),o(\"\")})})};global.getAudioPath=getAudioPath;"
}

ChatTTS

Features: Realistic AI Voice, requires self-deployment and configuration,only recommemded for professional user

Website: 2noise/ChatTTS: A generative speech model for daily dialogue. (github.com)

Configuration: ChatTTS/examples/api/README.md at main · 2noise/ChatTTS (github.com)

{
  "identifier": "chattts-voice-plugin",
  "type": "voice",
  "displayName": "ChatTTS",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {},
  "voiceList": [
    {
      "name": "xiaoxiao",
      "gender": "Female",
      "locale": "zh-CN",
      "displayName": "Xiaoxiao",
      "plugin": "chattts-voice-plugin",
      "config": {
        "url": "http://127.0.0.1:8000/generate_voice",
        "body": {
          "lang": null,
          "skip_refine_text": true,
          "refine_text_only": false,
          "use_decoder": true,
          "audio_seed": 12345678,
          "text_seed": 87654321,
          "do_text_normalization": true,
          "do_homophone_replacement": false
        },
        "params_refine_text": {
          "prompt": "",
          "top_P": 0.7,
          "top_K": 20,
          "temperature": 0.7,
          "repetition_penalty": 1,
          "max_new_token": 384,
          "min_new_token": 0,
          "show_tqdm": true,
          "ensure_non_empty": true,
          "stream_batch": 24
        },
        "params_infer_code": {
          "prompt": "[speed_5]",
          "top_P": 0.1,
          "top_K": 20,
          "temperature": 0.3,
          "repetition_penalty": 1.05,
          "max_new_token": 2048,
          "min_new_token": 0,
          "show_tqdm": true,
          "ensure_non_empty": true,
          "stream_batch": true,
          "spk_emb": null
        }
      }
    }
  ],
  "scriptSHA256": "eedbe0c1854d84b23f7a2f39ecf06983955df38378166f32b4d33b1bd302d31e",
  "script": "const getAudioPath=async(t,e,a,i)=>{let n=require(\"path\"),r=require(\"fs\"),o=new Date().getTime()+\".mp3\";return r.existsSync(n.join(a,\"tts\"))?(r.writeFileSync(n.join(a,\"tts\",o),await getTTSAudio(t,e,i)),console.log(\"\u6587\u4EF6\u5939\u5DF2\u5B58\u5728\")):(r.mkdirSync(n.join(a,\"tts\")),r.writeFileSync(n.join(a,\"tts\",o),await getTTSAudio(t,e,i)),console.log(\"\u6587\u4EF6\u5939\u521B\u5EFA\u6210\u529F\")),n.join(a,\"tts\",o)},getTTSAudio=async(t,e,a)=>{let i=a.url||\"http://127.0.0.1:8000/generate_voice\",n=a.body,r=a.params_refine_text;n.params_refine_text=r;let o=a.params_infer_code;n.params_infer_code=o,n.text=[t],n.stream=!1;let s=require(\"axios\");return new Promise((t,e)=>{console.log(\"sadfds\"),s.post(i,n,{responseType:\"arraybuffer\"}).then(e=>{var a,i;let n=require(\"adm-zip\");t(new n(e.data).getEntries()[0].getData())}).catch(t=>{console.log(t),e(\"\")})})};global.getAudioPath=getAudioPath;"
}

GPT-Sovits

Features: Realistic AI Voice, requires self-deployment and configuration,only recommemded for professional user

Website: RVC-Boss/GPT-SoVITS: 1 min voice data can also be used to train a good TTS model! (few shot voice cloning) (github.com)

Configuration: GPT-SoVITS/api.py at main · RVC-Boss/GPT-SoVITS (github.com)

{
  "identifier": "gptsovits-voice-plugin",
  "type": "voice",
  "displayName": "GPT-Sovits",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {},
  "voiceList": [
    {
      "name": "xiaoxiao",
      "gender": "Female",
      "locale": "zh-CN",
      "displayName": "Xiaoxiao",
      "plugin": "gptsovits-voice-plugin",
      "config": {
        "url": "http://127.0.0.1:9880",
        "refer_wav_path": "123.wav",
        "prompt_text": "一二三。",
        "prompt_language": "zh",
        "text_language": "zh",
        "cut_punc": ",。",
        "voiceFormat": "wav"
      }
    }
  ],
  "scriptSHA256": "b9a14fbd91991099a03321156d85551d54ef159db1f7def9dd210a37a498f57b",
  "script": "const getAudioPath=async(t,e,a,o)=>{let i=require(\"path\"),n=require(\"fs\"),r=new Date().getTime()+\".\"+o.voiceFormat;return n.existsSync(i.join(a,\"tts\"))?(n.writeFileSync(i.join(a,\"tts\",r),await getTTSAudio(t,e,o)),console.log(\"\u6587\u4EF6\u5939\u5DF2\u5B58\u5728\")):(n.mkdirSync(i.join(a,\"tts\")),n.writeFileSync(i.join(a,\"tts\",r),await getTTSAudio(t,e,o)),console.log(\"\u6587\u4EF6\u5939\u521B\u5EFA\u6210\u529F\")),i.join(a,\"tts\",r)},getTTSAudio=async(t,e,a)=>{let o=a.url||\"http://127.0.0.1:9880\",i=a.text_language||\"zh\",n=a.prompt_language||\"zh\",r=a.refer_wav_path||\"\",g=a.prompt_text||\"zh\",s=a.cut_punc||\"\uFF0C\u3002\",u=require(\"axios\");return new Promise((e,a)=>{u.post(o,{refer_wav_path:r,prompt_text:g,prompt_language:n,text:t,text_language:i,cut_punc:s},{responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(t=>{console.log(t),a(\"\")})})};global.getAudioPath=getAudioPath;"
}

Coqui TTS

Features: Realistic AI Voice, requires self-deployment and configuration,only recommemded for professional user

Website: coqui-ai/TTS: 🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production (github.com)

Configuration: TTS/TTS/server at dev · coqui-ai/TTS (github.com)

{
  "identifier": "coquitts-voice-plugin",
  "type": "voice",
  "displayName": "Coqui TTS",
  "icon": "speaker",
  "version": "1.0.0",
  "config": {},
  "voiceList": [
    {
      "name": "xiaoxiao",
      "gender": "female",
      "locale": "zh-CN",
      "displayName": "Xiaoxiao",
      "plugin": "coquitts-voice-plugin",
      "config": {
        "url": "http://127.0.0.1:5002/api/tts",
        "speaker_id": "",
        "language_id": "",
        "style_wav": ""
      }
    }
  ],
  "scriptSHA256": "564a537e1e2d29c3e07213b6201c668461322173a45a4d9812094f60768da8c2",
  "script": "const getAudioPath=async(t,e,i,n)=>{let a=require(\"path\"),o=require(\"fs\"),r=new Date().getTime()+\".wav\";return o.existsSync(a.join(i,\"tts\"))||o.mkdirSync(a.join(i,\"tts\")),o.writeFileSync(a.join(i,\"tts\",r),await getTTSAudio(t,e,n)),a.join(i,\"tts\",r)},objectToQueryString=t=>{let e=[];for(let i in t)if(t.hasOwnProperty(i)){let n=t[i],a=encodeURIComponent(i),o=encodeURIComponent(n);e.push(`${a}=${o}`)}return e.join(\"&\")},getTTSAudio=async(t,e,i)=>{let n=i.url||\"http://127.0.0.1:5002/api/tts\",a=i.speaker_id||\"\",o=i.language_id||\"\",r=i.style_wav||\"\",s=require(\"axios\");return new Promise((e,i)=>{s.get(n+\"?\"+objectToQueryString({text:t,speaker_id:a,language_id:o,style_wav:r}),{responseType:\"arraybuffer\"}).then(t=>{console.log(t),e(t.data)}).catch(t=>{console.log(t),i(\"\")})})};global.getAudioPath=getAudioPath;"
}

On this page