Using c++ to call and use Windows Speech Recognition [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am making an application that involves the use of windows speech recognition. I am thinking of using c++ to do this since i have some experience with this language. The way i want to use the speech recognition is so that it works internally. If i upload an audio file into my program, i want speech recognition to write this audio up as a text file, but all this should be done internally. Please provide some help with this and if i have not explained my question properly please let me know and i will try to explain again.
Thanks in advance,
Divs

(Old question, but no accepted answer, and appears quite high in google)
If you really want to do this in C++, you have to download the SAPI SDK, which does not come standard with Windows : http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&displaylang=en , select SpeechSDK51.exe
The best documentation you can find on SAPI is not on the web, it's in the SDK itself, in the Docs/ folder. The .chm explains everything really well. Here is an additional link to get you started.
However, it C++ is not a requirement for you, I strongly recommend you do it in C#. It's really much simpler (no COM components, no separate SDK, more doc on MSDN, more tutorials, ...) . See this CodeProject article; you'll have to remove all the GUI stuff, and all the speech synthesis stuff, and you'll see, speech recognition boild down to 10 lines of code. Quite impressive.
EDIT sample code, not compiled, not tested :
using System.Speech;
using System.Speech.Recognition;
// in constructor or initialisation
SpeechRecognitionEngine recognizer = null;
recognizer = new SpeechRecognitionEngine();
recognizer.SetInputToDefaultAudioDevice();
recognizer.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);
recognizer.RecognizeAsync(RecognizeMode.Multiple);
// The callback called when a sentence is recognized
private void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e){
string text = e.Result.Text;
// Do whatever you want with 'text' now
}
ta dah, done

Windows provides speech recognition engines for both clients and servers. Both can be programmed with C++ or with .NET languages. The traditional API for programming in C++ is known as SAPI. The .NET framework namepsaces for client and server speech are System.Speech and Microsoft.Speech.
SAPI documentation - http://msdn.microsoft.com/en-us/library/ms723627(VS.85).aspx
The .NET namespace for client recognition is System.Speech - http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx. Windows Vista and 7 include the speech engine.
The .NET namespace for server recognition is Microsoft.Speech and the complete SDK for the 10.2 version is available at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1b1604d3-4f66-4241-9a21-90a294a5c9a4. The speech engine is a free download.
Lots of earlier questions have addressed this. See Prototype based on speech recognition and SAPI and Windows 7 Problem for examples.

Related

Speech recognition library in C++ for XCode

I would like to add a Speech Recognition function to my C++ application programmed with XCode.
I did some Speech Recognition library hunting and here are the best candidates:
OpenEars
CMUSphinx
Voce
Nevertheless, none of these solutions are satisfying, for several reasons (that might not be a 100% true statement).
My questions are:
Did you ever try to use a Speech Recognition library in a C++ program with XCode?
Do you have an advice about which library/framework to use?
If some work has already been done, might it be possible to have a basic sample code of it? (just for the beginning...)
Note: the speech recognition function I would like to create is very simple: 10 words (in english) that increment 10 variables each time they are said and recognized, that's it.
Okay, after some searches I figured out that the apple Carbon API had a SpeechRecognition.h framework!
The bad news is that it seems quite old and that the documentation/help on internet is quite poor...
Anyone to have some experience about this framework?
Thanks for your help!

