Solved

Detecting sound...

Posted on 1999-01-04
6
186 Views
Last Modified: 2010-04-04
Hi, I have to write an application simmilar to internet phone or netscape's live conference.  One speaks through the microphone, and the voice is heard in another computer some place.

I haven't found the way to detect if the microphone is receiving noice, can anyone tell me how to detect this?

I will raise the points if some one tells me or gives me the source of an app that does the task i'm trying to develope.

Thank

Paul

0
Comment
Question by:pbk
6 Comments
 
LVL 7

Expert Comment

by:jconde
ID: 1354574
I once saw an application that did that....let me see if I can find it again...
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1354575
You'll probably need to use the mixer* functions. Unfortunately they're quite complicated. Perhaps this will help you to start digging:

http://www.wilsonc.demon.co.uk/delphi.htm

Regards, Madshi.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1354576
Maybe this one can help? http://www2.sienanet.it/users/guido/TMsgVoc.htm#TMsgVoc Version 1.1
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:pbk
ID: 1354577
Hi!

ZifNab, that component doesn't work for me....it's for use with a modem, and it's quite complicated ;(

Madashi, The url you sent me has something that might be usefull to me, but I have a problem:  The component called Multimedia Level Data and Meter has everything I need, but the devices vary accroding to each sound/multimedia card.  Is there any way I can specify what devices to use for each computer?

Thank you,

Paul
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1354578
You're right. The devices really vary accross each sound card. You'll have to enumerate the devices to find the right one for you. That's quite difficult, I know.
Perhaps this helps you:

var booleanToChar : array [boolean] of string = ('-','+');
procedure ShowMixerControls;
var mix     : integer;
    mixCaps : TMixerCaps;
    ml      : TMixerLine;
    c1      : cardinal;
    str     : string;
 function ContainsControl(ml: TMixerLine; ct: cardinal) : boolean;
 var mlc : TMixerLineControls;
     mc  : TMixerControl;
 begin
   with mlc do begin
     cbStruct:=SizeOf(mlc);
     dwLineID:=ml.dwLineID; cControls:=ml.cControls;
     dwControlType:=ct;
     cbmxctrl:=SizeOf(mc); pamxctrl:=@mc;
   end;
   result:=mixerGetLineControls(mix,@mlc,MIXER_GETLINECONTROLSF_ONEBYTYPE)=MMSYSERR_NOERROR;
 end;
 procedure EnumMixerSources(dstComponentType: cardinal);
 var i1      : cardinal;
     s1      : string;
     ml1,ml2 : TMixerLine;
 begin
   with ml1 do begin
     cbStruct:=SizeOf(ml1); dwComponentType:=dstComponentType;
   end;
   if mixerGetLineInfo(mix,@ml1,MIXER_GETLINEINFOF_COMPONENTTYPE)<>MMSYSERR_NOERROR then exit;
   s1:=ml1.szName; while length(s1)<25 do s1:=s1+' ';
   str:=str+Copy(s1,1,25)+'  ';
   str:=str+booleanToChar[ContainsControl(ml1,MIXERCONTROL_CONTROLTYPE_VOLUME   )]+'    ';
   str:=str+booleanToChar[ContainsControl(ml1,MIXERCONTROL_CONTROLTYPE_MUTE     )]+'    ';
   str:=str+booleanToChar[ContainsControl(ml1,MIXERCONTROL_CONTROLTYPE_PEAKMETER)]+'    ';
   str:=str+booleanToChar[ContainsControl(ml1,MIXERCONTROL_CONTROLTYPE_MUX      )]+'    ';
   str:=str+booleanToChar[ContainsControl(ml1,MIXERCONTROL_CONTROLTYPE_MIXER    )]+'    '#$D#$A;
   for i1:=0 to ml1.cConnections-1 do begin
     with ml2 do begin
       cbStruct:=SizeOf(ml2); dwDestination:=ml1.dwDestination; dwSource:=i1;
     end;
     if mixerGetLineInfo(mix,@ml2,MIXER_GETLINEINFOF_SOURCE)<>MMSYSERR_NOERROR then exit;
     s1:='  '+ml2.szName; while length(s1)<25 do s1:=s1+' ';
     str:=str+Copy(s1,1,25)+'  ';
     str:=str+booleanToChar[ContainsControl(ml2,MIXERCONTROL_CONTROLTYPE_VOLUME   )]+'    ';
     str:=str+booleanToChar[ContainsControl(ml2,MIXERCONTROL_CONTROLTYPE_MUTE     )]+'    ';
     str:=str+booleanToChar[ContainsControl(ml2,MIXERCONTROL_CONTROLTYPE_PEAKMETER)]+#$D#$A;
   end;
 end;
begin
  if (mixerGetNumDevs>0) and (mixerOpen(@mix,0,0,0,MIXER_OBJECTF_MIXER)=MMSYSERR_NOERROR) and
     (mixerGetDevCaps(0,@mixCaps,sizeOf(mixCaps))=MMSYSERR_NOERROR) then
    try
      str:='Name                       Vol. Mute Peak Mux Mixer'#$D#$A;
      ml.cbStruct:=sizeOf(ml);
      for c1:=0 to mixCaps.cDestinations-1 do begin
        ml.dwDestination:=c1;
        mixerGetLineInfo(mix,@ml,MIXER_GETLINEINFOF_DESTINATION);
        EnumMixerSources(ml.dwComponentType);
        //MIXERLINE_COMPONENTTYPE_DST_SPEAKERS);
        //EnumMixerSources(MIXERLINE_COMPONENTTYPE_DST_WAVEIN);
      end;
      MessageBox(0,PChar(str),'Mixer',0);
    finally mixerClose(mix) end;
end;

Regards, Madshi.
0
 

Accepted Solution

by:
_art_ earned 50 total points
ID: 1354579
http://www.cog.brown.edu/~mertus/

get there TAudioIO freeware component. Demos are there...
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

16 Experts available now in Live!

Get 1:1 Help Now