Find Jobs
Hire Freelancers

Create Simple Executable for WAV File Input with SR Engines (SAPI 5.3) - SOURCE CODE ALREADY PROVIDED BY MICROSOFT

$30-100 USD

In Progress
Posted almost 15 years ago

$30-100 USD

Paid on delivery
I need the following source code in an executable to be run on Windows Vista 64bit that will take an existing WAV file (like from c:\[login to view URL]) and access Microsoft's Speech Recognition (SR Engines (SAPI 5.3)) to convert the wav file to text (output will be a .txt file). Microsoft has already provided the code link here: [login to view URL](VS.85).aspx I just need an executable to click on for Windows Vista to take .wav file and convert to text using exist API. I think you just need a Visual Studio Compiler to create. ## Deliverables Here is source code: [login to view URL](VS.85).aspx C-style is very similar to C++ and COM { CComPtr cpInputStream; CComPtr cpRecognizer; CComPtr cpRecoContext; CComPtr cpRecoGrammar; // Create basic SAPI stream object // NOTE: The helper SpBindToFile can be used to perform the following operations hr = [login to view URL](CLSID_SpStream); // Check hr CSpStreamFormat sInputFormat; // generate WaveFormatEx structure, assuming the wav format is 22kHz, 16-bit, Stereo hr = [login to view URL](SPSF_22kHz16BitStereo); // Check hr // setup stream object with wav file MY_WAVE_AUDIO_FILENAME // for read-only access, since it will only be access by the SR engine hr = cpInputStream->BindToFile(MY_WAVE_AUDIO_FILENAME, SPFM_OPEN_READONLY, [login to view URL](), [login to view URL](), SPFEI_ALL_EVENTS); // Check hr // Create in-process speech recognition engine hr = [login to view URL](CLSID_SpInprocRecognizer); // Check hr // connect wav input to recognizer // SAPI will negotiate mismatched engine/input audio formats using system audio codecs, so second parameter is not important - use default of TRUE hr = cpRecognizer->SetInput(cpInputStream, TRUE); // Check hr // Create recognition context to receive events hr = cpRecognizer->CreateRecoContext(&cpRecoContext;); // Check hr // Create grammar, and load dictation // ignore grammar ID for simplicity's sake // NOTE: Voice command apps would load CFG here hr = cpRecognizer->CreateGrammar(NULL, &cpRecoGrammar;); // Check hr hr = cpRecoGrammar->LoadDictation(NULL,SPLO_STATIC); // Check hr // check for recognitions and end of stream event hr = cpRecoContext->SetInterest(SPFEI(SPEI_RECOGNITION) | SPFEI(SPEI_SR_END_STREAM), SPFEI(SPEI_RECOGNITION) | SPFEI(SPEI_SR_END_STREAM)); // use Win32 events for command-line style application hr = cpRecoContext->SetNotifyWin32Event(); // Check hr // activate dictation, and begin recognition hr = cpRecoGrammar->SetDictationState(SPRS_ACTIVE); // Check hr // while events occur, continue processing // timeout should be greater than the audio stream length, or a reasonable amount of time expected to pass before no more recognitions are expected in an audio stream BOOL fEndStreamReached = FALSE; while (!fEndStreamReached && S_OK == cpRecoContext->WaitForNotifyEvent(MY_REASONABLE_TIMEOUT)) { CSpEvent spEvent; // pull all queued events from the reco context's event queue while (!fEndStreamReached && S_OK == [login to view URL](cpRecoContext)) { // Check event type switch ([login to view URL]) { // speech recognition engine recognized some audio case SPEI_RECOGNITION: // TODO: log/report recognized text break; // end of the wav file was reached by the speech recognition engine case SPEI_SR_END_STREAM: fEndStreamReached = TRUE; break; } // clear any event data/object references [login to view URL](); }// END event pulling loop - break on empty event queue OR end stream }// END event polling loop - break on event timeout OR end stream // deactivate dictation hr = cpRecoGrammar->SetDictationState(SPRS_INACTIVE); // Check hr // unload dictation topic hr = cpRecoGrammar->UnloadDictation(); // Check hr // close the input stream, since we're done with it // NOTE: smart pointer will call SpStream's destructor, and consequently ::Close, but code may want to check for errors on ::Close operation hr = cpInputStream->Close(); // Check hr }
Project ID: 3955613

About the project

2 proposals
Remote project
Active 15 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$10 USD in 2 days
5.0 (76 reviews)
5.9
5.9
2 freelancers are bidding on average $34 USD for this job
User Avatar
See private message.
$58.65 USD in 2 days
5.0 (91 reviews)
5.3
5.3

About the client

Flag of UNITED STATES
SAN RAFAEL, United States
5.0
13
Payment method verified
Member since Aug 6, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.