]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add mod_cepstral, more tweaks to the tts interface
authorMichael Jerris <mike@jerris.com>
Mon, 27 Feb 2006 04:33:58 +0000 (04:33 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 27 Feb 2006 04:33:58 +0000 (04:33 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@687 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/include/switch_module_interfaces.h
src/mod/asr_tts/mod_cepstral/mod_cepstral.c
src/mod/asr_tts/mod_cepstral/mod_cepstral.vcproj [new file with mode: 0644]
src/switch_core.c
w32/vsnet/Freeswitch.sln

index 5db2487ac541610fd7b32295ce77a99bd523e9c2..6c220e469b69b85fb2959529cd748b07d1407fcc 100644 (file)
@@ -770,7 +770,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
                                                                                                          char *module_name,
                                                                                                          char *voice_name,
                                                                                                          int rate,
-                                                                                                         unsigned int flags,
+                                                                                                         switch_speech_flag flags,
                                                                                                          switch_memory_pool *pool);
 
 /*!
@@ -782,7 +782,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
   \param flags flags in/out for fine tuning
   \return SWITCH_STATUS_SUCCESS with possible new flags on success
 */
-SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *sh, void *data, unsigned int *len, int rate, unsigned int *flags);
+SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *sh, void *data, unsigned int *len, int rate, switch_speech_flag *flags);
 
 /*! 
   \brief Get text back from the ASR module
@@ -792,7 +792,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *
   \param flags flags in/out for fine tuning
   \return SWITCH_STATUS_SUCCESS with possible new flags on success
 */
-SWITCH_DECLARE(switch_status) switch_core_speech_interpret_asr(switch_speech_handle *sh, char *buf, unsigned int buflen, unsigned int *flags);
+SWITCH_DECLARE(switch_status) switch_core_speech_interpret_asr(switch_speech_handle *sh, char *buf, unsigned int buflen, switch_speech_flag *flags);
 
 /*! 
   \brief Feed text to the TTS module
index e025e9d3fccd89582e2f9c370c2d77bc78f1c01a..d7277873ed48157a7d014935ff63b68ca818e0f4 100644 (file)
@@ -288,13 +288,13 @@ struct switch_speech_interface {
        switch_status (*speech_open)(switch_speech_handle *sh,
                                                                 char *voice_name, 
                                                                 int rate,
-                                                                unsigned int flags);
+                                                                switch_speech_flag flags);
        /*! function to close the speech interface */
        switch_status (*speech_close)(switch_speech_handle *, switch_speech_flag *flags);
        /*! function to feed audio to the ASR*/
-       switch_status (*speech_feed_asr)(switch_speech_handle *sh, void *data, unsigned int *len, int rate, unsigned int *flags);
+       switch_status (*speech_feed_asr)(switch_speech_handle *sh, void *data, unsigned int *len, int rate, switch_speech_flag *flags);
        /*! function to read text from the ASR*/
-       switch_status (*speech_interpret_asr)(switch_speech_handle *sh, char *buf, unsigned int buflen, unsigned int *flags);
+       switch_status (*speech_interpret_asr)(switch_speech_handle *sh, char *buf, unsigned int buflen, switch_speech_flag *flags);
        /*! function to feed text to the TTS*/
        switch_status (*speech_feed_tts)(switch_speech_handle *sh, char *text, switch_speech_flag *flags);
        /*! function to read audio from the TTS*/
index 54ff6a4228d1c1cfa4ba92c7c72d72ab43ce07cb..cee9fff7d80647e5c7ce197a3bb76f38e90c0806 100644 (file)
@@ -75,7 +75,7 @@ static swift_result_t write_audio(swift_event *event, swift_event_t type, void *
     return rv;
 }
 
