Solved

Detecting sound...

Posted on 1999-01-04
6
205 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

837 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