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)
struct              Gdspeak;
struct              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);
GHashTable *        gdspeak_list_voices                 (Gdspeak *gs);

Object Hierarchy

  GObject
   +----Gdspeak

Properties

  "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))


GDSPEAK_CLASS()

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


IS_GDSPEAK()

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


IS_GDSPEAK_CLASS()

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


GDSPEAK_GET_CLASS()

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


struct Gdspeak

struct Gdspeak;


struct GdspeakClass

struct GdspeakClass {
	GObjectClass parent;
};


gdspeak_get_type ()

GType               gdspeak_get_type                    (void);


gdspeak_new ()

Gdspeak *           gdspeak_new                         (void);

Create a new gdspeak object.


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.

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.

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.

Returns :

TRUE if sentence was succesfully queued, FALSE otherwise.

gdspeak_stop ()

gboolean            gdspeak_stop                        (Gdspeak *gds,
                                                         gboolean clear);

gdspeak_clear ()

void                gdspeak_clear                       (Gdspeak *gs);

Empty the sentence queue.


gdspeak_speaking ()

gboolean            gdspeak_speaking                    (Gdspeak *gds);

gdspeak_set_voice ()

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

Set the voice to use.

Returns :

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

gdspeak_list_voices ()

GHashTable *        gdspeak_list_voices                 (Gdspeak *gs);

Property Details

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.

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.

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.

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.

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.

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.

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.

user_data :

user data set when the signal handler was connected.