0.0.1 • Published 7 months ago

@xeyqe/capacitor-tts v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

capacitor-tts

Capacitor tts plugin for Android.

Install

npm install capacitor-tts
npx cap sync

API

speak(...)

speak(options: TTSOptions) => Promise<void>
ParamType
optionsTTSOptions

stop()

stop() => Promise<void>

getSupportedLanguages()

getSupportedLanguages() => Promise<{ languages: string[]; }>

Returns: Promise<{ languages: string[]; }>


getSupportedVoices()

getSupportedVoices() => Promise<{ voices: SpeechSynthesisVoice[]; }>

Returns: Promise<{ voices: SpeechSynthesisVoice[]; }>


getSupportedEngines()

getSupportedEngines() => Promise<{ engines: SpeechSynthesisEngine[]; }>

Returns: Promise<{ engines: SpeechSynthesisEngine[]; }>


switchEngine(...)

switchEngine(engineName: { engineName: string; }) => Promise<void>
ParamType
engineName{ engineName: string; }

getMaxSpeechInputLength()

getMaxSpeechInputLength() => Promise<{ maxSpeechInputLength: number; }>

Returns: Promise<{ maxSpeechInputLength: number; }>


getDefaults()

getDefaults() => Promise<{ audioStreamType: 'DEFAULT_STREAM_TYPE'; engine: string; language: string; pan: number; pitch: number; rate: number; voiceURI: string; volume: number; }>

Returns: Promise<{ audioStreamType: 'DEFAULT_STREAM_TYPE'; engine: string; language: string; pan: number; pitch: number; rate: number; voiceURI: string; volume: number; }>


openInstall()

openInstall() => Promise<void>

addListener('progressEvent', ...)

addListener(eventName: 'progressEvent', listenerFunc: (obj: { utteranceId: string; start: number; end: number; frame: number; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventName'progressEvent'
listenerFunc(obj: { utteranceId: string; start: number; end: number; frame: number; }) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


Interfaces

TTSOptions

PropTypeDescriptionDefault
textstringThe text that will be synthesised when the utterance is spoken.
ratenumberThe speed at which the utterance will be spoken at.1.0
pitchnumberThe pitch at which the utterance will be spoken at.1.0
volumenumberThe volume that the utterance will be spoken at.1.0
pannumberParameter key to specify how the speech is panned from left to right when speaking text. Pan is specified as a float ranging from -1 to +1 where -1 maps to a hard-left pan, 0 to center (the default behavior), and +1 to hard-right.0.0
voiceURInumberThe index of the selected voice that will be used to speak the utterance. Possible voices can be queried using getSupportedVoices.
streamType'STREAM_ALARM' | 'STREAM_DTMF' | 'STREAM_MUSIC' | 'STREAM_NOTIFICATION' | 'STREAM_RING' | 'STREAM_SYSTEM' | 'STREAM_VOICE_CALL'Parameter key to specify the audio stream type to be used when speaking text or playing back a file. The value should be one of the STREAM_ constants defined in AudioManager.

SpeechSynthesisVoice

PropTypeDescription
defaultbooleanSpecifies whether the voice is the default voice for the current app (true) or not (false).
langstringBCP 47 language tag indicating the language of the voice.
localServicebooleanSpecifies whether the voice is supplied by a local (true) or remote (false) speech synthesizer service.
namestringHuman-readable name that represents the voice.
voiceURIstringType of URI and location of the speech synthesis service for this voice.

SpeechSynthesisEngine

PropType
iconnumber
labelstring
namestring

PluginListenerHandle

PropType
remove() => Promise<void>
acornacorn-jsxajvansi-colorsansi-regexansi-stylesargparsearray-buffer-byte-lengtharray-includesarray-unionarray.prototype.findlastindexarray.prototype.flatarray.prototype.flatmaparraybuffer.prototype.sliceastral-regexat-least-nodeavailable-typed-arraysbalanced-matchbrace-expansionbracescall-bindcallsiteschalkchevrotaincolor-convertcolor-namecoloretteconcat-mapcosmiconfigcross-spawndebugdeep-isdefine-data-propertydefine-propertiesdir-globdoctrineemoji-regexenquirererror-exes-abstractes-set-tostringtages-shim-unscopableses-to-primitiveescape-string-regexpeslint-config-prettiereslint-import-resolver-nodeeslint-module-utilseslint-plugin-importeslint-scopeeslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsfast-deep-equalfast-globfast-json-stable-stringifyfast-levenshteinfastqfile-entry-cachefill-rangeflat-cacheflattedfor-eachfs-extrafs.realpathfunction-bindfunction.prototype.namefunctional-red-black-treefunctions-have-namesget-intrinsicget-stdinget-symbol-descriptiongithub-sluggerglobglob-parentglobalsglobalthisglobbygopdgraceful-fshashas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtagignoreimport-freshimurmurhashinflightinheritsinternal-slotis-array-bufferis-arrayishis-bigintis-boolean-objectis-callableis-core-moduleis-date-objectis-extglobis-fullwidth-code-pointis-globis-negative-zerois-numberis-number-objectis-regexis-shared-array-bufferis-stringis-symbolis-typed-arrayis-weakrefisarrayisexejava-parserjs-tokensjs-yamljson-bufferjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson5jsonfilekeyvlevnlines-and-columnslodashlodash.mergelodash.truncatelru-cachemerge2micromatchminimatchminimistmsnatural-compareobject-inspectobject-keysobject.assignobject.fromentriesobject.groupbyobject.valuesonceoptionatorparent-moduleparse-jsonpath-is-absolutepath-keypath-parsepath-typepicomatchprelude-lsprogresspunycodequeue-microtaskregexp-to-astregexp.prototype.flagsregexpprequire-from-stringresolveresolve-fromreusifyrun-parallelsafe-array-concatsafe-regex-testsemverset-function-nameshebang-commandshebang-regexside-channelsignal-exitslashslice-ansisprintf-jsstring-widthstring.prototype.trimstring.prototype.trimendstring.prototype.trimstartstrip-ansistrip-bomstrip-json-commentssupports-colorsupports-preserve-symlinks-flagtabletext-tableto-regex-rangetree-killtsconfig-pathstslibtsutilstype-checktype-festtyped-array-buffertyped-array-byte-lengthtyped-array-byte-offsettyped-array-lengthunbox-primitiveuniversalifyuntildifyuri-jsv8-compile-cachewhichwhich-boxed-primitivewhich-typed-arraywrap-ansiwrappyyallistyaml
0.0.1

7 months ago