[][src]Crate ttspico_sys

Low-level C bindings to the Pico TTS engine.
See ttspico for a high-level Rust wrapper.

Structs

pico_engine
pico_resource
pico_system

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_addResourceToVoiceDefinition

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_createVoiceDefinition

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_disposeEngine

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_getEngineStatusMessage

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_getEngineWarning

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_getNrEngineWarnings

Returns in 'outNrOfWarnings' the number of warnings that occurred with the most recently called engine-level API function.

pico_getNrSystemWarnings

Returns in 'outNrOfWarnings' the number of warnings that occurred with the most recently called system-level API function.

pico_getResourceName

Gets the unique resource name of a loaded resource

pico_getSystemStatusMessage

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_getSystemWarning

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_loadResource

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_putTextUtf8

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_releaseVoiceDefinition

Releases the voice definition 'voiceName'.

pico_resetEngine

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_unloadResource

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.

Type Definitions

pico_Char
pico_Engine
pico_Int16
pico_Int32
pico_Resource
pico_Retstring
pico_Status
pico_System
pico_Uint16
pico_Uint32