Expand description
Low-level C bindings to the Pico TTS engine.
See ttspico
for a high-level Rust wrapper.
Structs§
Constants§
- PICO_
DATA_ PCM_ 16BIT - PICO_
ERR_ INDEX_ OUT_ OF_ RANGE - PICO_
ERR_ INVALID_ ARGUMENT - PICO_
ERR_ INVALID_ HANDLE - PICO_
ERR_ NULLPTR_ ACCESS - PICO_
ERR_ OTHER - PICO_
EXC_ BUF_ IGNORE - PICO_
EXC_ BUF_ OVERFLOW - PICO_
EXC_ BUF_ UNDERFLOW - PICO_
EXC_ CANT_ OPEN_ FILE - PICO_
EXC_ FILE_ CORRUPT - PICO_
EXC_ FILE_ NOT_ FOUND - PICO_
EXC_ KB_ MISSING - PICO_
EXC_ MAX_ NUM_ EXCEED - PICO_
EXC_ NAME_ CONFLICT - PICO_
EXC_ NAME_ ILLEGAL - PICO_
EXC_ NAME_ UNDEFINED - PICO_
EXC_ NUMBER_ FORMAT - PICO_
EXC_ OUT_ OF_ MEM - PICO_
EXC_ RESOURCE_ BUSY - PICO_
EXC_ RESOURCE_ MISSING - PICO_
EXC_ UNEXPECTED_ FILE_ TYPE - PICO_
INT16_ MAX - PICO_
INT32_ MAX - PICO_
MAX_ DATAPATH_ NAME_ SIZE - PICO_
MAX_ FILE_ NAME_ SIZE - PICO_
MAX_ FOREIGN_ HEADER_ LEN - PICO_
MAX_ NUM_ RESOURCES - PICO_
MAX_ NUM_ RSRC_ PER_ VOICE - PICO_
MAX_ NUM_ VOICE_ DEFINITIONS - PICO_
MAX_ RESOURCE_ NAME_ SIZE - PICO_
MAX_ VOICE_ NAME_ SIZE - PICO_OK
- PICO_
RESET_ FULL - PICO_
RESET_ SOFT - PICO_
RETSTRINGSIZE - PICO_
STEP_ BUSY - PICO_
STEP_ ERROR - PICO_
STEP_ IDLE - PICO_
UINT16_ MAX - PICO_
UINT32_ MAX - PICO_
WARN_ CLASSIFICATION - PICO_
WARN_ FALLBACK - PICO_
WARN_ INCOMPLETE - PICO_
WARN_ INVECTOR - PICO_
WARN_ KB_ OVERWRITE - PICO_
WARN_ OTHER - PICO_
WARN_ OUTVECTOR - PICO_
WARN_ PU_ DISCARD_ BUF - PICO_
WARN_ PU_ IRREG_ ITEM - PICO_
WARN_ RESOURCE_ DOUBLE_ LOAD
Functions§
- pico_
addResource ⚠ToVoice Definition - Adds a mapping pair (‘voiceName’, ‘resourceName’) to the voice definition. Multiple mapping pairs can added to a voice defintion. When calling ‘pico_newEngine’ with ‘voiceName’, the corresponding resources from the mappings will be used with that engine.
- pico_
create ⚠Voice Definition - Creates a voice definition. Resources must be added to the created voice with ‘pico_addResourceToVoiceDefinition’ before using the voice in ‘pico_newEngine’. It is an error to create a voice definition with a previously defined voice name. In that case use ‘pico_releaseVoiceName’ first.
- pico_
dispose ⚠Engine - Disposes a Pico engine and releases all memory it occupied. The engine handle becomes invalid.
- pico_
getData ⚠ - Gets speech data from the engine. Every time this function is called, the engine performs, within a short time slot, a small amount of processing its input text, and then gives control back to the calling application. Ie. after calling ‘pico_putTextUtf8’ (incl. a final embedded ‘\0’), this function needs to be called repeatedly till ‘outBytesReceived’ bytes are returned in ‘outBuffer’. The type of data returned in ‘outBuffer’ (e.g. 8 or 16 bit PCM samples) is returned in ‘outDataType’ and depends on the lingware resources. Possible ‘outDataType’ values are listed in picodefs.h (PICO_DATA_*). This function returns PICO_STEP_BUSY while processing input and producing speech output. Once all data is returned and there is no more input text available in the Pico text input buffer, PICO_STEP_IDLE is returned. All other function return values indicate a system error.
- pico_
getEngine ⚠Status Message - Returns in ‘outMessage’ a description of the engine status or of an error that occurred with the most recently called engine-level API function.
- pico_
getEngine ⚠Warning - Returns in ‘outMessage’ a description of a warning that occurred with the most recently called engine-level API function. ‘warningIndex’ must be in the range 0..N-1 where N is the number of warnings returned by ‘pico_getNrEngineWarnings’. ‘outCode’ returns the warning as an integer code (cf. PICO_WARN_*).
- pico_
getNr ⚠Engine Warnings - Returns in ‘outNrOfWarnings’ the number of warnings that occurred with the most recently called engine-level API function.
- pico_
getNr ⚠System Warnings - Returns in ‘outNrOfWarnings’ the number of warnings that occurred with the most recently called system-level API function.
- pico_
getResource ⚠Name - Gets the unique resource name of a loaded resource
- pico_
getSystem ⚠Status Message - Returns in ‘outMessage’ a description of the system status or of an error that occurred with the most recently called system-level API function.
- pico_
getSystem ⚠Warning - Returns in ‘outMessage’ a description of a warning that occurred with the most recently called system-level API function. ‘warningIndex’ must be in the range 0..N-1 where N is the number of warnings returned by ‘pico_getNrSystemWarnings’. ‘outCode’ returns the warning as an integer code (cf. PICO_WARN_*).
- pico_
initialize ⚠ - Initializes the Pico system and returns its handle in ‘outSystem’. ‘memory’ and ‘size’ define the location and maximum size of memory in number of bytes that the Pico system will use. The minimum size required depends on the number of engines and configurations of lingware to be used. No additional memory will be allocated by the Pico system. This function must be called before any other API function is called. It may only be called once (e.g. at application startup), unless a call to ‘pico_terminate’.
- pico_
load ⚠Resource - Loads a resource file into the Pico system. The number of resource files loaded in parallel is limited by PICO_MAX_NUM_RESOURCES. Loading of a resource file may be done at any time (even in parallel to a running engine doing TTS synthesis), but with the general restriction that functions taking a system handle as their first argument must be called in a mutually exclusive fashion. The loaded resource will be available only to engines started after the resource is fully loaded, i.e., not to engines currently running.
- pico_
newEngine ⚠ - Creates and initializes a new Pico engine instance and returns its handle in ‘outEngine’. Only one instance per system is currently possible.
- pico_
putText ⚠Utf8 - Puts text ‘text’ encoded in UTF8 into the Pico text input buffer. ‘textSize’ is the maximum size in number of bytes accessible in ‘text’. The input text may also contain text-input commands to change, for example, speed or pitch of the resulting speech output. The number of bytes actually copied to the Pico text input buffer is returned in ‘outBytesPut’. Sentence ends are automatically detected. ‘\0’ characters may be embedded in ‘text’ to finish text input or separate independently to be synthesized text parts from each other. Repeatedly calling ‘pico_getData’ will result in the content of the text input buffer to be synthesized (up to the last sentence end or ‘\0’ character detected). To empty the internal buffers without finishing synthesis, use the function ‘pico_resetEngine’.
- pico_
release ⚠Voice Definition - Releases the voice definition ‘voiceName’.
- pico_
reset ⚠Engine - Resets the engine and clears all engine-internal buffers, in particular text input and signal data output buffers. ‘resetMode’ is one of ‘PICO_RESET_SOFT’, to be used to flush the engine, or ‘PICO_RESET_FULL’, to reset the engine after an engine error.
- pico_
terminate ⚠ - Terminates the Pico system. Lingware resources still being loaded are unloaded automatically. The memory area provided to Pico in ‘pico_initialize’ is released. The system handle becomes invalid. It is not allowed to call this function as long as Pico engine instances are existing. No API function may be called after this function, except for ‘pico_initialize’, which reinitializes the system.
- pico_
unload ⚠Resource - Unloads a resource file from the Pico system. If no engine uses the resource file, the resource is removed immediately and its associated internal memory is released, otherwise PICO_EXC_RESOURCE_BUSY is returned.