How to build native C++ apps with HTML/CSS UI? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Is it possible to develop a C++ program while using HTML and CSS for the user interface? I know about programming with Javascript using a Webkit container, but I am really interested in C++ development.
I felt in love with C# WPF when I developed under Windows, but now I moved to Linux and I haven't found a good tool for using markup for interfaces. For this, I would like to mix HTML and CSS, which are very lightweight and easy to use, with C++ code, with something like WPF.
Oh, one more thing: I'm looking for desktop development, not web.
Yes, it is possible. What you want is a C++ web framework. You could start by looking at CppCMS—a Free High Performance Web Development Framework (not a CMS) aimed for Rapid Web Application Development.
Edit: After the question has been clarified, I think Awesomium would be a good fit for your needs.
You can achieve the same functionality by embedding WebKit (or Gecko) but as far as I know that is exactly what Awesomium does behind the scenes.
An alternative is librocket—a C++ interface middleware package designed for game applications. As you can guess from the description it is a good fit for games or real-time applications.
Sciter is exactly that - embeddable HTML/CSS engine with C/C++ API. Compact and multi-platform.
And check this article.
Sciter has the same feature set as WPF but uses HTML/CSS instead of XAML and uses native API.
Features out of the box:
HTML, CSS, SVG, aPNG (animated PNGs), image sprites,
<plaintext> - editor with syntax highlighting,
<htmlarea> - WYSIWYG HTML editor,
<frame type=pager> - print preview and HTML/CSS print,
animations,
HTTP client, REST/JSON client, WebSocket's, DataSockets,
etc.
The same application with Sciter UI running on Windows, MacOS and Linux from the same sources:
Disclaimer: I am an author of Sciter Engine.
2021 update: you can also use Sciter.JS that is version of Sciter that uses standard JavaScript (ES2020) script engine.
I think Electron would be a nice addition to the other answers.
It uses NodeJS to run a Webkit Window. Electron itself is only html/css/js, but you can use any Node Module within your Electron App - including custom, natively compiled C++ code. A possible Module to embed your C++ code would be node-gyp.
Be aware, however, that this workflow may include a little bit more JS than you would have with the other answers.
My favourite text editor, Atom, was made with Electron.
You can use Chromium Embedded Framework to embed HTML5 content in your app.
You'll get might and speed of Chromium and ability to build GUI apps the same way you develop web applications.
I suggest checking out Ultralight HTML UI Engine
Not Open Source, Available for C++. OpenGL and DirectX rendering supported.
Ultralight is the lighter, faster option to integrate HTML UI in your
C++ app.
It's made by the creator of Awesomium, who unfortunately decided to delete Awesomium.
If you need something more heavy weight I recommend taking a look at CEF. It’s a very powerful (and open source) tool.
I would suggest RmlUI
Its an active fork of librocket with more features. Its very modular, you can handle rendering, event handling and user input yourself (or copy one from provided examples).
Note: RmlUI doesn't support full HTML5/CSS3 specifications, but only a subset of it. Animations are supported tho.

