0033090a93
* Initial idle stuff * Much closer, can now quietly send as user to get a char response. * Tweaks * Better, reset the count of getting a message back, don't send while prompt is waiting. * Allow selecting who is being prompted * Comments and cleaup * Remove char name for the moment (needs something here probably) * Add random time period and "Always add character's name to prompt" respect * Tooltips * Load/unload listeners * Reduce log spam * Add inline prompt inclusion * Add full loud prompting * Comments * Fix instruct newline (I think) * Don't reset count on continue * add quietToLoud for script.js * add quietToLoud for slashcommands.js * Keep instruct directives * Removed some logging, don't do the Novel formatting if Q2L * Logspam begone. * Removed a bit more logging * Add alignment style * Reformat files. Add comments * Reorder extensions * Fix repeat logic to prompt once then only repeat the number specified * Make repeat count more clear --------- Co-authored-by: RossAscends <124905043+RossAscends@users.noreply.github.com> Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com> |
||
---|---|---|
.. | ||
coqui_api_models_settings_full.json | ||
coqui_api_models_settings.json | ||
coqui.js | ||
edge.js | ||
elevenlabs.js | ||
index.js | ||
manifest.json | ||
novel.js | ||
readme.md | ||
silerotts.js | ||
style.css | ||
system.js |
Provider Requirements.
Because I don't know how, or if you can, and/or maybe I am just too lazy to implement interfaces in JS, here's the requirements of a provider that the extension needs to operate.
class YourTtsProvider
Required
Exported for use in extension index.js, and added to providers list in index.js
- generateTts(text, voiceId)
- fetchTtsVoiceObjects()
- onRefreshClick()
- checkReady()
- loadSettings(settingsObject)
- settings field
- settingsHtml field
Optional
- previewTtsVoice()
- separator field
Requirement Descriptions
generateTts(text, voiceId)
Must return audioData.type in ['audio/mpeg', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/webm']
Must take text to be rendered and the voiceId to identify the voice to be used
fetchTtsVoiceObjects()
Required. Used by the TTS extension to get a list of voice objects from the provider. Must return an list of voice objects representing the available voices.
- name: a friendly user facing name to assign to characters. Shows in dropdown list next to user.
- voice_id: the provider specific id of the voice used in fetchTtsGeneration() call
- preview_url: a URL to a local audio file that will be used to sample voices
- lang: OPTIONAL language string
getVoice(voiceName)
Required. Must return a single voice object matching the provided voiceName. The voice object must have the following at least:
- name: a friendly user facing name to assign to characters. Shows in dropdown list next to user.
- voice_id: the provider specific id of the voice used in fetchTtsGeneration() call
- preview_url: a URL to a local audio file that will be used to sample voices
- lang: OPTIONAL language indicator
onRefreshClick()
Required. Users click this button to reconnect/reinit the selected provider. Responds to the user clicking the refresh button, which is intended to re-initialize the Provider into a working state, like retrying connections or checking if everything is loaded.
checkReady()
Required. Return without error to let TTS extension know that the provider is ready. Return an error to block the main TTS extension for initializing the provider and UI. The error will be put in the TTS extension UI directly.
loadSettings(settingsObject)
Required. Handle the input settings from the TTS extension on provider load. Put code in here to load your provider settings.
settings field
Required, used for storing any provider state that needs to be saved.
Anything stored in this field is automatically persisted under extension_settings[providerName] by the main extension in saveTtsProviderSettings()
, as well as loaded when the provider is selected in loadTtsProvider(provider)
.
TTS extension doesn't expect any specific contents.
settingsHtml field
Required, injected into the TTS extension UI. Besides adding it, not relied on by TTS extension directly.
previewTtsVoice()
Optional. Function to handle playing previews of voice samples if no direct preview_url is available in fetchTtsVoiceObjects() response
separator field
Optional.
Used when narrate quoted text is enabled.
Defines the string of characters used to introduce separation between between the groups of extracted quoted text sent to the provider. The provider will use this to introduce pauses by default using ...