navit  0.5.3-trunk
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, int value2, 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

◆ _WIN32_WINNT

#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.

◆ BUFFERS

#define BUFFERS   4

Enumeration Type Documentation

◆ speech_messages

Enumerator
msg_say 
msg_exit 

◆ speech_state

Enumerator
state_available 
state_speaking_phase_1 
state_speaking_phase_2 
state_speaking_phase_3 

Function Documentation

◆ Alloc()

char* Alloc ( int  size)

References size.

◆ create_buffers()

static void create_buffers ( struct speech_priv sp_priv)
static

◆ espeak_destroy()

static void espeak_destroy ( struct speech_priv this)
static

◆ espeak_new()

static struct speech_priv* espeak_new ( struct speech_methods meth,
struct attr **  attrs,
struct attr parent 
)
static

◆ espeak_say()

static int espeak_say ( struct speech_priv this,
const char *  text 
)
static

◆ fill_buffer()

static void fill_buffer ( struct speech_priv this)
static

◆ Free()

void Free ( void *  ptr)

◆ free_list()

static void free_list ( gpointer  pointer,
gpointer  this 
)
static

References speech_priv::h_wave_out.

Referenced by espeak_destroy().

◆ GetFileLength()

int GetFileLength ( const char *  filename)

References filename.

◆ initialise()

static BOOL initialise ( void  )
static

References dbg, lvl_error, and path_home.

Referenced by espeak_new().

◆ MarkerEvent()

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

◆ plugin_init()

void plugin_init ( void  )

The plugin entry point.

Returns
nothing

The plugin entry point

References espeak_new().

◆ speech_message_dispatcher()

static void speech_message_dispatcher ( struct speech_priv sp_priv)
static

References dbg, and lvl_error.

Referenced by startThread().

◆ speech_message_handler()

static LRESULT CALLBACK speech_message_handler ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

◆ start_speaking()

static void start_speaking ( struct speech_priv sp_priv)
static

◆ startThread()

◆ wave_out()

static int wave_out ( struct speech_priv sp_priv)
static

◆ waveout_close()

static void waveout_close ( struct speech_priv sp_priv)
static

References speech_priv::h_wave_out.

Referenced by espeak_destroy().

◆ waveout_open()

static BOOL waveout_open ( struct speech_priv sp_priv)
static

Variable Documentation

◆ espeak_meth

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

Referenced by espeak_new().

◆ f_wave

FILE* f_wave = NULL

◆ path_home

char path_home[N_PATH_HOME]

Referenced by espeak_new(), and initialise().

◆ phoneme_callback

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

◆ uri_callback

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