Gdspeak

Gdspeak

Synopsis

#define             GDSPEAK_TYPE
#define             GDSPEAK                             (obj)
#define             GDSPEAK_CLASS                       (klass)
#define             IS_GDSPEAK                          (obj)
#define             IS_GDSPEAK_CLASS                    (klass)
#define             GDSPEAK_GET_CLASS                   (obj)
                    Gdspeak;
                    GdspeakClass;
GType               gdspeak_get_type                    (void);
Gdspeak *           gdspeak_new                         (void);
guint32             gdspeak_speak_full                  (Gdspeak *gs,
                                                         const gchar *txt,
                                                         const gchar *lang,
                                                         guint priority,
                                                         gint pitch,
                                                         gint range,
                                                         gint rate,
                                                         gint volume);
guint32             gdspeak_speak_priority              (Gdspeak *gds,
                                                         guint priority,
                                                         const gchar *txt);
gboolean            gdspeak_speak                       (Gdspeak *gds,
                                                         const gchar *txt);
gboolean            gdspeak_stop                        (Gdspeak *gds,
                                                         gboolean clear);
void                gdspeak_clear                       (Gdspeak *gs);
gboolean            gdspeak_speaking                    (Gdspeak *gds);
gboolean            gdspeak_set_voice                   (Gdspeak *gs,
                                                         const gchar *voice);
gboolean            gdspeak_set_default_voice           (Gdspeak *gs,
                                                         const gchar *voice);
GHashTable *        gdspeak_get_voice                   (Gdspeak *gs);
guint               gdspeak_voices                      (Gdspeak *gs);
GHashTable *        gdspeak_list_voices                 (Gdspeak *gs);

Object Hierarchy

  GObject
   +----Gdspeak
         +----Gdbusspeak

Properties

  "et"                       guint                 : Read
  "pitch"                    guint                 : Read / Write
  "range"                    guint                 : Read / Write
  "rate"                     guint                 : Read / Write
  "volume"                   guint                 : Read / Write

Signals

  "mark"                                           : Run First
  "phoneme"                                        : Run First
  "play"                                           : Run First
  "sentence-end"                                   : Run First
  "sentence-start"                                 : Run First
  "speak-end"                                      : Run First
  "speak-start"                                    : Run First
  "word"                                           : Run First

Description

Details

GDSPEAK_TYPE

#define GDSPEAK_TYPE			(gdspeak_get_type())


GDSPEAK()

#define GDSPEAK(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GDSPEAK_TYPE, Gdspeak))

obj :


GDSPEAK_CLASS()

#define GDSPEAK_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), GDSPEAK_TYPE, GdspeakClass))

klass :


IS_GDSPEAK()

#define IS_GDSPEAK(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDSPEAK_TYPE))

obj :


IS_GDSPEAK_CLASS()

#define IS_GDSPEAK_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((klass), GDSPEAK_TYPE))

klass :


GDSPEAK_GET_CLASS()

#define GDSPEAK_GET_CLASS(obj)		(G_TYPE_INSTANCE_GET_CLASS ((obj), GDSPEAK_TYPE, GdspeakClass))

obj :


Gdspeak

typedef struct _Gdspeak Gdspeak;


GdspeakClass

typedef struct {
	GObjectClass parent;
} GdspeakClass;


gdspeak_get_type ()

GType               gdspeak_get_type                    (void);

Returns :


gdspeak_new ()

Gdspeak *           gdspeak_new                         (void);

Create a new gdspeak object.

Returns :


gdspeak_speak_full ()

guint32             gdspeak_speak_full                  (Gdspeak *gs,
                                                         const gchar *txt,
                                                         const gchar *lang,
                                                         guint priority,
                                                         gint pitch,
                                                         gint range,
                                                         gint rate,
                                                         gint volume);

Speak given sentence with the given priority and speech settings.

Set settings to -1 to use current for pitch, range, rate and volume.

