From ab9e1d9b4e117f314ad9a4e012fad255934b0b46 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 13 Dec 2015 10:40:51 +0000 Subject: [PATCH] espeakedit: remove the epseakedit praat data import code --- src/spect.cpp | 90 ++------------------------------------------------- src/spect.h | 2 -- 2 files changed, 2 insertions(+), 90 deletions(-) diff --git a/src/spect.cpp b/src/spect.cpp index 18d2584b..ec10d1ad 100644 --- a/src/spect.cpp +++ b/src/spect.cpp @@ -158,65 +158,6 @@ SpectFrame::~SpectFrame() delete spect; } -int SpectFrame::Import(wxInputStream& stream1) -{//========================================== -// Import Pratt analysis data - int ix; - double x; - unsigned short *spect_data; - - wxTextInputStream stream(stream1); - - stream >> time; - stream >> pitch; - stream >> nx; - stream >> dx; - - if(stream1.Eof()) - return(1); - - for(ix=0; ix> x; - formants[ix].freq = (int)x; - - if(x > 0) - peaks[ix].pkfreq = (int)x; - - stream >> x; - formants[ix].bandw = (int)x; - } - - spect_data = new USHORT[nx]; - - if(spect_data == NULL) - { - wxLogError(_T("Failed to allocate memory")); - return(1); - } - - max_y = 0; - for(ix=0; ix> x; - spect_data[ix] = (int)(sqrt(x) * 16386); - if(spect_data[ix] > max_y) - max_y = spect_data[ix]; - } - spect = spect_data; - - return(0); -} // End of SpectFrame::Import - - - int SpectFrame::ImportSPC2(wxInputStream& stream, float &time_acc) {//=============================================================== int ix; @@ -666,15 +607,6 @@ void SpectSeq::Load2(wxInputStream& stream, int import, int n) { SpectFrame *frame = new SpectFrame; - if(import==1) - { - if(frame->Import(stream) != 0) - { - delete frame; - break; - } - } - else if(import==2) { if(frame->ImportSPC2(stream,time_acc) != 0) @@ -720,23 +652,6 @@ else } // end of SpectSeq::Load2 -int SpectSeq::Import(wxInputStream& stream) -{//======================================== -// Import data from Pratt analysis - int n = 0; - - - wxTextInputStream text_stream(stream); - name = _T(""); - text_stream >> n; - amplitude = 100; - max_y = 0; - - Load2(stream,1,n); - return(0); -} // end of SpectSeq::Import - - int SPC2_size_cycle(CYCLE *cy) /****************************/ /* Find number of bytes in cycle record */ @@ -821,9 +736,8 @@ int SpectSeq::Load(wxInputStream & stream) } else { - // Praat analysis data - stream.SeekI(0); - return(Import(stream)); + fprintf(stderr, "Unsupported spectral file format.\n"); + return(1); } name = s.ReadString(); diff --git a/src/spect.h b/src/spect.h index 32cc7a3e..6a7d7797 100644 --- a/src/spect.h +++ b/src/spect.h @@ -128,7 +128,6 @@ class SpectFrame public: SpectFrame(SpectFrame *copy=NULL); ~SpectFrame(); - int Import(wxInputStream &stream); int ImportSPC2(wxInputStream &stream, float &time_acc); int Load(wxInputStream &stream, int file_format_type); @@ -166,7 +165,6 @@ class SpectSeq public: SpectSeq(int nframes=0); ~SpectSeq(); - int Import(wxInputStream& stream); int ImportSPC2(wxInputStream& stream); int Load(wxInputStream& stream);