Merge branch 'development' into build

This commit is contained in:
Reece Dunn
2011-11-29 23:33:43 +00:00
70 changed files with 9114 additions and 968 deletions
+20 -9
View File
@@ -313,6 +313,17 @@ static int SynthCallback(short *wav, int numsamples, espeak_EVENT *events)
}
static void PrintVersion()
{//=======================
const char *version;
const char *path_data;
espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 0, NULL, espeakINITIALIZE_DONT_EXIT);
version = espeak_Info(&path_data);
printf("eSpeak text-to-speech: %s Data at: %s\n", version, path_data);
}
#ifdef NEED_GETOPT
struct option {
char *name;
@@ -352,6 +363,7 @@ int main (int argc, char **argv)
{"phonout", required_argument, 0, 0x108},
{"pho", no_argument, 0, 0x109},
{"ipa", no_argument, 0, 0x10a},
{"version", no_argument, 0, 0x10b},
{0, 0, 0, 0}
};
@@ -473,15 +485,10 @@ int main (int argc, char **argv)
break;
case 'h':
{
const char *version;
const char *path_data;
espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 0, data_path, espeakINITIALIZE_DONT_EXIT);
version = espeak_Info(&path_data);
printf("\n");
printf("eSpeak text-to-speech: %s Data at: %s\n%s", version, path_data, help_text);
exit(0);
}
printf("\n");
PrintVersion();
printf("%s", help_text);
exit(0);
break;
case 'k':
@@ -599,6 +606,10 @@ int main (int argc, char **argv)
option_phonemes = 3;
break;
case 0x10b: // -version
PrintVersion();
exit(0);
default:
exit(0);
}
+8 -1
View File
@@ -444,6 +444,8 @@ static void StopSpeak(int unused)
signal(SIGINT,StopSpeak);
} // end of StopSpeak()
#ifdef NEED_GETOPT
struct option {
char *name;
@@ -483,6 +485,7 @@ int main (int argc, char **argv)
{"phonout", required_argument, 0, 0x108},
{"pho", no_argument, 0, 0x109},
{"ipa", no_argument, 0, 0x10a},
{"version", no_argument, 0, 0x10b},
{0, 0, 0, 0}
};
@@ -601,7 +604,6 @@ int main (int argc, char **argv)
init_path(argv[0],data_path);
printf("\nspeak text-to-speech: %s Data at: %s\n%s",version_string,path_home,help_text);
exit(0);
break;
case 'k':
option_capitals = atoi(optarg2);
@@ -722,6 +724,11 @@ int main (int argc, char **argv)
option_phonemes = 3;
break;
case 0x10b: // --version
init_path(argv[0],data_path);
printf("speak text-to-speech: %s Data at: %s\n",version_string,path_home);
exit(0);
default:
exit(0);
}
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.46.01 22.Nov.11";
const char *version_string = "1.46.06 29.Nov.11";
const int version_phdata = 0x014600;
int option_device_number = -1;
+23 -10
View File
@@ -745,19 +745,32 @@ size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSiz
int wave_close(void* theHandler)
{
SHOW_TIME("wave_close > ENTER");
static int aStopStreamCount = 0;
int a_status = pthread_mutex_lock(&pulse_mutex);
if (a_status) {
SHOW("Error: pulse_mutex lock=%d (%s)\n", a_status, __FUNCTION__);
return PULSE_ERROR;
}
drain();
// Avoid race condition by making sure this function only
// gets called once at a time
aStopStreamCount++;
if (aStopStreamCount != 1)
{
SHOW_TIME("wave_close > LEAVE (stopStreamCount)");
return 0;
}
pthread_mutex_unlock(&pulse_mutex);
SHOW_TIME("wave_close (ret)");
int a_status = pthread_mutex_lock(&pulse_mutex);
if (a_status)
{
SHOW("Error: pulse_mutex lock=%d (%s)\n", a_status, __FUNCTION__);
aStopStreamCount = 0; // last action
return PULSE_ERROR;
}
return PULSE_OK;
drain();
pthread_mutex_unlock(&pulse_mutex);
SHOW_TIME("wave_close (ret)");
aStopStreamCount = 0; // last action
return PULSE_OK;
}
//>