mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-07 23:31:26 +00:00
Fixes to Sound Icons (play WAV files for punctuation).
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@107 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+10
-6
@@ -529,18 +529,22 @@ static int LoadSoundFile(const char *fname, int index)
|
||||
fname = fname2;
|
||||
}
|
||||
sprintf(fname_temp,"%s.wav",tmpnam(NULL));
|
||||
sprintf(command,"sox \"%s\" -r %d -w %s polyphase\n",fname,samplerate,fname_temp);
|
||||
if(system(command) < 0)
|
||||
sprintf(command,"soxx \"%s\" -r %d -w %s polyphase\n",fname,samplerate,fname_temp);
|
||||
if(system(command) != 0)
|
||||
{
|
||||
// resample has failed, use the original file
|
||||
fprintf(stderr,"Failed to resample: %s\n",command);
|
||||
return(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
fname = fname_temp;
|
||||
}
|
||||
|
||||
length = GetFileLength(fname_temp);
|
||||
f = fopen(fname_temp,"rb");
|
||||
length = GetFileLength(fname);
|
||||
f = fopen(fname,"rb");
|
||||
if(f == NULL)
|
||||
{
|
||||
fprintf(stderr,"Can't read temp file: %s",fname_temp);
|
||||
fprintf(stderr,"Can't read temp file: %s",fname);
|
||||
return(3);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.29.20 13.Nov.07";
|
||||
const char *version_string = "1.29.21 21.Nov.07";
|
||||
const int version_phdata = 0x012901;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
+1
-1
@@ -1040,7 +1040,7 @@ static void DoEmbedded(int &embix, int sourceix)
|
||||
wcmdq[wcmdq_tail][0] = WCMD_WAVE;
|
||||
wcmdq[wcmdq_tail][1] = soundicon_tab[value].length;
|
||||
wcmdq[wcmdq_tail][2] = (long)soundicon_tab[value].data;
|
||||
wcmdq[wcmdq_tail][3] = 0; // 16 bit data
|
||||
wcmdq[wcmdq_tail][3] = 0x1f00; // 16 bit data, amp=32
|
||||
WcmdqInc();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user