Solved

How to capture voice input?

Posted on 2000-03-03
6
427 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

730 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