-static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, int rate, unsigned int flags)
+static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, int rate, switch_speech_flag flags)
 {
        if (flags & SWITCH_SPEECH_FLAG_ASR) {
                return SWITCH_STATUS_FALSE;
@@ -139,7 +139,7 @@ static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_
        return SWITCH_STATUS_FALSE;
 }
 
-static switch_status cepstral_speech_close(switch_speech_handle *sh, unsigned int *flags)
+static switch_status cepstral_speech_close(switch_speech_handle *sh, switch_speech_flag *flags)
 {
        cepstral_t *cepstral;
 
@@ -157,7 +157,7 @@ static switch_status cepstral_speech_close(switch_speech_handle *sh, unsigned in
        return SWITCH_STATUS_SUCCESS;
 }
 
-static switch_status cepstral_speech_feed_tts(switch_speech_handle *sh, char *text, unsigned int *flags)
+static switch_status cepstral_speech_feed_tts(switch_speech_handle *sh, char *text, switch_speech_flag *flags)
 {
        cepstral_t *cepstral;
 
@@ -177,12 +177,12 @@ static switch_status cepstral_speech_read_tts(switch_speech_handle *sh,
                                                                                          void *data,
                                                                                          unsigned int *datalen,
                                                                                          unsigned int *rate,
-                                                                                         unsigned int *flags) 
+                                                                                         switch_speech_flag *flags) 
 {
        cepstral_t *cepstral;
-       int desired = *datalen;
+       size_t desired = *datalen;
        switch_status status = SWITCH_STATUS_FALSE;
-       int used, padding = 0;
+       size_t used, padding = 0;
 
        assert(sh != NULL);
        cepstral = sh->private_info;
@@ -224,7 +224,7 @@ static switch_status cepstral_speech_read_tts(switch_speech_handle *sh,
                switch_mutex_lock(cepstral->audio_lock);
                *datalen = switch_buffer_read(cepstral->audio_buffer, data, desired);
                if (padding) {
-                       int x = 0;
+                       size_t x = 0;
                        unsigned char *p = data;
                        
                        for(x = 0; x < padding; x++) {
diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.vcproj b/src/mod/asr_tts/mod_cepstral/mod_cepstral.vcproj
new file mode 100644 (file)
index 0000000..9a2645a
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="mod_cepstral"\r
+       ProjectGUID="{692F6330-4D87-4C82-81DF-40DB5892636E}"\r
+       RootNamespace="mod_cepstral"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="Debug"\r
+                       IntermediateDirectory="Debug"\r
+                       ConfigurationType="2"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                               CommandLine="cscript /nologo $(InputDir)..\..\..\..\w32\vsnet\getlibs.vbs mod_cepstral Debug"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;C:\Program Files\Cepstral\sdk\include"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="swift.lib"\r
+                               OutputFile="..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_cepstral.dll"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="C:\Program Files\Cepstral\sdk\lib\winnt"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile="$(OutDir)/mod_cepstral.pdb"\r
+                               SubSystem="2"\r
+                               ImportLibrary="$(OutDir)/mod_cepstral.lib"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="Release"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="2"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                               CommandLine="cscript /nologo $(InputDir)..\..\..\..\w32\vsnet\getlibs.vbs mod_cepstral Release"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;C:\Program Files\Cepstral\sdk\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="4"\r
+                               WarnAsError="true"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="swift.lib"\r
+                               OutputFile="..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_cepstral.dll"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="C:\Program Files\Cepstral\sdk\lib\winnt"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               ImportLibrary="$(OutDir)/mod_cepstral.lib"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\mod_cepstral.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 1aecfd3c3e2e9ba6b7a6b99e1afc4df0906e2ca5..fcb6b6001bbc4a8322715874157a91c186517ab5 100644 (file)
@@ -477,7 +477,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
                                                                                                          char *module_name, 
                                                                                                          char *voice_name,
                                                                                                          int rate,
-                                                                                                         unsigned int flags,
+                                                                                                         switch_speech_flag flags,
                                                                                                          switch_memory_pool *pool)
 {
        switch_status status;
@@ -500,14 +500,14 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
        return sh->speech_interface->speech_open(sh, voice_name, rate, flags);
 }
 
-SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *sh, void *data, unsigned int *len, int rate, unsigned int *flags)
+SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *sh, void *data, unsigned int *len, int rate, switch_speech_flag *flags)
 {
        assert(sh != NULL);
        
        return sh->speech_interface->speech_feed_asr(sh, data, len, rate, flags);
 }
 
-SWITCH_DECLARE(switch_status) switch_core_speech_interpret_asr(switch_speech_handle *sh, char *buf, unsigned int buflen, unsigned int *flags)
+SWITCH_DECLARE(switch_status) switch_core_speech_interpret_asr(switch_speech_handle *sh, char *buf, unsigned int buflen, switch_speech_flag *flags)
 {
        assert(sh != NULL);
 
index 469b068e1d0d10457af403c2d44a2e996e2b7f40..3efea681ef3e507d9f44a0e03efb2b599dd9e955 100644 (file)
@@ -154,6 +154,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey", "..\..\s
                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
        EndProjectSection\r
 EndProject\r
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "..\..\src\mod\asr_tts\mod_cepstral\mod_cepstral.vcproj", "{692F6330-4D87-4C82-81DF-40DB5892636E}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -270,6 +277,8 @@ Global
                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32\r
                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32\r
                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32\r
+               {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -299,5 +308,6 @@ Global
                {1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}\r
                {EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}\r
                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}\r
+               {692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}\r
        EndGlobalSection\r
 EndGlobal\r