mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-06 07:03:12 +00:00
[1.30.10]
Remove pause before <say-as> if it's at the beginning of a sentence. Added --split=<minutes> command-line option. Splits output WAV file (at sentence boundaries). Fix: espeakEVENT_SENTENCE events were missing. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@121 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+24
-2
@@ -36,6 +36,9 @@
|
||||
|
||||
int SpeakNextClause(FILE *f_text, const void *text_in, int control);
|
||||
extern void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2);
|
||||
extern int Wavegen();
|
||||
extern void CloseWaveFile2();
|
||||
extern FILE *f_wave;
|
||||
|
||||
static int frame_width;
|
||||
|
||||
@@ -96,6 +99,25 @@ static void PeaksZero(peak_t *sp, peak_t *zero)
|
||||
} // end of PeaksZero
|
||||
|
||||
|
||||
|
||||
void MakeWaveFile()
|
||||
{//================
|
||||
int result=1;
|
||||
unsigned char wav_outbuf[1024];
|
||||
|
||||
while(result != 0)
|
||||
{
|
||||
out_ptr = out_start = wav_outbuf;
|
||||
out_end = &wav_outbuf[sizeof(wav_outbuf)];
|
||||
result = Wavegen();
|
||||
if(f_wave != NULL)
|
||||
fwrite(wav_outbuf, 1, out_ptr - wav_outbuf, f_wave);
|
||||
}
|
||||
} // end of MakeWaveFile
|
||||
|
||||
|
||||
|
||||
|
||||
SpectSeq::SpectSeq(int n)
|
||||
{//======================
|
||||
numframes = n;
|
||||
@@ -1004,7 +1026,7 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch)
|
||||
SetSynth_mS(30,peaks2,peaks0);
|
||||
MakeWaveFile();
|
||||
|
||||
CloseWaveFile(samplerate);
|
||||
CloseWaveFile2();
|
||||
PlayWavFile(fname_speech);
|
||||
|
||||
} // end of SpectSeq::MakeWave
|
||||
@@ -1085,7 +1107,7 @@ void SpectFrame::MakeWave(int control, PitchEnvelope &pitche, int amplitude, int
|
||||
#endif
|
||||
}
|
||||
|
||||
CloseWaveFile(samplerate);
|
||||
CloseWaveFile2();
|
||||
PlayWavFile(fname_speech);
|
||||
|
||||
} // end of SpectFrame::MakeWaveFrame
|
||||
|
||||
Reference in New Issue
Block a user