navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
speak.c File Reference
#include "config.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <glib.h>
#include "item.h"
#include "plugin.h"
#include "speech.h"
#include "util.h"
#include "file.h"
#include "debug.h"
#include "support/espeak/speech.h"
#include "support/espeak/speak_lib.h"
#include "support/espeak/phoneme.h"
#include "support/espeak/synthesize.h"
#include "support/espeak/voice.h"
#include "support/espeak/translate.h"

Data Structures

struct  speech_priv
 

Macros

#define _WIN32_WINNT   0x0500
 
#define BUFFERS   4
 

Enumerations

enum  speech_messages { msg_say = WM_USER, msg_exit }
 
enum  speech_state { state_available, state_speaking_phase_1, state_speaking_phase_2, state_speaking_phase_3 }
 

Functions

int GetFileLength (const char *filename)
 
void MarkerEvent (int type, unsigned int char_position, int value, unsigned char *out_ptr)
 
char * Alloc (int size)
 
void Free (void *ptr)
 
static void waveout_close (struct speech_priv *sp_priv)
 
static BOOL waveout_open (struct speech_priv *sp_priv)
 
static int wave_out (struct speech_priv *sp_priv)
 
static BOOL initialise (void)
 
static void fill_buffer (struct speech_priv *this)
 
static void start_speaking (struct speech_priv *sp_priv)
 
static LRESULT CALLBACK speech_message_handler (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void speech_message_dispatcher (struct speech_priv *sp_priv)
 
static void create_buffers (struct speech_priv *sp_priv)
 
static DWORD startThread (LPVOID sp_priv)
 
static int espeak_say (struct speech_priv *this, const char *text)
 
static void free_list (gpointer pointer, gpointer this)
 
static void espeak_destroy (struct speech_priv *this)
 
static struct speech_privespeak_new (struct speech_methods *meth, struct attr **attrs, struct attr *parent)
 
void plugin_init (void)
 The plugin entry point. More...
 

Variables

char path_home [N_PATH_HOME]
 
int(* uri_callback )(int, const char *, const char *) = NULL
 
int(* phoneme_callback )(const char *) = NULL
 
FILE * f_wave = NULL
 
static struct speech_methods espeak_meth
 

Macro Definition Documentation

#define _WIN32_WINNT   0x0500

Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

#define BUFFERS   4

Enumeration Type Documentation

Enumerator
msg_say 
msg_exit 
Enumerator
state_available 
state_speaking_phase_1 
state_speaking_phase_2 
state_speaking_phase_3 

Function Documentation

char* Alloc ( int  size)
static void create_buffers ( struct speech_priv sp_priv)
static
static void espeak_destroy ( struct speech_priv this)
static
static struct speech_priv* espeak_new ( struct speech_methods meth,
struct attr **  attrs,
struct attr parent 
)
static
static int espeak_say ( struct speech_priv this,
const char *  text 
)
static
static void fill_buffer ( struct speech_priv this)
static
void Free ( void *  ptr)
static void free_list ( gpointer  pointer,
gpointer  this 
)
static

References speech_priv::h_wave_out.

Referenced by espeak_destroy().

int GetFileLength ( const char *  filename)
static BOOL initialise ( void  )
static

References dbg, FALSE, lvl_error, path_home, and TRUE.

Referenced by espeak_new().

void MarkerEvent ( int  type,
unsigned int  char_position,
int  value,
unsigned char *  out_ptr 
)
void plugin_init ( void  )

The plugin entry point.

Returns
nothing

The plugin entry point

References espeak_new().

static void speech_message_dispatcher ( struct speech_priv sp_priv)
static

References BOOL(), dbg, and lvl_error.

Referenced by startThread().

static LRESULT CALLBACK speech_message_handler ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static
static void start_speaking ( struct speech_priv sp_priv)
static
static int wave_out ( struct speech_priv sp_priv)
static
static void waveout_close ( struct speech_priv sp_priv)
static

References speech_priv::h_wave_out.

Referenced by espeak_destroy().

static BOOL waveout_open ( struct speech_priv sp_priv)
static

References speech_priv::h_queue.

Referenced by startThread().

Variable Documentation

struct speech_methods espeak_meth
static
Initial value:
= {
}
static void espeak_destroy(struct speech_priv *this)
Definition: speak.c:414
static int espeak_say(struct speech_priv *this, const char *text)
Definition: speak.c:387

Referenced by espeak_new().

FILE* f_wave = NULL
char path_home[N_PATH_HOME]

Referenced by espeak_new(), and initialise().

int(* phoneme_callback)(const char *) = NULL
int(* uri_callback)(int, const char *, const char *) = NULL