Solved

How to capture voice input?

Posted on 2000-03-03
6
423 Views
Last Modified: 2010-04-10
I am writing a Visual C++ program that have to capture the time whenever there is a voice input towards the microphone. I have no idea how to work it out as I am a novice towards multimedia programming. Please help, it is very urgent.
0
Comment
Question by:LiWangOn
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:Wyn
ID: 2582552
Qed...
1. MCIWnd Window Class

Recording with MCIWnd Controls
http://msdn.microsoft.com/library/psdk/multimed/mciwnd_0e43.htm 

2. MCI

Recording with a Waveform-Audio Device
http://msdn.microsoft.com/library/psdk/multimed/mci_4wpx.htm 

3. Waveform Audio

Example of Writing Waveform Data
http://msdn.microsoft.com/library/psdk/multimed/wave_8rj5.htm 

Recording and Playing Waveform Audio
http://msdn.microsoft.com/library/techart/msdn_spellit.htm 

4. DirectSound

Tutorial 2: Capturing a Sound
http://msdn.microsoft.com/library/psdk/directx/dstut_9ox0.htm
0
 

Author Comment

by:LiWangOn
ID: 2582631
Thx for the reply, but that's not what exactly I want to do. What I want to do is to know when there is a voice input towards the microphone so that I could ask the program to progress on other activity.
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2583271
->What I want to do is to know when there is a voice input towards the microphone so that I could ask the program to progress on other activity.
===================
hmm...I think the answer is what you want.plz check it and You will find the answer there.
Anyway,good luck.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:LiWangOn
ID: 2584241
I think I get your point. You mean I should analyze the data in the buffer while capturing the sound?

But I still confuse that how could I know which sample is having the "voice", and how to know the corresponding time of that sample?

(Actually I am writing a program to get respond time)
0
 

Author Comment

by:LiWangOn
ID: 2584978
I want to get the time difference (in ms) between a word presented on the computer screen and the user's respond towards the microphone.
0
 
LVL 2

Accepted Solution

by:
bkdc earned 50 total points
ID: 2682153
1. open the wave device with waveInOpen
with let's say callback function
2. create some buffers (one might be enough) of 1/2 (or other period) seconds.
3. get and store the system time - GetSysteTime (or use a timer) and then call waveInStart
4. when a buffer is recorded your callback function will be called (obvious that 1/2 sec elapsed)
5. any buffer will have some values in it differing from 0 (background noise).
If it's noise then it's usually in a narrow range (for example my sb./mic. generates noise between  -800 till -580
If the samples are not in this range then it's voice.
6. calculate the exact time when voice starts (using the sample index in the buffer and the sampling frequency)

7. of course you must have the time when the word was shown on the monitor

8. a simple substraction should give you the answer


0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question