Solved

Sound...microphone...MCI

Posted on 1997-11-10
2
596 Views
Last Modified: 2008-03-03
My problem is, I am trying to send sound from a microphone down a phone line.
This I can do, however I have to use MCI_RECORD then MCI_PLAY. This creates a significant time delay.
Therefore could anyone tell me how to eliminate this delay?
Ideally I would like to redirect the speaker output without using MCI_RECORD
Any solutions gratefully accepted
Thanks in advance
Darrel Robertson.
0
Comment
Question by:dkr1
2 Comments
 
LVL 2

Accepted Solution

by:
Slarti earned 200 total points
ID: 1172889
Sorry to disappoint you, but you cannot use MCI for what you want. MCI is a simple interface designed for quick, easy programming jobs in simple programs like jukeboxes. What you need to do is use a different set of API calls, the low-level multimedia API. This set of functions allows you to (almost) directly control the sound card. What you do is send Windows the address of a small buffer (say, 4K). This buffer is filled up almost immediately (appx. 50 msec in CD-quality recordings), and returned to you. You then send the next buffer to be recorded, and you can process the first buffer while the second is being recorded, and so on. In other words, you can process information which has just been recorded. You can choose between either callback functions or Windows messaging for the method of communicating with Windows.

As you can see this is a bit more complicated than MCI, where just one command will record a sound for you... However, that is (always?) the price you have to pay for more powerful programs. There is extensive documentation of these functions, and how to use them, in Microsoft's programming references. If (as I assume) you are using one of the flavors of Win32, you should look it up in "The Win32 Programming Reference", Volume 2, published by Microsoft Press. There is an entire chapter called "Low Level Multimedia Functions", which will explain exactly what you need to do.

Good luck!
-- Slarti
0
 

Author Comment

by:dkr1
ID: 1172890
Thanks ever so much. I haven't got it going yet, but it seems very promising, and should certainly do the trick. Thanks again,
Darrel.

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

759 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

21 Experts available now in Live!

Get 1:1 Help Now