CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2
  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > C++ and WinAPI
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    C++ and WinAPI Discuss Windows API related issues using C++ (and Visual C++). This is a non-MFC forum.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old January 2nd, 2009, 09:36 PM
    patyork patyork is offline
    Junior Member
     
    Join Date: Oct 2008
    Posts: 19
    patyork is an unknown quantity at this point (<10)
    Speech API? speech.h?

    Does anyone know how to incorporate SAPI into a c++ program? I need my program to say text that is in a file automatically, but I can't find any help online.

    And what about speech.h? I can't find it anywhere, and I was hoping I might learn somwthing from it.

    So anyways, thanks.




    EDIT:

    Found this, but you have to delete the numbers on the side... Not even sure if its the right file or not...

    http://developer.vrjuggler.org/brows...ch.h?rev=19729

    EDIT2: I took the file from the above website and removed the excess numbers, so here it is...

    Code:
    /*************** <auto-copyright.pl BEGIN do not edit this line> **************
     	 *
     	 * VR Juggler is (C) Copyright 1998-2007 by Iowa State University
     	 *
     	 * Original Authors:
     	 *   Allen Bierbaum, Christopher Just,
    	 *   Patrick Hartling, Kevin Meinert,
     	 *   Carolina Cruz-Neira, Albert Baker
     	 *
     	 * This library is free software; you can redistribute it and/or
     	 * modify it under the terms of the GNU Library General Public
     	 * License as published by the Free Software Foundation; either
     	 * version 2 of the License, or (at your option) any later version.
     	 *
     	 * This library is distributed in the hope that it will be useful,
     	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     	 * Library General Public License for more details.
     	 *
     	 * You should have received a copy of the GNU Library General Public
     	 * License along with this library; if not, write to the
     	 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     	 * Boston, MA 02111-1307, USA.
     	 *
     	 *************** <auto-copyright.pl END do not edit this line> ***************/
     	
     	#ifndef _GADGET_SPEECH_H_
     	#define _GADGET_SPEECH_H_
     	
     	#include <gadget/gadgetConfig.h>
     	
     	namespace gadget
     	{
     	
     	/** \class Speech Speech.h gadget/Type/Speech.h
     	 *
     	 */
     	class Speech
     	{
     	public:
     	   /** Constructs using element. */
     	   Speech();
     	
     	   /** Destructor. */
     	   ~Speech();
     	
     	   virtual std::string     getWord();
     	   virtual int       getId();
     	   virtual void         setMode( Mode mode );
     	   virtual std::list<asdfjlk>&   getList();
     	   virtual void         config();
     	
     	   enum Mode
     	   {
     	      DICTATE,
     	      COMMAND,
     	      ON,
     	      OFF
     	   };
     	
     	   class asdfjlk
        {
    	      std::string word;
     	      int id;
     	   };
     	
     	   virtual bool startSampling() = 0;
     	   virtual bool stopSampling() = 0;
     	   virtual bool sample() = 0;
     	   virtual void updateData () = 0;
     	
     	protected:
     	   std::list<asdfjlk>   _wordQueue;
     	   Mode           _currentMode;
     	
     	   // Config chunck sets these.
     	   std::string       _filename;
     	   std::string       _dragonIP;
     	   int               _dragonPort;
     	   std::string       _user;
     	
     	protected:
     	   void           startThread();
     	   static void       controlLoop(Speech& currentInstance);
     	};
     	
     	
     	inline std::string Speech::getWord()
     	{
     	   std::string word = "";
     	
     	   if (_wordQueue.size > 0)
     	   {
     	      word = (*_wordQueue.begin()).word;
     	      _wordQueue.pop_front();
     	   }
     	
     	   return word;
     	}
     	
     	inline int Speech::getId()
     	{
     	   int id = -1;
     	
     	   if (_wordQueue.size > 0)
     	   {
     	      id = (*_wordQueue.begin()).id;
     	      _wordQueue.pop_front();
     	   }
     	
     	   return id;
     	}
     	
     	inline void Speech::setMode( Mode mode )
     	{
     	   _mode = mode;
     	   // TODO: tell dragon about the mode change.
     	}
     	
    	inline std::list<asdfjlk>& Speech::getList()
     	{
     	   return _wordQueue;
     	}
     	
     	//TODO: take a config chunck here.
     	inline void Speech::config()
     	{
     	   _filename = "somefile.vjs";
     	   _dragonIP = "129.186.232.70";
     	   _dragonPort = 5600;
     	   _user = "kevin";
     	}
     	
        // End of gadget namespace
    	
    
    #endif   /* _GADGET_SPEECH_H_ */

    Last edited by patyork; January 2nd, 2009 at 09:56 PM.
    Reply With Quote
      #2    
    Old January 2nd, 2009, 11:01 PM
    Codeplug's Avatar
    Codeplug Codeplug is online now
    Senior Member
     
    Join Date: Nov 2003
    Posts: 1,235
    Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+)
    Re: Speech API? speech.h?

    http://msdn.microsoft.com/en-us/libr...27(VS.85).aspx
    http://msdn.microsoft.com/en-us/libr...71(VS.85).aspx
    http://msdn.microsoft.com/en-us/libr...10(VS.85).aspx

    gg
    Reply With Quote
      #3    
    Old January 2nd, 2009, 11:06 PM
    Codeplug's Avatar
    Codeplug Codeplug is online now
    Senior Member
     
    Join Date: Nov 2003
    Posts: 1,235
    Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+) Codeplug is a glorious beacon of light (400+)
    Re: Speech API? speech.h?

    http://www.microsoft.com/downloads/d...displaylang=en

    gg
    Reply With Quote
      #4    
    Old January 3rd, 2009, 02:13 PM
    patyork patyork is offline
    Junior Member
     
    Join Date: Oct 2008
    Posts: 19
    patyork is an unknown quantity at this point (<10)
    Re: Speech API? speech.h?

    Hey, I found speech.h for anyone that is interested:

    http://www.codeproject.com/KB/audio-...select=1103666

    I will also attach it to this post...
    Attached Files
    File Type: h Speech.h (1.3 KB, 76 views)
    Reply With Quote
      #5    
    Old November 23rd, 2009, 07:55 AM
    Jack12388 Jack12388 is offline
    Junior Member
     
    Join Date: Nov 2009
    Posts: 1
    Jack12388 is an unknown quantity at this point (<10)
    Exclamation Re: Speech API? speech.h?

    im working on a text to speech system .. the application has a .txt file to it .. i want that the application should repeat the last spoken line again when the user presses a button .. how to go about it ??
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > C++ and WinAPI


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 11:00 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.