?
Solved

How to capture voice input?

Posted on 2000-03-03
6
Medium Priority
?
430 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 100 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

777 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