"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "speech_class/EST_wave_io.cc" between
speech_tools-2.4-release.tar.gz and speech_tools-2.5.0-release.tar.gz

About: The speech_tools - Edinburgh Speech Tools Library (used by the Festival Speech Synthesis System).

EST_wave_io.cc  (speech_tools-2.4-release):EST_wave_io.cc  (speech_tools-2.5.0-release)
skipping to change at line 200 skipping to change at line 200
{ {
byte_order = wstrdup((EST_BIG_ENDIAN ? "10" : "01")); byte_order = wstrdup((EST_BIG_ENDIAN ? "10" : "01"));
sample_coding = wstrdup("ULAW"); sample_coding = wstrdup("ULAW");
} }
/* code for reading in Tony Robinson's shorten files. /* code for reading in Tony Robinson's shorten files.
This is a temporary fix which calls the unshorten program on the This is a temporary fix which calls the unshorten program on the
speech file and reads in the answer by calling this function. speech file and reads in the answer by calling this function.
It would be nice to have a simple library routine which did the It would be nice to have a simple library routine which did the
unshortening. unshortening.
removed Jun 14th 2016 by awb , security risk, and only works in CSTR
*/ */
if (streq(sample_coding,"pcm,embedded-shorten-v1.1")) if (streq(sample_coding,"pcm,embedded-shorten-v1.1"))
{ {
#if 0
char *tmpfile, *cmdstr; char *tmpfile, *cmdstr;
enum EST_read_status rval; enum EST_read_status rval;
#endif
fprintf(stderr,"WAVE read: nist type is shorten\n");
fprintf(stderr,"WAVE read: no support for shorten -- you need to use some
external program to unshorten the data\n");
return misc_read_error;
#if 0
tmpfile = cmake_tmp_filename(); tmpfile = cmake_tmp_filename();
cmdstr = walloc(char,strlen(tmpfile)+200); cmdstr = walloc(char,strlen(tmpfile)+200);
/* This doesn't work, unless you have cstrshorten, and */
/* doesn't work if your file name is interesting */
sprintf(cmdstr,"cstrshorten %s %s", sprintf(cmdstr,"cstrshorten %s %s",
(const char*)ts.filename(),tmpfile); (const char*)ts.filename(),tmpfile);
printf("Command: %s\n", cmdstr); printf("Command: %s\n", cmdstr);
system(cmdstr); system(cmdstr);
EST_TokenStream tt; EST_TokenStream tt;
tt.open(tmpfile); tt.open(tmpfile);
rval = load_wave_nist(tt, data, num_samples, rval = load_wave_nist(tt, data, num_samples,
num_channels, word_size, sample_rate, num_channels, word_size, sample_rate,
sample_type, bo, offset, length); sample_type, bo, offset, length);
unlink(tmpfile); unlink(tmpfile);
wfree(tmpfile); wfree(tmpfile);
wfree(cmdstr); wfree(cmdstr);
tt.close(); tt.close();
return rval; return rval;
#endif
} }
if (length == 0) if (length == 0)
data_length = (samps - offset)*(*num_channels); data_length = (samps - offset)*(*num_channels);
else else
data_length = length*(*num_channels); data_length = length*(*num_channels);
file_data = walloc(unsigned char,sample_width * data_length); file_data = walloc(unsigned char,sample_width * data_length);
ts.seek(current_pos+NIST_HDR_SIZE+(sample_width*offset*(*num_channels))); ts.seek(current_pos+NIST_HDR_SIZE+(sample_width*offset*(*num_channels)));
 End of changes. 6 change blocks. 
0 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)