From d1191aa6e158f1825994a804163fd77df6ae8da5 Mon Sep 17 00:00:00 2001 From: Kent Gorham Date: Sat, 1 Sep 2018 13:22:48 -0500 Subject: [PATCH] SA - 3.1.0.147 9/1/2018 -Fixed bug where Play and Stop buttons on Start dialog weren't restored after playback completed. -Removed MBROLA feature. --- Install/SpeechAnalyzer.iss | 4 +- SpeechAnalyzer.sln | 12 - Src/MBROLA/ipasampa.cpp | 68 --- Src/MBROLA/ipasampa.h | 9 - Src/MBROLA/mbrola.cpp | 107 ----- Src/MBROLA/mbrola.def | 12 - Src/MBROLA/mbrola.h | 77 --- Src/MBROLA/mbrola.rc | Bin 4618 -> 0 bytes Src/MBROLA/mbrola.vcxproj | 150 ------ Src/MBROLA/parser.h | 58 --- Src/MBROLA/resource.h | 14 - Src/MBROLA/ussampa1.h | 264 ----------- Src/MBROLA/ussampa2.h | 40 -- Src/Release Notes.txt | 4 + Src/SA/DlgMbrola.cpp | 750 ------------------------------ Src/SA/DlgMbrola.h | 55 --- Src/SA/DlgSynthesis.cpp | 6 - Src/SA/DlgSynthesis.h | 1 - Src/SA/Process/FormantTracker.cpp | 2 + Src/SA/Process/Hilbert.cpp | 2 + Src/SA/Sa.vcxproj | 9 +- Src/reformat.cmd | 3 - 22 files changed, 12 insertions(+), 1635 deletions(-) delete mode 100644 Src/MBROLA/ipasampa.cpp delete mode 100644 Src/MBROLA/ipasampa.h delete mode 100644 Src/MBROLA/mbrola.cpp delete mode 100644 Src/MBROLA/mbrola.def delete mode 100644 Src/MBROLA/mbrola.h delete mode 100644 Src/MBROLA/mbrola.rc delete mode 100644 Src/MBROLA/mbrola.vcxproj delete mode 100644 Src/MBROLA/parser.h delete mode 100644 Src/MBROLA/resource.h delete mode 100644 Src/MBROLA/ussampa1.h delete mode 100644 Src/MBROLA/ussampa2.h delete mode 100644 Src/SA/DlgMbrola.cpp delete mode 100644 Src/SA/DlgMbrola.h diff --git a/Install/SpeechAnalyzer.iss b/Install/SpeechAnalyzer.iss index ee37bb64..0e701959 100644 --- a/Install/SpeechAnalyzer.iss +++ b/Install/SpeechAnalyzer.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Speech Analyzer MSEA" -#define MyAppVersion "3.1.0.147" +#define MyAppVersion "3.1.0.148" #define MyAppPublisher "SIL International, Inc." #define MyAppURL "http://www.speechanalyzer.sil.org/" #define MyAppExeName "SA.exe" @@ -39,7 +39,6 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip [Files] Source: "C:\Working\SIL\MSEA\Release\SA.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "C:\Working\SIL\MSEA\Release\SA.exe"; DestDir: "{app}"; DestName: "SAServer.exe"; Flags: ignoreversion -Source: "C:\Working\SIL\MSEA\Release\mbrola.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "C:\Working\SIL\MSEA\Release\SA_DSP.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "C:\Working\SIL\MSEA\Release\SA_ENU.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "C:\Working\SIL\MSEA\Release\SA_DEU.dll"; DestDir: "{app}"; Flags: ignoreversion @@ -98,6 +97,7 @@ Name: "{app}\Training" Type: files; Name: "{app}\SA MSEA Release Notes.txt" Type: files; Name: "{app}\SA MSEA Roadmap.txt" Type: files; Name: "{app}\Roadmap.txt" +Type: files; Name: "{app}\mbrola.dll" [UninstallDelete] Type: files; Name: "{app}\SAUtils.tlb" diff --git a/SpeechAnalyzer.sln b/SpeechAnalyzer.sln index 492dff0e..bf2ef2fc 100644 --- a/SpeechAnalyzer.sln +++ b/SpeechAnalyzer.sln @@ -21,8 +21,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SA", "Src\SA\Sa.vcxproj", " {CB7EF7F0-A6EF-4E12-8AE6-D981004B8E21} = {CB7EF7F0-A6EF-4E12-8AE6-D981004B8E21} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mbrola", "Src\MBROLA\mbrola.vcxproj", "{70E56708-42C2-4233-AF98-DC57F936C968}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zGraph", "Src\ZGraph\zGraph.vcxproj", "{F8066672-47AB-44DA-8698-AD978581A138}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "yeti.wmfsdk", "src\yeti.wmfsdk\yeti.wmfsdk.csproj", "{FECB5BEB-AB05-454A-BB14-6A554E897274}" @@ -121,16 +119,6 @@ Global {67914272-7CF2-4E5B-A0EC-54728888A13D}.Release|Mixed Platforms.Build.0 = Release|Win32 {67914272-7CF2-4E5B-A0EC-54728888A13D}.Release|Win32.ActiveCfg = Release|Win32 {67914272-7CF2-4E5B-A0EC-54728888A13D}.Release|Win32.Build.0 = Release|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Debug|Win32.ActiveCfg = Debug|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Debug|Win32.Build.0 = Debug|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Release|Any CPU.ActiveCfg = Release|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Release|Mixed Platforms.Build.0 = Release|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Release|Win32.ActiveCfg = Release|Win32 - {70E56708-42C2-4233-AF98-DC57F936C968}.Release|Win32.Build.0 = Release|Win32 {F8066672-47AB-44DA-8698-AD978581A138}.Debug|Any CPU.ActiveCfg = Debug|Win32 {F8066672-47AB-44DA-8698-AD978581A138}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {F8066672-47AB-44DA-8698-AD978581A138}.Debug|Mixed Platforms.Build.0 = Debug|Win32 diff --git a/Src/MBROLA/ipasampa.cpp b/Src/MBROLA/ipasampa.cpp deleted file mode 100644 index ac0b8585..00000000 --- a/Src/MBROLA/ipasampa.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include "ipasampa.h" - -static char * BaseIpa[] = { -#include "ussampa1.h" //lookup table for single-byte - //IPA strings (base characters) -}; -static char * xIpa[] = { -#include "ussampa2.h" //lookup table for multiple-byte IPA - //strings (base plus diacritics) -}; - -extern "C" int Lookup(const void * Key, const void * TblEntry) { - return (strncmp((char *)Key, *(char **)TblEntry, strcspn(*(char **)TblEntry, " "))); -} - -//translate from IPA to Sampa -extern "C" char * IpaToSampa(const TCHAR * IpaString) { - - char * Found = NULL; - - // Validate pointer to IPA string. - if (!IpaString) { - return (NULL); - } - - switch (strlen(IpaString)) { - - // Indicate IPA string is invalid if there are no characters. - case 0: - return (NULL); - - // If IPA string consists of only one character, do a simple table lookup. - case 1: - if (*BaseIpa[(unsigned char)IpaString[0]] == 0) { - return (NULL); - } else { - return (BaseIpa[(unsigned char)IpaString[0]]); - } - - // Otherwise, do a binary search through the multi-byte table. - default: - Found = (char *)bsearch((void *)IpaString, (void *)xIpa, - sizeof(xIpa)/sizeof(xIpa[0]), - sizeof(xIpa[0]), Lookup); - if (Found) { - return (strpbrk(*(char **)Found, " ")+1); - } else { - return (NULL); - } - } -} - -//check if symbol in translation table -extern "C" bool QuerySymbol(const TCHAR IpaChar) { - // Attempt to look up in single-byte table. - if (*BaseIpa[(unsigned char)IpaChar]) { - return (true); - } - // Attempt to find somewhere in multi-byte table. - for (unsigned short i = 0; i < sizeof(xIpa)/sizeof(xIpa[0]); i++) - for (unsigned short j = 0; xIpa[i][j] != (char)' '; j++) - if (IpaChar == xIpa[i][j]) { - return (true); - } - return (false); -} \ No newline at end of file diff --git a/Src/MBROLA/ipasampa.h b/Src/MBROLA/ipasampa.h deleted file mode 100644 index 0f8da62d..00000000 --- a/Src/MBROLA/ipasampa.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _IPASAMPA_H -#define _IPASAMPA_H -#include - -extern "C" int Lookup(const void * Key, const void * TblEntry); -extern "C" TCHAR * IpaToSampa(const TCHAR * IpaString); -extern "C" bool QuerySymbol(const TCHAR IpaChar); - -#endif diff --git a/Src/MBROLA/mbrola.cpp b/Src/MBROLA/mbrola.cpp deleted file mode 100644 index 49a46180..00000000 --- a/Src/MBROLA/mbrola.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* -* FPMs-TCTS SOFTWARE LIBRARY -* -* File : mbrola.cpp -* Purpose : Mbrola interface with the MBROLA synthesizer DLL -* Author : Alain Ruelle -* Email : ruelle@tcts.fpms.ac.be -* -* 31/08/98 : New Interface, using functions instead of Object -* -* Copyright (c) 1997 Faculte Polytechnique de Mons (TCTS lab) -* All rights reserved. -*/ -#include -#include -#include -#include "mbrola.h" - -HINSTANCE hinstDllMBR; -PROCIC init_MBR; -PROCICCC init_rename_MBR; -PROCIC write_MBR; -PROCIV flush_MBR; -PROCISI read_MBR; -PROCIPVIAT readType_MBR; -PROCVV close_MBR; -PROCVV reset_MBR; -PROCIV lastError_MBR; -PROCVCI lastErrorStr_MBR; -PROCVI setNoError_MBR; -PROCIV getNoError_MBR; -PROCVI setFreq_MBR; -PROCIV getFreq_MBR; -PROCVF setVolumeRatio_MBR; -PROCFV getVolumeRatio_MBR; -PROCVCI getVersion_MBR; -PROCICII getDatabaseInfo_MBR; -PROCPPAR setParser_MBR; -PROCPPHOCF init_Phone; -PROCVPPHO reset_Phone; -PROCVPPHO close_Phone; -PROCVPPHOFF appendf0_Phone; - -BOOL load_MBR() { - if ((hinstDllMBR=LoadLibrary("mbrola.dll"))==NULL) { - return FALSE; - } - init_MBR =(PROCIC) GetProcAddress(hinstDllMBR,"init_MBR"); - init_rename_MBR =(PROCICCC) GetProcAddress(hinstDllMBR,"init_rename_MBR"); - write_MBR =(PROCIC) GetProcAddress(hinstDllMBR,"write_MBR"); - flush_MBR =(PROCIV) GetProcAddress(hinstDllMBR,"flush_MBR"); - read_MBR =(PROCISI) GetProcAddress(hinstDllMBR,"read_MBR"); - readType_MBR =(PROCIPVIAT) GetProcAddress(hinstDllMBR,"readtype_MBR"); - close_MBR =(PROCVV) GetProcAddress(hinstDllMBR,"close_MBR"); - reset_MBR =(PROCVV) GetProcAddress(hinstDllMBR,"reset_MBR"); - lastError_MBR =(PROCIV) GetProcAddress(hinstDllMBR,"lastError_MBR"); - lastErrorStr_MBR =(PROCVCI) GetProcAddress(hinstDllMBR,"lastErrorStr_MBR"); - setNoError_MBR =(PROCVI) GetProcAddress(hinstDllMBR,"setNoError_MBR"); - getNoError_MBR =(PROCIV) GetProcAddress(hinstDllMBR,"getNoError_MBR"); - setFreq_MBR =(PROCVI) GetProcAddress(hinstDllMBR,"setFreq_MBR"); - getFreq_MBR =(PROCIV) GetProcAddress(hinstDllMBR,"getFreq_MBR"); - setVolumeRatio_MBR =(PROCVF) GetProcAddress(hinstDllMBR,"setVolumeRatio_MBR"); - getVolumeRatio_MBR =(PROCFV) GetProcAddress(hinstDllMBR,"getVolumeRatio_MBR"); - getVersion_MBR =(PROCVCI) GetProcAddress(hinstDllMBR,"getVersion_MBR"); - getDatabaseInfo_MBR =(PROCICII) GetProcAddress(hinstDllMBR,"getDatabaseInfo_MBR"); - setParser_MBR =(PROCPPAR) GetProcAddress(hinstDllMBR,"setParser_MBR"); - init_Phone =(PROCPPHOCF) GetProcAddress(hinstDllMBR,"init_Phone"); - reset_Phone =(PROCVPPHO) GetProcAddress(hinstDllMBR,"reset_Phone"); - close_Phone =(PROCVPPHO) GetProcAddress(hinstDllMBR,"close_Phone"); - appendf0_Phone =(PROCVPPHOFF) GetProcAddress(hinstDllMBR,"appendf0_Phone"); - - if ((!init_MBR) - || (!init_rename_MBR) - || (!write_MBR) - || (!flush_MBR) - || (!read_MBR) - || (!readType_MBR) - || (!close_MBR) - || (!reset_MBR) - || (!lastError_MBR) - || (!lastErrorStr_MBR) - || (!setNoError_MBR) - || (!getNoError_MBR) - || (!setFreq_MBR) - || (!getFreq_MBR) - || (!setVolumeRatio_MBR) - || (!getVolumeRatio_MBR) - || (!getVersion_MBR) - || (!getDatabaseInfo_MBR) - || (!setParser_MBR) - || (!init_Phone) - || (!reset_Phone) - || (!close_Phone) - || (!appendf0_Phone)) { - FreeLibrary(hinstDllMBR); - hinstDllMBR=NULL; - return FALSE; - } - return TRUE; -} - -void unload_MBR() { - if (hinstDllMBR) { - FreeLibrary(hinstDllMBR); - hinstDllMBR=NULL; - } -} \ No newline at end of file diff --git a/Src/MBROLA/mbrola.def b/Src/MBROLA/mbrola.def deleted file mode 100644 index f703c3b2..00000000 --- a/Src/MBROLA/mbrola.def +++ /dev/null @@ -1,12 +0,0 @@ -LIBRARY Mbrola -EXPORTS -?load_MBR@@YAHXZ -?unload_MBR@@YAXXZ -IpaToSampa -?flush_MBR@@3P6GHXZA -?lastErrorStr_MBR@@3P6GPADPADH@ZA -?read_MBR@@3P6GHPAFH@ZA -?write_MBR@@3P6GHPAD@ZA -?setFreq_MBR@@3P6GXH@ZA -?reset_MBR@@3P6GXXZA -?init_MBR@@3P6GHPAD@ZA diff --git a/Src/MBROLA/mbrola.h b/Src/MBROLA/mbrola.h deleted file mode 100644 index 6c372cdd..00000000 --- a/Src/MBROLA/mbrola.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -* FPMs-TCTS SOFTWARE LIBRARY -* -* Copyright (c) 95-98 Faculte Polytechnique de Mons (TCTS lab) -* All rights reserved. -* PERMISSION IS HEREBY DENIED TO USE, COPY, MODIFY, OR DISTRIBUTE THIS -* SOFTWARE OR ITS DOCUMENTATION FOR ANY PURPOSE WITHOUT WRITTEN -* AGREEMENT OR ROYALTY FEES. -* -* File: mbrola.h -* Purpose: Diphone-based MBROLA speech synthesizer. -* Interface of the WWW DLL -* Author: Vincent Pagel -* Email : mbrola@tcts.fpms.ac.be -* -* 28/08/98: Created from one_channel.h -*/ -#ifndef __MBROLA_H__ -#define __MBROLA_H__ - -#include "parser.h" - -#define PITCH_SWITCH ";; F = " -#define TIME_SWITCH ";; T = " - -typedef enum EAudioType { - LIN16=0, /* same as intern computation format: 16 bits linear */ - LIN8, /* unsigned linear 8 bits, worse than telephone */ - ULAW, /* MU law -> 8bits, telephone. Roughly equ. to 12bits */ - ALAW /* A law -> 8bits, equivallent to mulaw */ -} AudioType; - -typedef void (WINAPI * PROCVV)(void); -typedef void (WINAPI * PROCVI)(int); -typedef void (WINAPI * PROCVF)(float); -typedef void (WINAPI * PROCPPAR)(struct SParser *); -typedef void (WINAPI * PROCVPPHO)(LPPHONE); -typedef void (WINAPI * PROCVPPHOFF)(LPPHONE,float,float); -typedef int (WINAPI * PROCIV)(); -typedef int (WINAPI * PROCIC)(char *); -typedef int (WINAPI * PROCISI)(short *,int); -typedef int (WINAPI * PROCICII)(char *, int, int); -typedef int (WINAPI * PROCICCC)(char *,char *,char *); -typedef int (WINAPI * PROCIPVIAT)(void *, int, AudioType); -typedef float(WINAPI * PROCFV)(); -typedef char * (WINAPI * PROCVCI)(char *,int); -typedef LPPHONE(WINAPI * PROCPPHOCF)(char *,float); - -extern PROCIC init_MBR; -extern PROCICCC init_rename_MBR; -extern PROCIC write_MBR; -extern PROCIV flush_MBR; -extern PROCISI read_MBR; -extern PROCIPVIAT readType_MBR; -extern PROCVV close_MBR; -extern PROCVV reset_MBR; -extern PROCIV lastError_MBR; -extern PROCVCI lastErrorStr_MBR; -extern PROCVI setNoError_MBR; -extern PROCIV getNoError_MBR; -extern PROCVI setFreq_MBR; -extern PROCIV getFreq_MBR; -extern PROCVF setVolumeRatio_MBR; -extern PROCFV getVolumeRatio_MBR; -extern PROCVCI getVersion_MBR; -extern PROCICII getDatabaseInfo_MBR; -extern PROCPPAR setParser_MBR; - -extern PROCPPHOCF init_Phone; -extern PROCVPPHO reset_Phone; -extern PROCVPPHO close_Phone; -extern PROCVPPHOFF appendf0_Phone; - -BOOL load_MBR(); -void unload_MBR(); - -#endif \ No newline at end of file diff --git a/Src/MBROLA/mbrola.rc b/Src/MBROLA/mbrola.rc deleted file mode 100644 index d92223fed178971e3cbdf744c0f65dbcea41cfc9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4618 zcmdUzTW=CU6vxlAiQi$RFE(BZwlVr>TZ)ZP8o5N1CZv{&O%NKONo)KUQbfF)rI3bJ0hxl zPBqA%7TI;c$sMAr$|Jr%c%r40O?Z4HhC5K5K)>xytpYs(+G4J_I1LbwSAq92x%%Fo z!@B|AJ`hi{h|%G#&uSk5(q(xBC_mb0@_|zi|GQd{pXDJYG;5TwSw3du-tVJ(#Z?Mn zNAoAY@}607UVY_1Z!uA+uB>xLUd1mEr;GKbU}w~yGa}m8{#eRo678-j(W>Wcxq93s z(^O;pqZ*M{Z?e%Ae6(3rB`J+0)IQ9*`*p)l(RhqM0z7EaCi^6fh{UfGeZ$$i!#mq$kmPt($%OT4RSw% z^9`r;c_Um!Wn48>-O5y)7Fn{4ljl&nqwi6Pr`YL!{9*!M_moaeQ`C{q^WH;7J$rMS z*ji2cnNuY6c&{?=eZ5R$g_HAhU)8maU1ga963pnI`e;@^n=eWJS-~EMa7y;Io?AFm-KL^dcb59!Th8>InzHD-lOiI@bce2UdO9P+ zsk?O7B}UPWRrt!gv2BJK8-BAd*lmoh&f(oEL$NODf_Jq`#?asDf9kB)DBG!QmPScwq?z_%{@ZV4 hb&mIcBL`b1rP!>sBwXH^j;P)G7bp8gob|gn{Q=(ABIE!7 diff --git a/Src/MBROLA/mbrola.vcxproj b/Src/MBROLA/mbrola.vcxproj deleted file mode 100644 index e0c16233..00000000 --- a/Src/MBROLA/mbrola.vcxproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {70E56708-42C2-4233-AF98-DC57F936C968} - mbrola - mbrola - - - - DynamicLibrary - false - MultiByte - v140 - - - DynamicLibrary - false - MultiByte - v140 - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - mbrola - mbrola - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - - - Disabled - _DEBUG;WIN32;_WINDOWS;_USRDLL;MBROLA_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - true - - - .\mbrola.def - true - false - - - - - MachineX86 - - - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - - - Disabled - Default - NDEBUG;WIN32;_WINDOWS;_USRDLL;MBROLA_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDLL - Level4 - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - true - .\mbrola.def - false - false - - - - - MachineX86 - - - true - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/MBROLA/parser.h b/Src/MBROLA/parser.h deleted file mode 100644 index a5e6b655..00000000 --- a/Src/MBROLA/parser.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* FPMs-TCTS SOFTWARE LIBRARY -* -* File: parser_fifo.c -* Purpose: polymorphic type to parse a "pho file" -* Author: Vincent Pagel -* Email : mbrola@tcts.fpms.ac.be -* -* Copyright (c) 98 Faculte Polytechnique de Mons (TCTS lab) -* All rights reserved. -* PERMISSION IS HEREBY DENIED TO USE, COPY, MODIFY, OR DISTRIBUTE THIS -* SOFTWARE OR ITS DOCUMENTATION FOR ANY PURPOSE WITHOUT WRITTEN -* AGREEMENT OR ROYALTY FEES. -* -* 18/06/98 : Created -*/ - -#ifndef _PARSER_H -#define _PARSER_H - -typedef void * LPPHONE; - -/* Return values of the nextphone function */ -typedef enum EStatePhone { - PHO_OK, - PHO_EOF, - PHO_FLUSH -} StatePhone; - - -/* Polymorphic type */ - -typedef void (*reset_ParserFunction)(struct SParser * ps); -typedef void (*close_ParserFunction)(struct SParser * ps); -typedef StatePhone(*nextphone_ParserFunction)(struct SParser * ps,LPPHONE * ph); - -/* -* Generic parser : -* reset: forget remaining data in the buffer (when the user STOP synthesis for example -* -* close: release the memory -* -* nextphone: return the next Phoneme from input. -* -* PRECONDITION: this phoneme MUST have a pitch point at 0 and 100% -* -* THE CALLER IS IN CHARGE OF CALLING close_Phone ON THE PHONES HE GETS -* WITH nextphone -*/ - -struct SParser { - void * self; /* Polymorphic on the real type */ - reset_ParserFunction reset_Parser; /* virtual func */ - close_ParserFunction close_Parser; /* virtual func */ - nextphone_ParserFunction nextphone_Parser; /* virtual func */ -}; - -#endif diff --git a/Src/MBROLA/resource.h b/Src/MBROLA/resource.h deleted file mode 100644 index 4020cc45..00000000 --- a/Src/MBROLA/resource.h +++ /dev/null @@ -1,14 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by mbrola.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Src/MBROLA/ussampa1.h b/Src/MBROLA/ussampa1.h deleted file mode 100644 index 71acaccd..00000000 --- a/Src/MBROLA/ussampa1.h +++ /dev/null @@ -1,264 +0,0 @@ -/*********************************************************************************************\ - - SINGLE-BYTE IPA TO SAMPA LOOKUP TABLE - ------------------------------------------------------------------------------------------------- - SAMPA SAMPA ASAP IPA Articulatory Description - Code char IPA Code Glyph ------------------------------------------------------------------------------------------------*/ -"" , // 0 -"" , // 1 -"" , // 2 -"" , // 3 -"" , // 4 -"" , // 5 -"" , // 6 -"" , // 7 -"" , // 8 -"" , // 9 -"" , // 10 -"" , // 11 -"" , // 12 -"" , // 13 -"" , // 14 -"" , // 15 -"" , // 16 -"" , // 17 -"" , // 18 -"" , // 19 -"" , // 20 -"" , // 21 -"" , // 22 -"" , // 23 -"" , // 24 -"" , // 25 -"" , // 26 -"" , // 27 -"" , // 28 -"" , // 29 -"" , // 30 -"" , // 31 -"" , // 32 -"" , // 33 -"" , // 34 -"" , // 35 -"" , // 36 -"" , // 37 -"" , // 38 -"" , // 39 -"" , // 40 -"" , // 41 -"" , // 42 -"" , // 43 -"" , // 44 -"" , // 45 -"" , // 46 -"" , // 47 -"" , // 48 -"" , // 49 -"" , // 50 -"" , // 51 -"" , // 52 -"" , // 53 -"" , // 54 -"" , // 55 -"" , // 56 -"" , // 57 -"" , // 58 -"" , // 59 -"" , // 60 -"" , // 61 -"" , // 62 -"\x34" , // 4 63 glottal stop Eng. "bat" -"" , // 64 -"\x41" , // A 65 script a open back unrounded,Cardinal 5, Eng. "start" -"" , // 66 -"" , // 67 -"\x44" , // D 68 eth Eng. "then" -"\x45" , // E 69 epsilon Eng. "pet" -"" , // 70 -"" , // 71 -"" , // 72 -"\x49" , // I 73 Eng. "bit" -"" , // 74 -"" , // 75 -"" , // 76 -"" , // 77 -"\x4E" , // N 78 eng velar nasal, Eng. "thing" -"" , // 79 -"" , // 80 -"\x7B" , // { 81 ash diagraph Eng. "pat" -"\x34" , // 4 82 fish hook r voiced alveolar flap, Eng. "later" -"\x53" , // S 83 esh voiceless palatoalveolar fricative, Eng. "ship" -"\x54" , // T 84 theta -"\x55" , // U 85 upsilon Eng. "book" -"" , // 86 -"" , // 87 -"" , // 88 -"" , // 89 -"\x5A" , // Z 90 ezh (yogh) vd. palatoalveolar fric., Eng. "measure" -"" , // 91 -"" , // 92 -"" , // 93 -"" , // 94 -"" , // 95 -"" , // 96 -"" , // 97 -"\x62" , // b 98 b -"" , // 99 -"\x64" , // d 100 d -"\x45\x49" , // EI 101 e Eng. "bay" -"\x66" , // f 102 f -"\x67" , // g 103 g -"\x68" , // h 104 h -"\x69" , // i 105 i Eng. "bean" -"\x6A" , // j 106 j Eng. "yes" -"\x6B\x5F\x68", // k_h 107 k aspirated -"\x6C" , // l 108 l -"\x6D" , // m 109 m -"\x6E" , // n 110 n -"\x40\x55" , // @U 111 o -"\x70\x5F\x68", // p_h 112 p aspirated -"" , // 113 -"\x72" , // r 114 r -"\x73" , // s 115 s -"\x74\x5F\x68", // t_h 116 t aspirated -"\x75" , // u 117 u Eng. "boot" -"\x76" , // v 118 v -"\x77" , // w 119 w -"" , // 120 -"" , // 121 -"\x7A" , // z 122 z -"" , // 123 -"" , // 124 -"" , // 125 -"" , // 126 -"" , // 127 -"" , // 128 -"" , // 129 -"" , // 130 -"" , // 131 -"" , // 132 -"" , // 133 -"" , // 134 -"" , // 135 -"" , // 136 -"" , // 137 -"" , // 138 -"" , // 139 -"" , // 140 -"\x4F" , // O 141 turned c open-mid back rounded, Eng. "thought" -"" , // 142 -"" , // 143 -"" , // 144 -"" , // 145 -"" , // 146 -"" , // 147 -"" , // 148 -"" , // 149 -"" , // 150 -"" , // 151 -"" , // 152 -"" , // 153 -"" , // 154 -"" , // 155 -"" , // 156 -"" , // 157 -"" , // 158 -"" , // 159 -"" , // 160 -"" , // 161 -"" , // 162 -"" , // 163 -"" , // 164 -"" , // 165 -"" , // 166 -"" , // 167 -"" , // 168 -"" , // 169 -"" , // 170 -"\x40" , // @ 171 turned e schwa, Eng. "banana" -"" , // 172 -"" , // 173 -"" , // 174 -"" , // 175 -"" , // 176 -"" , // 177 -"" , // 178 -"" , // 179 -"" , // 180 -"" , // 181 -"" , // 182 -"" , // 183 -"" , // 184 -"" , // 185 -"" , // 186 -"" , // 187 -"" , // 188 -"" , // 189 -"" , // 190 -"" , // 191 -"" , // 192 -"" , // 193 -"" , // 194 -"\x56" , // V 195 turned v Eng. "nut" -"" , // 196 -"" , // 197 -"" , // 198 -"" , // 199 -"" , // 200 -"" , // 201 -"" , // 202 -"" , // 203 -"" , // 204 -"" , // 205 -"" , // 206 -"" , // 207 -"" , // 208 -"" , // 209 -"" , // 210 -"" , // 211 -"" , // 212 -"" , // 213 -"" , // 214 -"" , // 215 -"" , // 216 -"" , // 217 -"" , // 218 -"" , // 219 -"" , // 220 -"" , // 221 -"" , // 222 -"" , // 223 -"" , // 224 -"" , // 225 -"" , // 226 -"" , // 227 -"" , // 228 -"" , // 229 -"" , // 230 -"" , // 231 -"" , // 232 -"" , // 233 -"" , // 234 -"" , // 235 -"" , // 236 -"" , // 237 -"" , // 238 -"" , // 239 -"" , // 240 -"" , // 241 -"" , // 242 -"" , // 243 -"" , // 244 -"" , // 245 -"\x49" , // 246 barred i, Eng. "debit" -"" , // 247 -"" , // 248 -"" , // 249 -"\x68" , // h 250 hooktop heng, Eng. "ahead" -"" , // 251 -"" , // 252 -"" , // 253 -"" , // 254 -"" // 255 diff --git a/Src/MBROLA/ussampa2.h b/Src/MBROLA/ussampa2.h deleted file mode 100644 index cf8a7a3f..00000000 --- a/Src/MBROLA/ussampa2.h +++ /dev/null @@ -1,40 +0,0 @@ -/*****************************************************************************************************\ - - MULTIPLE-BYTE IPA TO SAMPA LOOKUP TABLE - ---------------------------------------------------------------------------------------------------------- - ASAP SAMPA IPA SAMPA Articulatory Description -IPA Codes* Codes Glyph String ----------------------------------------------------------------------------------------------------------*/ -"\x41\x49 \x41\x49" , // script a, I AI -"\x41\x55 \x61\x55" , // script a, upsilon aU -"\x45\xAB \x65\x40" , // epsilon, schwa e@ -"\x49\xAB \x49\x40" , // I, schwa I@ -"\x4E\x60 \x4E" , // eng, syllabic N -"\x52\xE2 \x6E" , // flap box n Error: should be flap tilde -"\x52\xF2 \x6E" , // flap tilde n -"\x55\xAB \x55\x40" , // upsilon, schwa U@ -"\x62\x7C \x62" , // b, ¬ b -"\x64\x5A \x64\x5A" , // d ezh dZ -"\x64\x7C \x64" , // d, ¬ d -"\x67\x7C \x67" , // g, ¬ g -"\x6B\x7C \x6B" , // k, ¬ k -"\x6C\x60 \x6C" , // l, syllabic l -"\x6D\x60 \x6D" , // m, syllabic m -"\x6E\x60 \x6E" , // n, syllabic n -"\x70\x7C \x70" , // p, ¬ p -"\x74\x53 \x74\x53" , // t esh tS affricate -"\x74\x7C \x74" , // t, ¬ t -"\x75\x2B \x75" , // u, cross u -"\x75\xB1 \x75" , // u, box u Error: should be u cross -"\x8D\x49 \x4F\x49" , // turned c, I OI -"\xAB\xA5 \x56" , // upside down V V -"\xAB\xA8\x38 \x72\x3D", // schwa upside dn backwd r o r= -"\xAB\xA8\xA5 \x72\x3D", // schwa upside dn backwd r box r= Error: should be o -"\xCE\xD5 \x72\x3D" // reversed epsilon-rt hk. r= - - - - - -// * first hex code must not be \x20 diff --git a/Src/Release Notes.txt b/Src/Release Notes.txt index b3d5dfaf..adaac9a9 100644 --- a/Src/Release Notes.txt +++ b/Src/Release Notes.txt @@ -1,3 +1,7 @@ +SA - 3.1.0.147 9/1/2018 +-Fixed bug where Play and Stop buttons on Start dialog weren't restored after playback completed. +-Removed MBROLA feature. + SA - 3.1.0.147 8/28/2018 - Fixed bug where the 'Open' and 'Open Startup' dialog boxes were not able to play .mp3 files. diff --git a/Src/SA/DlgMbrola.cpp b/Src/SA/DlgMbrola.cpp deleted file mode 100644 index 72205ac2..00000000 --- a/Src/SA/DlgMbrola.cpp +++ /dev/null @@ -1,750 +0,0 @@ -// DlgMbrola.cpp : implementation file -// -#include "stdafx.h" -#include "sa.h" -#include "DlgMbrola.h" -#include "sa_doc.h" -#include "Segment.h" -#include "sa_view.h" -#include "mainfrm.h" -#include "FileUtils.h" -#include "Process\sa_p_gra.h" -#include "Process\sa_p_spi.h" -#include "Process\Process.h" -#include -#include - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CDlgMbrola dialog - - -IMPLEMENT_DYNCREATE(CDlgMbrola, CPropertyPage) - -CDlgMbrola::CDlgMbrola() : CPropertyPage(CDlgMbrola::IDD) { - m_fPitchUpdateInterval = 0.01; - int Err = load_MBR(); - UNUSED_ALWAYS(Err); - m_bGetComplete = FALSE; - m_bConvertComplete = FALSE; - m_bGetDuration = TRUE; - m_bGetIPA = TRUE; - m_bGetPitch = TRUE; -} - -CDlgMbrola::~CDlgMbrola() { - // remove synthesized wavefile in SA - FileUtils::Remove(m_szMBRolaName); - unload_MBR(); -} - - -void CDlgMbrola::DoDataExchange(CDataExchange * pDX) { - CPropertyPage::DoDataExchange(pDX); - DDX_Control(pDX, IDC_MBROLA_OUTPUT_GRID, m_cOutputGrid); - DDX_Check(pDX, IDC_MBROLA_IPA, m_bGetIPA); - DDX_Control(pDX, IDC_MBROLA_SOURCE, m_cSource); - DDX_Control(pDX, IDC_MBROLA_DICTIONARY, m_cDictionary); - DDX_Check(pDX, IDC_MBROLA_DURATION, m_bGetDuration); - DDX_Control(pDX, IDC_MBROLA_GRID, m_cGrid); - DDX_Check(pDX, IDC_MBROLA_PITCH, m_bGetPitch); -} - - -BEGIN_MESSAGE_MAP(CDlgMbrola, CPropertyPage) - ON_BN_CLICKED(IDC_MBROLA_GET, OnMbrolaGet) - ON_BN_CLICKED(IDC_MBROLA_SYNTHESIZE, OnMbrolaSynthesize) - ON_BN_CLICKED(IDC_MBROLA_PLAY_SYNTH, OnMbrolaPlaySynth) - ON_BN_CLICKED(IDC_MBROLA_PLAY, OnMbrolaPlay) - ON_BN_CLICKED(IDC_MBROLA_PLAY_SOURCE, OnMbrolaPlaySource) - ON_BN_CLICKED(IDC_MBROLA_CONVERT, OnMbrolaConvert) - ON_BN_CLICKED(IDC_MBROLA_DISPLAY, OnMbrolaDisplay) - ON_CBN_DROPDOWN(IDC_MBROLA_SOURCE, OnDropdownSource) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CDlgMbrola message handlers - -BEGIN_EVENTSINK_MAP(CDlgMbrola, CPropertyPage) -//{{AFX_EVENTSINK_MAP(CDlgMbrola) -ON_EVENT(CDlgMbrola, IDC_MBROLA_GRID, 72 /* LeaveCell */, OnLeaveCellMbrolaGrid, VTS_NONE) -//}}AFX_EVENTSINK_MAP -END_EVENTSINK_MAP() - -static void CurveFitPitch(CSaDoc * pDoc, double fSizeFactor, DWORD dwBeginWAV, DWORD dwEndWAV, double * offset, double * slope) { - DWORD dwIndex; - DWORD dwBegin = (DWORD)(dwBeginWAV/fSizeFactor); - DWORD dwEnd = (DWORD)(dwEndWAV/fSizeFactor); - - int n = 0; - double sumX = 0; - double sumY = 0; - double sumXX = 0; - double sumYY = 0; - double sumXY = 0; - - BOOL bRes = TRUE; - for (dwIndex = dwBegin; dwIndex < dwEnd; dwIndex++) { - // get data for this pixel - int nHere = pDoc->GetSmoothedPitch()->GetProcessedData(dwIndex, &bRes); // SDM 1.5Test11.0 - if (nHere > 0) { - double Y = double(nHere)/PRECISION_MULTIPLIER; - double X = double(dwIndex-dwBegin)*fSizeFactor; - - sumX += X; - sumXX += X*X; - sumY += Y; - sumXY += X*Y; - sumYY += Y*Y; - - n++; - } - } - if (n>0) { - double localSlope = (n*sumXY - sumX*sumY)/(n*sumXX - sumX*sumX); - double localOffset = sumY/n - localSlope*sumX/n; - - if (offset) { - *offset = localOffset; - } - if (slope) { - *slope = localSlope; - } - } else { - if (offset) { - *offset = - 1.; - } - if (slope) { - *slope = 0; - } - } -} - - -struct SDictionaryList { - TCHAR * description; - char * path; -}; - -SDictionaryList Dictionary[] = { - // filename placeholder - _T("American English - Male"), "c:\\mbrola\\voices\\us2", - _T("American English - Female"), "c:\\mbrola\\voices\\us1", - 0,0 // Null terminated list -}; - - -BOOL CDlgMbrola::OnInitDialog() { - CPropertyPage::OnInitDialog(); - - // for some reason the arrow keys do not seem to work on a property sheet ?? - m_cGrid.FakeArrowKeys(TRUE); - - // Label Grid - m_cGrid.SetTextMatrix(rowHeading,columnDescription, _T("ITEM #")); - m_cGrid.SetTextMatrix(rowIpa,columnDescription, _T("IPA")); - m_cGrid.SetFont(PHONETIC_DEFAULT_FONT,PHONETIC_DEFAULT_FONTSIZE,rowIpa,columnFirst,1, -1); - m_cGrid.SetRowHeight(rowIpa, 500); - m_cGrid.SetTextMatrix(rowDuration,columnDescription, _T("Duration (ms)")); - m_cGrid.SetTextMatrix(rowPitchAvg,columnDescription, _T("Avg Pitch (Hz)")); - m_cGrid.SetColWidth(columnDescription,0, 2500); - - for (int i=columnFirst; iIsFileOpened(szFilename); - CSegment * pPhonetic = pDoc->GetSegment(PHONETIC); - - if (pPhonetic->IsEmpty()) { // no annotations - return; - } - - // process all flags - CString szString; - CString szCrLf = "\r\n"; - - short int nResult; - int column = columnFirst; - enum {PITCH, CALCULATIONS}; - double fSizeFactor[CALCULATIONS]; - - if (m_bGetPitch) { // formants need pitch info - //CProcessGrappl* pPitch = pDoc->GetGrappl(); // SDM 1.5 Test 11.0 - CProcessSmoothedPitch * pPitch = pDoc->GetSmoothedPitch(); - nResult = LOWORD((short int)pPitch->Process(this, pDoc)); // process data - if (nResult == PROCESS_ERROR) { - m_bGetPitch = FALSE; - } else if (nResult == PROCESS_CANCELED) { - return; - } else { - fSizeFactor[PITCH] = (double)pDoc->GetDataSize() / (double)(pPitch->GetDataSize() - 1); - } - } - - DWORD dwOffset = 0; - DWORD dwPrevOffset; - DWORD dwDuration = 0; - int nIndex = 0; - const DWORD dwMinSilence = pDoc->GetBytesFromTime(0.0005); - - // construct table entries - while (nIndex != -1) { - dwPrevOffset = dwOffset; - dwOffset = pPhonetic->GetOffset(nIndex); - if (dwPrevOffset + dwDuration + dwMinSilence < dwOffset) { - if (m_bGetIPA) { - szString.Format(_T("silence")); - m_cGrid.SetTextMatrix(rowIpa,column,szString); - } - if (m_bGetDuration) { - dwDuration = dwOffset - (dwPrevOffset + dwDuration); - szString.Format(_T("%.4f"),pDoc->GetTimeFromBytes(dwDuration)*1000.); - m_cGrid.SetTextMatrix(rowDuration,column,szString); - } - column++; - } - szString = pPhonetic->GetSegmentString(nIndex); - dwDuration = pPhonetic->GetDuration(nIndex); - if (m_bGetIPA) { - m_cGrid.SetTextMatrix(rowIpa,column,szString); - } - - - if (m_bGetDuration) { - szString.Format(_T("%.4f"),pDoc->GetTimeFromBytes(dwDuration)*1000.); - m_cGrid.SetTextMatrix(rowDuration,column,szString); - } - - if (m_bGetPitch) { - double offset; - double slope; - DWORD dwStop = pPhonetic->GetStop(nIndex); - - CurveFitPitch(pDoc, fSizeFactor[PITCH], dwOffset, pPhonetic->GetStop(nIndex), &offset, &slope); - if (offset > 0) { - szString.Format(_T("%.5g"),offset + slope*pPhonetic->GetDuration(nIndex)/2.); - } else { - szString.Empty(); - } - m_cGrid.SetTextMatrix(rowPitchAvg,column,szString); - - DWORD dwUpdateInterval = pDoc->GetBytesFromTime(m_fPitchUpdateInterval/2)*2; - int row = rowPitchMs; - - for (DWORD dwHere = dwOffset; dwHere < dwStop; dwHere += dwUpdateInterval) { - DWORD dwBegin = dwHere; - DWORD dwEnd = dwHere + dwUpdateInterval; - - if (dwEnd > dwStop) { - dwEnd = dwStop; - } - if (dwHere >= dwOffset + dwUpdateInterval) { - dwBegin -= dwUpdateInterval; - } - - CurveFitPitch(pDoc, fSizeFactor[PITCH], dwBegin, dwEnd, &offset, &slope); - if (offset > 0) { - szString.Format(_T("%.5g"),offset + slope*(dwHere-dwBegin)); - } else { - szString.Empty(); - } - m_cGrid.SetTextMatrix(row,column,szString); - row++; - } - } - - - nIndex = pPhonetic->GetNext(nIndex); - if (nIndex == -1) { - column++; - if (m_bGetIPA) { - szString.Format(_T("silence")); - m_cGrid.SetTextMatrix(rowIpa,column,szString); - } - if (m_bGetDuration) { - dwDuration = pDoc->GetDataSize() - (dwOffset + dwDuration); - szString.Format(_T("%.4f"),pDoc->GetTimeFromBytes(dwDuration)*1000.); - m_cGrid.SetTextMatrix(rowDuration,column,szString); - } - } - - column++; - if (column >= m_cGrid.GetCols(0)) { - m_cGrid.SetCols(0, column+10); - m_cGrid.SetFont(PHONETIC_DEFAULT_FONT,PHONETIC_DEFAULT_FONTSIZE,rowIpa,column,1, -1); - } - } - - // clear residual columns - for (; column < m_cGrid.GetCols(0); column++) { - szString.Empty(); - if (m_bGetIPA) { - m_cGrid.SetTextMatrix(rowIpa,column,szString); - } - if (m_bGetDuration) { - m_cGrid.SetTextMatrix(rowDuration,column,szString); - } - if (m_bGetPitch) { - m_cGrid.SetTextMatrix(rowPitchAvg,column,szString); - - for (int i = rowPitchMs; i < m_cGrid.GetRows(); i++) { - m_cGrid.SetTextMatrix(i,column,szString); - } - } - } - - // select dictionary based on gender - EGender nGender = pDoc->GetGender(); - if (nGender > female) { - nGender = female; // force to female since no dictionary exists for child - } - m_cDictionary.SetCurSel(nGender); - - m_bGetComplete = TRUE; -} - - -void CDlgMbrola::OnMbrolaConvert() { - m_bConvertComplete = FALSE; - - if (!m_bGetComplete) { - OnMbrolaGet(); - } - if (!m_bGetComplete) { - return; - } - - for (int i=columnFirst; i= m_cOutputGrid.GetCols(0)) { - m_cOutputGrid.SetCols(0,i+1); - } - - - CString SAMPA = (IPA == _T("silence"))?_T("_"):IpaToSampa(IPA); - if (!SAMPA) { - SAMPA = "n/a"; - } - m_cOutputGrid.SetTextMatrix(rowSampa,i,SAMPA); - if (SAMPA == "n/a") { - continue; - } - - CString durationText = m_cGrid.GetTextMatrix(rowDuration,i); - double duration = _tcstod(durationText,&ptr)/1000.; - - CString pitchText = m_cGrid.GetTextMatrix(rowPitchAvg,i); - double pitch = _tcstod(pitchText, &ptr); - - BOOL bCombine = FALSE; - if (i < m_cGrid.GetCols(0) - 1) { - CString NextIPA = m_cGrid.GetTextMatrix(rowIpa, i+1); - bCombine = (IPA == "b|" && NextIPA == "b") || - (IPA == "d|" && NextIPA == "d") || - (IPA == "g|" && NextIPA == "g") || - (IPA == "p|" && NextIPA == "p") || - (IPA == "t|" && NextIPA == "t") || - (IPA == "k|" && NextIPA == "k"); - if (bCombine) { - pitch = duration * pitch; - duration += _tcstod(m_cGrid.GetTextMatrix(rowDuration,i+1), &ptr)/1000.; - pitch += _tcstod(m_cGrid.GetTextMatrix(rowDuration,i+1), &ptr)/1000. * - _tcstod(m_cGrid.GetTextMatrix(rowPitchAvg,i+1), &ptr)/1000.; - pitch /= duration; - if (pitch > 0) { - pitchText.Format(_T("%.5g"), pitch); - } - } - } - durationText.Format(_T("%d"), (int)(duration*1000.+0.5)); - m_cOutputGrid.SetTextMatrix(rowDuration,i,durationText); - m_cOutputGrid.SetTextMatrix(rowPitchAvg,i,pitchText); - - // Copy pitch values - durationText = m_cGrid.GetTextMatrix(rowDuration,i); - duration = _tcstod(durationText,&ptr)/1000.; - int rows = int(duration/m_fPitchUpdateInterval); - BOOL bPitch = FALSE; - for (int row = 0; row <= rows; row++) { - pitchText = m_cGrid.GetTextMatrix(row + rowPitchMs,i); - pitch = _tcstod(pitchText, &ptr); - if (pitch > 0) { - pitchText.Format(_T("%d"), (int)(pitch+0.5)); - if (!bPitch) { - for (int fillrow = 0; fillrow < row; fillrow++) { - m_cOutputGrid.SetTextMatrix(fillrow + rowPitchMs,i,pitchText); - } - bPitch = TRUE; - } - m_cOutputGrid.SetTextMatrix(row + rowPitchMs,i,pitchText); - } - } - if (bCombine) { - int appendRow = rows; - durationText = m_cGrid.GetTextMatrix(rowDuration,i+1); - duration = _tcstod(durationText,&ptr)/1000.; - rows = int(duration/m_fPitchUpdateInterval); - for (int row = 0; row <= rows; row++) { - pitchText = m_cGrid.GetTextMatrix(row + rowPitchMs,i+1); - pitch = _tcstod(pitchText, &ptr); - if (pitch > 0) { - pitchText.Format(_T("%d"), (int)(pitch+0.5)); - m_cOutputGrid.SetTextMatrix(rowPitchMs + appendRow++,i,pitchText); - } - } - i++; - } - } - } - m_bConvertComplete = TRUE; -} - - -struct SMBRolaVector { - CString Sampa; - double AvgPitch; - double Duration; -}; - -void CDlgMbrola::OnMbrolaSynthesize() { - if (!m_bConvertComplete) { - OnMbrolaConvert(); - } - if (!m_bConvertComplete) { - return; - } - - int Voice = m_cDictionary.GetCurSel(); - int Err = init_MBR(Dictionary[Voice].path); - if (Err) { - reset_MBR(); - } - setFreq_MBR(16000); - - // create and open the synthesis file - CSaApp * pApp = (CSaApp *)AfxGetApp(); - // create temp filename for synthesized waveform - if (m_szMBRolaName.IsEmpty()) { - FileUtils::GetTempFileName(_T("MBR"), m_szMBRolaName.GetBuffer(_MAX_PATH), _MAX_PATH); - m_szMBRolaName.ReleaseBuffer(); - } - - - HMMIO hmmioFile = mmioOpen(const_cast(LPCTSTR(m_szMBRolaName)), NULL, MMIO_CREATE | MMIO_WRITE | MMIO_EXCLUSIVE); - if (!(hmmioFile)) { - // error opening file - pApp->ErrorMessage(IDS_ERROR_FILEOPEN, m_szMBRolaName); - return; - } - // create a 'RIFF' chunk with a 'WAVE' form type - MMCKINFO mmckinfoParent; - mmckinfoParent.fccType = mmioFOURCC('W', 'A', 'V', 'E'); // prepare search code - // set chunk size - mmckinfoParent.cksize = 0; - if (mmioCreateChunk(hmmioFile, &mmckinfoParent, MMIO_CREATERIFF)) { // create the 'RIFF' chunk - // error creating RIFF chunk - pApp->ErrorMessage(IDS_ERROR_WRITERIFFCHUNK, m_szMBRolaName); - return; - } - // create the 'fmt ' subchunk - MMCKINFO mmckinfoSubchunk; - mmckinfoSubchunk.ckid = mmioFOURCC('f', 'm', 't', ' '); - // set chunk size - mmckinfoSubchunk.cksize = 16; - if (mmioCreateChunk(hmmioFile, &mmckinfoSubchunk, 0)) { // create the 'data' chunk - // error creating format chunk - pApp->ErrorMessage(IDS_ERROR_WRITEFORMATCHUNK, m_szMBRolaName); - return; - } - - // write the format parameters into 'fmt ' chunk - CFmtParm format; - format.wTag = 1; // PCM - format.wBitsPerSample = 16; - format.wChannels = 1; - format.wBlockAlign = 2; - format.dwSamplesPerSec = 16000; - format.dwAvgBytesPerSec = format.wBlockAlign*format.dwSamplesPerSec; - - long lError = mmioWrite(hmmioFile, (HPSTR)&format.wTag, sizeof(WORD)); - if (lError != -1) { - lError = mmioWrite(hmmioFile, (HPSTR)&format.wChannels, sizeof(WORD)); - } - if (lError != -1) { - lError = mmioWrite(hmmioFile, (HPSTR)&format.dwSamplesPerSec, sizeof(DWORD)); - } - if (lError != -1) { - lError = mmioWrite(hmmioFile, (HPSTR)&format.dwAvgBytesPerSec, sizeof(DWORD)); - } - if (lError != -1) { - lError = mmioWrite(hmmioFile, (HPSTR)&format.wBlockAlign, sizeof(WORD)); - } - if (lError != -1) { - lError = mmioWrite(hmmioFile, (HPSTR)&format.wBitsPerSample, sizeof(WORD)); - } - if (lError == -1) { - // error writing format chunk - pApp->ErrorMessage(IDS_ERROR_WRITEFORMATCHUNK, m_szMBRolaName); - return; - } - - // get out of 'fmt ' chunk - if (mmioAscend(hmmioFile, &mmckinfoSubchunk, 0)) { - // error writing format chunk - pApp->ErrorMessage(IDS_ERROR_WRITEFORMATCHUNK, m_szMBRolaName); - return; - } - // create the 'data' subchunk - mmckinfoSubchunk.ckid = mmioFOURCC('d', 'a', 't', 'a'); - // set chunk size - mmckinfoSubchunk.cksize = 0; - if (mmioCreateChunk(hmmioFile, &mmckinfoSubchunk, 0)) { // create the 'data' chunk - // error creating data chunk - pApp->ErrorMessage(IDS_ERROR_WRITEDATACHUNK, m_szMBRolaName); - return; - } - - static short MbrolaDataBuffer[16384]; - DWORD dwMbrolaDataBlockSize; - CString szSegmentParms; - - for (int i=columnFirst; iErrorMessage(IDS_ERROR_WRITEDATACHUNK, m_szMBRolaName); - mmioClose(hmmioFile, 0); - return; - } - } while (dwMbrolaDataBlockSize == sizeof(MbrolaDataBuffer)); - } - } - flush_MBR(); - do { - dwMbrolaDataBlockSize = read_MBR(MbrolaDataBuffer, sizeof(MbrolaDataBuffer)) * sizeof(MbrolaDataBuffer[0]); - if (mmioWrite(hmmioFile, (HPSTR)MbrolaDataBuffer, (long)dwMbrolaDataBlockSize) == -1) { - // error writing wave file - pApp->ErrorMessage(IDS_ERROR_WRITEDATACHUNK, m_szMBRolaName); - mmioClose(hmmioFile, 0); - return; - } - } while (dwMbrolaDataBlockSize == sizeof(MbrolaDataBuffer)); - // get out of 'data' chunk - if (mmioAscend(hmmioFile, &mmckinfoSubchunk, 0)) { - // error writing data chunk - pApp->ErrorMessage(IDS_ERROR_WRITEDATACHUNK, m_szMBRolaName); - mmioClose(hmmioFile, 0); - return; - } - // get out of 'RIFF' chunk, to write RIFF size - if (mmioAscend(hmmioFile, &mmckinfoParent, 0)) { - // error writing RIFF chunk - pApp->ErrorMessage(IDS_ERROR_WRITERIFFCHUNK, m_szMBRolaName); - mmioClose(hmmioFile, 0); - return; - } - mmioClose(hmmioFile, 0); // close file -} - -void CDlgMbrola::OnMbrolaPlaySynth() { - OnMbrolaSynthesize(); - if (m_szMBRolaName.GetLength()) { - PlaySound(m_szMBRolaName, 0, SND_SYNC | SND_NODEFAULT | SND_FILENAME); - } -} - -void CDlgMbrola::OnMbrolaPlaySource() { - CString szFilename; - int nSource = m_cSource.GetCurSel(); - if (nSource == CB_ERR) { - return; - } - m_cSource.GetLBText(nSource, szFilename); - - PlaySound(szFilename, 0, SND_SYNC | SND_NODEFAULT | SND_FILENAME); -} - -void CDlgMbrola::OnMbrolaPlay() { - OnMbrolaPlaySynth(); - - OnMbrolaPlaySource(); -} - - -void CDlgMbrola::OnMbrolaDisplay() { - if (m_szMBRolaName.IsEmpty()) { - OnMbrolaSynthesize(); - } - - // open synthesized wavefile in SA - CFileStatus status; // file status - if (CFile::GetStatus(m_szMBRolaName, status)) { - if (status.m_size) { - // file created open in SA - CSaApp * pApp = (CSaApp *)(AfxGetApp()); - - pApp->OpenWavFileAsNew(m_szMBRolaName); - m_szMBRolaName.Empty(); - } - } -} - -void CDlgMbrola::OnDropdownSource() { - CString szFilename; - int nSource = m_cSource.GetCurSel(); - if (nSource != CB_ERR) { - m_cSource.GetLBText(nSource, szFilename); - } - - m_cSource.ResetContent(); - - // Populate Source - CDocTemplate * pDocTemplate; - POSITION docPosition = AfxGetApp()->GetFirstDocTemplatePosition(); - pDocTemplate = AfxGetApp()->GetNextDocTemplate(docPosition); - POSITION position = pDocTemplate->GetFirstDocPosition(); - while (position != NULL) { - CDocument * pDoc = pDocTemplate->GetNextDoc(position); // get pointer to document - CString path = pDoc->GetPathName(); - if (!path.IsEmpty()) { - m_cSource.AddString(path); - } - } - m_cSource.SetCurSel(0); - if (!szFilename.IsEmpty()) { - int sel = m_cSource.FindStringExact(0,szFilename); - if (sel != CB_ERR) { - m_cSource.SetCurSel(sel); - } - } else { - CMainFrame * pMDIFrameWnd = (CMainFrame *)AfxGetMainWnd(); - if (pMDIFrameWnd) { - CView * pView = pMDIFrameWnd->GetCurrSaView(); - if (pView && !pView->GetDocument()->GetPathName().IsEmpty()) { - m_cSource.SelectString(-1,pView->GetDocument()->GetPathName()); - } - } - } - -} diff --git a/Src/SA/DlgMbrola.h b/Src/SA/DlgMbrola.h deleted file mode 100644 index 9e0d0d9e..00000000 --- a/Src/SA/DlgMbrola.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef DLGMBROLA_H -#define DLGMBROLA_H - -#include "flexEditGrid.h" - -class CDlgMbrola : public CPropertyPage { - DECLARE_DYNCREATE(CDlgMbrola) - -public: - CDlgMbrola(); // standard constructor - ~CDlgMbrola(); // standard constructor - - CString m_szMBRolaName; - - double m_fPitchUpdateInterval; - CFlexEditGrid m_cGrid; - CFlexEditGrid m_cOutputGrid; - BOOL m_bGetComplete; - BOOL m_bConvertComplete; - enum { IDD = IDD_MBROLA }; - CComboBox m_cSource; - CComboBox m_cDictionary; - BOOL m_bGetDuration; - BOOL m_bGetIPA; - BOOL m_bGetPitch; - -protected: - virtual void DoDataExchange(CDataExchange * pDX); - -private: - enum { - rowHeading = 0, - rowIpa = 1, rowSampa = 1, - rowDuration = 2, - rowPitchAvg = 3, - rowPitchMs = 5 - }; - enum {columnDescription = 0,columnFirst = 1}; - -protected: - afx_msg void OnMbrolaGet(); - afx_msg void OnMbrolaSynthesize(); - virtual BOOL OnInitDialog(); - afx_msg void OnLeaveCellMbrolaGrid(); - afx_msg void OnMbrolaPlaySynth(); - afx_msg void OnMbrolaPlay(); - afx_msg void OnMbrolaPlaySource(); - afx_msg void OnMbrolaConvert(); - afx_msg void OnMbrolaDisplay(); - afx_msg void OnDropdownSource(); - DECLARE_EVENTSINK_MAP() - DECLARE_MESSAGE_MAP() -}; - -#endif diff --git a/Src/SA/DlgSynthesis.cpp b/Src/SA/DlgSynthesis.cpp index f9b8d248..94776117 100644 --- a/Src/SA/DlgSynthesis.cpp +++ b/Src/SA/DlgSynthesis.cpp @@ -15,7 +15,6 @@ #include "stdafx.h" #include "DlgSynthesis.h" #include "mainfrm.h" -#include "DlgMbrola.h" // The debugger can't handle symbols more than 255 characters long. // STL often creates symbols longer than that. @@ -44,8 +43,6 @@ END_MESSAGE_MAP() /***************************************************************************/ CDlgSynthesis::CDlgSynthesis(LPCTSTR pszCaption, CWnd * pParent, UINT iSelectPage) : CPropertySheet(pszCaption, pParent, iSelectPage) { - m_pDlgMbrolaPage = new CDlgMbrola; - AddPage(m_pDlgMbrolaPage); } @@ -53,9 +50,6 @@ CDlgSynthesis::CDlgSynthesis(LPCTSTR pszCaption, CWnd * pParent, UINT iSelectPag // CDlgSynthesis::~CDlgSynthesis Destructor /***************************************************************************/ CDlgSynthesis::~CDlgSynthesis() { - if (m_pDlgMbrolaPage) { - delete m_pDlgMbrolaPage; - } } diff --git a/Src/SA/DlgSynthesis.h b/Src/SA/DlgSynthesis.h index 33f5c4a2..c4814c57 100644 --- a/Src/SA/DlgSynthesis.h +++ b/Src/SA/DlgSynthesis.h @@ -30,7 +30,6 @@ class CDlgSynthesis : public CPropertySheet { public: void OnHelpSynthesis(); void OnHelp(); - CDlgMbrola * m_pDlgMbrolaPage; CButton m_cOK; // CButton m_cHelp; diff --git a/Src/SA/Process/FormantTracker.cpp b/Src/SA/Process/FormantTracker.cpp index 96d6e038..d45e6628 100644 --- a/Src/SA/Process/FormantTracker.cpp +++ b/Src/SA/Process/FormantTracker.cpp @@ -393,6 +393,7 @@ SFormantFreq * CProcessFormantTracker::GetFormant(DWORD dwIndex) { } void CProcessFormantTracker::Dump(LPCSTR ofilename) { + /* return; FILE * ofile = NULL; errno_t err = fopen_s(&ofile, ofilename, "w"); @@ -423,4 +424,5 @@ void CProcessFormantTracker::Dump(LPCSTR ofilename) { fprintf(ofile, "%d values read\n",count); fflush(ofile); fclose(ofile); + */ } diff --git a/Src/SA/Process/Hilbert.cpp b/Src/SA/Process/Hilbert.cpp index 66e762d4..ac8caae9 100644 --- a/Src/SA/Process/Hilbert.cpp +++ b/Src/SA/Process/Hilbert.cpp @@ -93,6 +93,7 @@ CZTransform CProcessHilbert::DelayHalf() { } void CProcessHilbert::Dump(LPCSTR ofilename) { + /* return; FILE * ofile = NULL; errno_t err = fopen_s(&ofile, ofilename, "w"); @@ -154,4 +155,5 @@ void CProcessHilbert::Dump(LPCSTR ofilename) { } fflush(ofile); fclose(ofile); + */ } diff --git a/Src/SA/Sa.vcxproj b/Src/SA/Sa.vcxproj index c5526313..62c213e6 100644 --- a/Src/SA/Sa.vcxproj +++ b/Src/SA/Sa.vcxproj @@ -56,7 +56,7 @@ Disabled - .;..\ElanUtils;..\XMLUtils;..\FileUtils;..\LiftUtils;..\lib;..\WaveUtils;..\SA_KLATT;..\mbrola;..\Lang;..\SA_DSP;..\zGraph;$(XERCES_VC10_HOME)\src;..\uriparser\include;$(OutDir);%(AdditionalIncludeDirectories) + .;..\ElanUtils;..\XMLUtils;..\FileUtils;..\LiftUtils;..\lib;..\WaveUtils;..\SA_KLATT;..\Lang;..\SA_DSP;..\zGraph;$(XERCES_VC10_HOME)\src;..\uriparser\include;$(OutDir);%(AdditionalIncludeDirectories) _WINDOWS;WINDOWS_PLATFORM;_DEBUG;WIN32;WINVER=0x0501;%(PreprocessorDefinitions) true MultiThreadedDebugDLL @@ -105,7 +105,7 @@ Disabled Default - .;..\ElanUtils;..\XMLUtils;..\FileUtils;..\LiftUtils;..\lib;..\WaveUtils;..\SA_KLATT;..\mbrola;..\Lang;..\SA_DSP;..\zGraph;$(XERCES_VC10_HOME)\src;..\uriparser\include;$(OutDir);%(AdditionalIncludeDirectories) + .;..\ElanUtils;..\XMLUtils;..\FileUtils;..\LiftUtils;..\lib;..\WaveUtils;..\SA_KLATT;..\Lang;..\SA_DSP;..\zGraph;$(XERCES_VC10_HOME)\src;..\uriparser\include;$(OutDir);%(AdditionalIncludeDirectories) _WINDOWS;WINDOWS_PLATFORM;WIN32;NDEBUG;WINVER=0x501;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -306,7 +306,6 @@ - @@ -570,7 +569,6 @@ - @@ -616,9 +614,6 @@ - - {70e56708-42c2-4233-af98-dc57f936c968} - {bb3f670e-28af-42ce-9c9f-de267d3cb986} diff --git a/Src/reformat.cmd b/Src/reformat.cmd index 4a22de26..9336d002 100644 --- a/Src/reformat.cmd +++ b/Src/reformat.cmd @@ -16,9 +16,6 @@ astyle --options=astyle.opts saexe\settings\*.h astyle --options=astyle.opts saexe\synthesis\*.cpp astyle --options=astyle.opts saexe\synthesis\*.c astyle --options=astyle.opts saexe\synthesis\*.h -astyle --options=astyle.opts saexe\synthesis\mbrola\*.cpp -astyle --options=astyle.opts saexe\synthesis\mbrola\*.c -astyle --options=astyle.opts saexe\synthesis\mbrola\*.h astyle --options=astyle.opts saexe\synthesis\sa_klatt\*.cpp astyle --options=astyle.opts saexe\synthesis\sa_klatt\*.c astyle --options=astyle.opts saexe\synthesis\sa_klatt\*.h