Extracting page dimensions from a PDF with a C++ program [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?
I looked at the answers to this question, but they mostly relate to .Net.
LibHaru
Haru is a free, cross platform,
open-sourced software library for
generating PDF written in ANSI-C. It
can work as both a static-library (.a,
.lib) and a shared-library (.so,
.dll).
Didn't try it myself, but maybe it can help you
I worked on a project that required a pdf report. After searching for online I found the PoDoFo library. Seemed very robust. I did not need all the features, so I created a wrapper to abstract away some of the complexity. Wasn't too difficult. You can find the library here:
http://podofo.sourceforge.net/
Enjoy!
If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's free online PDF reference.
jagpdf seems to be one of them. It is written in C++ but provides a C API.
It depends a bit on your needs. Some toolkits are better at drawing, others are better for writing text. Cairo has a pretty good for drawing (it support a wide range of screen and file types, including pdf), but it may not be ideal for good typography.
PDF Hummus.
see for http://pdfhummus.com/ - contains all required features for manipulation with PDF files except rendering.
LibHaru seems to be used by many.
A non-open source approach is: PDF Creator Pilot which provides more language options including C++, C#, Delphi, ASP, ASP.NET, VB, VB.NET, VBScript, PHP and Python
muPdf library looks very promising: http://mupdf.com/
There is also an open source viewer: http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html
Try wkhtmltopdf
Software features
Cross platform.
Open source.
Convert any web pages into PDF documents using webkit.
You can add headers and footers.
TOC generation.
Batch mode conversions.
Can run on Linux server with an XServer (the X11 client libs must be installed).
Can be directly used by PHP or Python via bindings to libwkhtmltox.
http://wxcode.sourceforge.net/docs/wxpdfdoc/
Works with the wxWidgets library.

Building VOIP into an application (C++ specifically) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Are there existing libraries and frameworks which allow VOIP to be built into a bespoke application without reinventing the wheel? A customer is interested by the possibility for a C++ desktop application and while it's not hugely useful (they could just use skype), it is quite cool.
I believe some technologies like DirectX may have some functionality built in for in-game chat, is that right? What else is there in the form of free/paid 3rd-party libraries?
Well, since Asterisk is open source, that's a good place to start.
Check out Astxx
"The goal of Astxx is to provide a fully functional and easy to use C++
wrapper for Asterisk enabling developers to write Asterisk related software
using the full range of what C++ has to offer. This includes AGI scripts
and accessing the Manager API."
Also IAXClient
"A lightweight cross platform IP telephony client using the IAX protocol, designed for use with the asterisk open source PBX. "
And Asterisk Sockets
"Asterisk Manage API and FAGI C++ Framework. Implemented with high efficient OS independent Sockets wrapper (ACE). Provide C++ API wrappers for Asterisk Manager API and FAGI."
There's also a .NET library
"The Asterisk .NET library consists of a set of C# classes that allow you to easily build applications that interact with an Asterisk PBX Server (1.0/1.2/1.4 version). Both FastAGI and Manager API supported. .NET/Mono compatible."
You might want to consider some form of SIP client which could be used as a basis for a softphone application. Check out the free pjsip library.
For SIP libraries, you should also look at Sofia-SIP and the GNU oSIP library.
As SIP is only use for session initiation, you'll also need a library for audio streaming (an RTP library). I've used and recommend librtp.
You may want to check out VDK: http://www.voipdevkit.com It's not free, but it's multi-platform and allows very easy integration of VoIP in other applications. It offers high-level API, so you don't have to deal with SIP or RTP by yourself.
If you want to develop a Windows C++, vb.NET or C#.Net VOIP app that uses SIP and RTP, check out the LanScape VOIP media engine SDK. Its not just a SIP library or RTP media library – it handles all the VOIP call requirements. This voip sdk is not free or open source. You license it from LS.
We used the LS sdk when we developed our windows VOIP client (softphone) and also use it on our windows voip servers for pstn trunk termination. The v5 sdk they had experienced some bugs but the “Release 6” media engine has worked great for us.
Here’s the link to their site and to the LS voip SDK.
We have been using the sdk for 3-4 years. The free and paid support LS offers is very good. I also have it on good authority that they are going to offer the same sdk on Linux and Mac OS X snow leopard.

Open source PDF library for C/C++ application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to be able to generate PDF output from my (native) C++ Windows application. Are there any free/open source libraries available to do this?
I looked at the answers to this question, but they mostly relate to .Net.
LibHaru
Haru is a free, cross platform,
open-sourced software library for
generating PDF written in ANSI-C. It
can work as both a static-library (.a,
.lib) and a shared-library (.so,
.dll).
Didn't try it myself, but maybe it can help you
I worked on a project that required a pdf report. After searching for online I found the PoDoFo library. Seemed very robust. I did not need all the features, so I created a wrapper to abstract away some of the complexity. Wasn't too difficult. You can find the library here:
http://podofo.sourceforge.net/
Enjoy!
If you're brave and willing to roll your own, you could start with a PostScript library and augment it to deal with PDF, taking advantage of Adobe's free online PDF reference.
jagpdf seems to be one of them. It is written in C++ but provides a C API.
It depends a bit on your needs. Some toolkits are better at drawing, others are better for writing text. Cairo has a pretty good for drawing (it support a wide range of screen and file types, including pdf), but it may not be ideal for good typography.
PDF Hummus.
see for http://pdfhummus.com/ - contains all required features for manipulation with PDF files except rendering.
LibHaru seems to be used by many.
A non-open source approach is: PDF Creator Pilot which provides more language options including C++, C#, Delphi, ASP, ASP.NET, VB, VB.NET, VBScript, PHP and Python
muPdf library looks very promising: http://mupdf.com/
There is also an open source viewer: http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html
Try wkhtmltopdf
Software features
Cross platform.
Open source.
Convert any web pages into PDF documents using webkit.
You can add headers and footers.
TOC generation.
Batch mode conversions.
Can run on Linux server with an XServer (the X11 client libs must be installed).
Can be directly used by PHP or Python via bindings to libwkhtmltox.
http://wxcode.sourceforge.net/docs/wxpdfdoc/
Works with the wxWidgets library.