Solved

Detecting sound...

Posted on 1999-01-04
6
200 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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