mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
[1.33] continued
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@159 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+14
-4
@@ -34,6 +34,10 @@
|
||||
#include "voice.h"
|
||||
#include "translate.h"
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#define N_XML_BUF 256
|
||||
|
||||
@@ -642,6 +646,7 @@ static int LoadSoundFile(const char *fname, int index)
|
||||
if((f = fopen(fname,"rb")) != NULL)
|
||||
{
|
||||
int ix;
|
||||
int fd_temp;
|
||||
const char *resample;
|
||||
int header[3];
|
||||
|
||||
@@ -660,11 +665,16 @@ static int LoadSoundFile(const char *fname, int index)
|
||||
else
|
||||
resample = "polyphase";
|
||||
|
||||
sprintf(fname_temp,"%s.wav",tmpnam(NULL));
|
||||
sprintf(command,"sox \"%s\" -r %d -w -s -c1 %s %s\n", fname, samplerate, fname_temp, resample);
|
||||
if(system(command) == 0)
|
||||
strcpy(fname_temp,"/tmp/espeakXXXXXX");
|
||||
if((fd_temp = mkstemp(fname_temp)) >= 0)
|
||||
{
|
||||
fname = fname_temp;
|
||||
close(fd_temp);
|
||||
// sprintf(fname_temp,"%s.wav",tmpnam(NULL));
|
||||
sprintf(command,"sox \"%s\" -r %d -w -s -c1 %s %s\n", fname, samplerate, fname_temp, resample);
|
||||
if(system(command) == 0)
|
||||
{
|
||||
fname = fname_temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user