navit  0.5.3-trunk
speech.h File Reference

Go to the source code of this file.

Data Structures

struct  speech_methods
 

Functions

struct speechspeech_new (struct attr *parent, struct attr **attrs)
 
int speech_say (struct speech *this_, const char *text)
 
int speech_sayf (struct speech *this_, const char *format,...)
 
void speech_destroy (struct speech *this_)
 
int speech_get_attr (struct speech *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 Gets an attribute from a speech plugin. More...
 
int speech_set_attr (struct speech *this_, struct attr *attr)
 Sets an attribute from an speech plugin. More...
 
int speech_estimate_duration (struct speech *this_, char *str)
 Tries to estimate how long it will take to speak a certain string. More...
 

Function Documentation

◆ speech_destroy()

void speech_destroy ( struct speech this_)

◆ speech_estimate_duration()

int speech_estimate_duration ( struct speech this_,
char *  str 
)

Tries to estimate how long it will take to speak a certain string.

This function tries to estimate how long it will take to speak a certain string passed in str. It relies on the "characters per second"-value passed from the configuration.

Parameters
this_The speech whose speed should be used
strThe string that should be estimated
Returns
Time in tenth of seconds or -1 on error

References attr::num, speech_get_attr(), attr::str, and attr::u.

◆ speech_get_attr()

int speech_get_attr ( struct speech this_,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

Gets an attribute from a speech plugin.

Parameters
this_The speech plugin the attribute should be read from
typeThe type of the attribute to be read
attrPointer to an attrib-structure where the attribute should be written to
iter(NOT IMPLEMENTED) Used to iterate through all attributes of a type. Set this to NULL to get the first attribute, set this to an attr_iter to get the next attribute
Returns
True if the attribute type was found, false if not

References attr_generic_get_attr(), speech_default_attrs, and type.

Referenced by get_distance_str(), navigation_item_destination(), navit_cmd_announcer_toggle(), navit_say(), navit_speak(), osd_nav_toggle_announcer_draw(), and speech_estimate_duration().

◆ speech_new()

◆ speech_say()

int speech_say ( struct speech this_,
const char *  text 
)

◆ speech_sayf()

int speech_sayf ( struct speech this_,
const char *  format,
  ... 
)

Referenced by phrase_route_calculated().

◆ speech_set_attr()

int speech_set_attr ( struct speech this_,
struct attr attr 
)

Sets an attribute from an speech plugin.

This sets an attribute of a speech plugin, overwriting an attribute of the same type if it already exists. This function also calls all the callbacks that are registred to be called when attributes change.

Parameters
this_The speech plugin to set the attribute of
attrThe attribute to set
Returns
True if the attr could be set, false otherwise

Referenced by navit_cmd_announcer_toggle().