mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 06:01:53 +00:00
[1.46.22]
lang=bs,hr,sr: fix for million numbers lang=fa, treat ZLNJ character as hyphen Dictionary changes to lang=pt git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@287 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+22
-4
@@ -34,9 +34,10 @@
|
||||
#include "phoneme.h"
|
||||
#include "synthesize.h"
|
||||
#include "voice.h"
|
||||
#include "sonic.h"
|
||||
|
||||
//#undef INCLUDE_KLATT
|
||||
#ifdef INCLUDE_SONIC
|
||||
#include "sonic.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_PORTAUDIO
|
||||
#include "portaudio.h"
|
||||
@@ -150,8 +151,10 @@ static PortAudioStream *pa_stream=NULL;
|
||||
static PaStream *pa_stream=NULL;
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_SONIC
|
||||
static sonicStream sonicSpeedupStream = NULL;
|
||||
double sonicSpeed = 1.0;
|
||||
#endif
|
||||
|
||||
// 1st index=roughness
|
||||
// 2nd index=modulation_type
|
||||
@@ -295,11 +298,15 @@ void WcmdqStop()
|
||||
{//=============
|
||||
wcmdq_head = 0;
|
||||
wcmdq_tail = 0;
|
||||
|
||||
#ifdef INCLUDE_SONIC
|
||||
if(sonicSpeedupStream != NULL)
|
||||
{
|
||||
sonicDestroyStream(sonicSpeedupStream);
|
||||
sonicSpeedupStream = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_PORTAUDIO
|
||||
Pa_AbortStream(pa_stream);
|
||||
#endif
|
||||
@@ -1912,14 +1919,18 @@ int WavegenFill2(int fill_zeros)
|
||||
}
|
||||
wdata.n_mix_wavefile = 0;
|
||||
wdata.amplitude_fmt = 100;
|
||||
#ifdef INCLUDE_KLATT
|
||||
KlattReset(1);
|
||||
#endif
|
||||
result = PlaySilence(length,resume);
|
||||
break;
|
||||
|
||||
case WCMD_WAVE:
|
||||
echo_complete = echo_length;
|
||||
wdata.n_mix_wavefile = 0;
|
||||
#ifdef INCLUDE_KLATT
|
||||
KlattReset(1);
|
||||
#endif
|
||||
result = PlayWave(length,resume,(unsigned char*)q[2], q[3] & 0xff, q[3] >> 8);
|
||||
break;
|
||||
|
||||
@@ -1989,9 +2000,11 @@ int WavegenFill2(int fill_zeros)
|
||||
wdata.amplitude_fmt = 100; // percentage, but value=0 means 100%
|
||||
break;
|
||||
|
||||
#ifdef INCLUDE_SONIC
|
||||
case WCMD_SONIC_SPEED:
|
||||
sonicSpeed = (double)q[1] / 1024;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(result==0)
|
||||
@@ -2009,6 +2022,7 @@ int WavegenFill2(int fill_zeros)
|
||||
} // end of WavegenFill2
|
||||
|
||||
|
||||
#ifdef INCLUDE_SONIC
|
||||
/* Speed up the audio samples with libsonic. */
|
||||
static int SpeedUp(short *outbuf, int length_in, int length_out, int end_of_text)
|
||||
{//==============================================================================
|
||||
@@ -2035,6 +2049,7 @@ static int SpeedUp(short *outbuf, int length_in, int length_out, int end_of_text
|
||||
}
|
||||
return sonicReadShortFromStream(sonicSpeedupStream, outbuf, length_out);
|
||||
} // end of SpeedUp
|
||||
#endif
|
||||
|
||||
|
||||
/* Call WavegenFill2, and then speed up the output samples. */
|
||||
@@ -2042,16 +2057,18 @@ int WavegenFill(int fill_zeros)
|
||||
{//============================
|
||||
int finished;
|
||||
unsigned char *p_start;
|
||||
int length;
|
||||
int max_length;
|
||||
|
||||
p_start = out_ptr;
|
||||
|
||||
// fill_zeros is ignored. It is now done in the portaudio callback
|
||||
finished = WavegenFill2(0);
|
||||
|
||||
#ifdef INCLUDE_SONIC
|
||||
if(sonicSpeed > 1.0)
|
||||
{
|
||||
int length;
|
||||
int max_length;
|
||||
|
||||
max_length = (out_end - p_start);
|
||||
length = 2*SpeedUp((short *)p_start, (out_ptr-p_start)/2, max_length/2, finished);
|
||||
out_ptr = p_start + length;
|
||||
@@ -2059,6 +2076,7 @@ int WavegenFill(int fill_zeros)
|
||||
if(length >= max_length)
|
||||
finished = 0; // there may be more data to flush
|
||||
}
|
||||
#endif
|
||||
return finished;
|
||||
} // end of WavegenFill
|
||||
|
||||
|
||||
Reference in New Issue
Block a user