Solved

How to capture voice input?

Posted on 2000-03-03
6
422 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now