added VOICEVOX TTS (#104)

Add VOICEVOX (https://voicevox.hiroshiba.jp/) to the TTS options. This
will translate the character's text into Japanese and read it in
different voices.
You can run VOICEVOX in Google colab and use it by adding localtunnel
URL.


https://colab.research.google.com/drive/1tyeXJSklNfjW-aZJAib1JfgOMFarAwze

example : 


https://github.com/kwaroran/RisuAI/assets/61553001/5121ce6d-75a1-4ad4-ad27-4e214a2c5b4d
This commit is contained in:
kwaroran
2023-05-25 21:14:57 +09:00
committed by GitHub
8 changed files with 3736 additions and 3 deletions

View File

@@ -58,6 +58,8 @@
<span class="text-neutral-200 mt-2">ElevenLabs API key</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" bind:value={$DataBase.elevenLabKey}>
<span class="text-neutral-200 mt-2">VOICEVOX URL</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" bind:value={$DataBase.voicevoxUrl}>
<span class="text-neutral-200 mt-4 text-lg font-bold">{language.SuperMemory} <Help key="superMemory" /></span>
<span class="text-neutral-200 mt-4">{language.SuperMemory} {language.model}</span>

View File

@@ -15,7 +15,7 @@
import Help from "../Others/Help.svelte";
import RegexData from "./RegexData.svelte";
import { exportChar } from "src/ts/characterCards";
import { getElevenTTSVoices, getWebSpeechTTSVoices } from "src/ts/process/tts";
import { getElevenTTSVoices, getWebSpeechTTSVoices, getVOICEVOXVoices } from "src/ts/process/tts";
import { checkCharOrder } from "src/ts/globalApi";
let subMenu = 0
@@ -460,6 +460,7 @@
<option value="" class="bg-darkbg appearance-none">{language.disabled}</option>
<option value="elevenlab" class="bg-darkbg appearance-none">ElevenLabs</option>
<option value="webspeech" class="bg-darkbg appearance-none">Web Speech</option>
<option value="VOICEVOX" class="bg-darkbg appearance-none">VOICEVOX</option>
</select>
@@ -489,8 +490,28 @@
{/each}
</select>
{/await}
{:else if currentChar.data.ttsMode === 'VOICEVOX'}
<span class="text-neutral-200">Voice</span>
<select class="bg-transparent input-text mt-2 mb-4 text-gray-200 appearance-none text-sm" bind:value={currentChar.data.ttsSpeech}>
{#await getVOICEVOXVoices() then voices}
{#each voices as voice}
<option value={voice.id} class="bg-darkbg appearance-none">{voice.name}</option>
{/each}
{/await}
</select>
<span class="text-neutral-200">Speed scale</span>
<input class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-5 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.voicevoxConfig.SPEED_SCALE}/>
<span class="text-neutral-200">Pitch scale</span>
<input class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-5 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.voicevoxConfig.PITCH_SCALE}/>
<span class="text-neutral-200">Volume scale</span>
<input class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-5 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.voicevoxConfig.VOLUME_SCALE}/>
<span class="text-neutral-200">Intonation scale</span>
<input class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-5 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.voicevoxConfig.INTONATION_SCALE}/>
{/if}
{#if currentChar.data.ttsMode === 'webspeech' || currentChar.data.ttsMode === 'elevenlab'}
{#if currentChar.data.ttsMode === 'webspeech' || currentChar.data.ttsMode === 'elevenlab' || currentChar.data.ttsMode === 'VOICEVOX'}
<div class="flex items-center mt-2">
<Check bind:check={currentChar.data.ttsReadOnlyQuoted}/>
<span>{language.ttsReadOnlyQuoted}</span>