Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

Sound...microphone...MCI

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
dkr1
Asked:
dkr1
1 Solution
 
SlartiCommented:
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
 
dkr1Author Commented:
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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now