The smaller the number the higher priority the sentece has. Priority 0 has the highest priority and will cancel any currently spoken sentece. The default priority is 100, and lowest is 255. Priority 1 will always go at the top of the queue and 255 and then end.

XXX: Implement queue length limiting.

gs :

txt :

lang :

priority :

pitch :

range :

rate :

volume :

Returns :

Sentence id, larger than 0, zero on error.

gdspeak_speak_priority ()

guint32             gdspeak_speak_priority              (Gdspeak *gds,
                                                         guint priority,
                                                         const gchar *txt);

Speak given sentence with the given priority and the current speech settings. The smaller the number the higher priority the sentece has. Priority 0 has the highest priority and will cancel any currently spoken sentece. The default priority is 100, and lowest is 255. Priority 1 will always go at the top of the queue and 255 and then end.

XXX: Implement queue length limiting.

gds :

priority :

txt :

Returns :

Sentence id, larger than 0, zero on error.

gdspeak_speak ()

gboolean            gdspeak_speak                       (Gdspeak *gds,
                                                         const gchar *txt);

Speak the given text, with default priority and the current speech settings. Does not return a sentence tracking id, just TRUE or FALSE.

Mainly for easy speech output when sentence tracking is not required.

gds :

txt :

Returns :

TRUE if sentence was succesfully queued, FALSE otherwise.

gdspeak_stop ()

gboolean            gdspeak_stop                        (Gdspeak *gds,
                                                         gboolean clear);

Stop speech output, with optional queue clear.

gds :

clear :

Returns :

TRUE if speech output was stopped. FALSE otherwise.

gdspeak_clear ()

void                gdspeak_clear                       (Gdspeak *gs);

Empty the sentence queue.

gs :


gdspeak_speaking ()

gboolean            gdspeak_speaking                    (Gdspeak *gds);

Check if we are speaking a sentence.

gds :

Returns :

TRUE if a sentence is being played, FALSE if not.

gdspeak_set_voice ()

gboolean            gdspeak_set_voice                   (Gdspeak *gs,
                                                         const gchar *voice);

Set the voice to use.

gs :

voice :

Returns :

TRUE if voice was set, FALSE on error or if voice was not found.

gdspeak_set_default_voice ()

gboolean            gdspeak_set_default_voice           (Gdspeak *gs,
                                                         const gchar *voice);

Set the default voice to use if nothing else is specified.

gs :

voice :

Returns :

TRUE if voice was available and set, FALSE if voice was not found.

gdspeak_get_voice ()

GHashTable *        gdspeak_get_voice                   (Gdspeak *gs);

Get the current voice.

gs :

Returns :

The current voice id.

gdspeak_voices ()

guint               gdspeak_voices                      (Gdspeak *gs);

gs :

Returns :


gdspeak_list_voices ()

GHashTable *        gdspeak_list_voices                 (Gdspeak *gs);

Get a list of voices available.

gs :

Returns :

Property Details

The "et" property

  "et"                       guint                 : Read

Last event time.

Default value: 0


The "pitch" property

  "pitch"                    guint                 : Read / Write

Speech base pitch, range 0-100. 50=normal.

Allowed values: <= 100

Default value: 50


The "range" property

  "range"                    guint                 : Read / Write

Pitch range, range 0-100. 0-monotone, 50=normal.

Allowed values: <= 100

Default value: 50


The "rate" property

  "rate"                     guint                 : Read / Write

Speech speed, in words per minute.

Allowed values: [80,450]

Default value: 175


The "volume" property

  "volume"                   guint                 : Read / Write

Speech volume.

Allowed values: <= 100

Default value: 50

Signal Details

The "mark" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gchar   *arg2,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "phoneme" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

The "play" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gchar   *arg2,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "sentence-end" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

The "sentence-start" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gint     arg2,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "speak-end" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

The "speak-start" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "word" signal

void                user_function                      (Gdspeak *gdspeak,
                                                        gint     arg1,
                                                        gint     arg2,
                                                        gpointer user_data)      : Run First

gdspeak :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.