## Vista Select Microphone

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

### Vista Select Microphone

I would like to add a function on the broadcaster app in the live audio demo.
Is it possible to list all input lines eg: line in, microphone, usb microphone etc, and then choose which
I have tried all the code relating to selecting microphone as recording source on the forum and can get none to work.
I have Line In, Microphone In, USB wireless microphone and a microphone attatched to a usb webcam.
Any help woulld be appreciated.
Thanks.
isi4h
Active Member

Posts: 5
Joined: November 14th, 2008, 11:03 pm

### Re: Vista Select Microphone

A few months ago I bought a USB microphone to fix the reported problems of TAudioMixer on Vista. Happily I came back home and attached the microphone to the USB port. Vista started installing the driver and finished it successfully. But the microphone was listed neither in Windows nor in any other application.

I thought maybe a restart fixes the problem, but I was wrong and started a nightmare. After restarting, both mouse and keyboard (USB) stopped working. Hopefully I had a PS2 keyboard, attached it and tried the restore point to take things bask to the original. Guess what? It didn't work. Finally after several hours searching on the net, I found out how to restore my mouse and keyboard. And of course since that time the USB microphone is out of the box.

Maybe on Windows 7 things get a bit better.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: Vista Select Microphone

Thanks for the quick response.
Hopefully, as you say windows 7 will be a lot better.
In the mean time is there a way to list and select the standard microphone and line-in on vista, if so how do i go about it.
Thanks
isi4h
Active Member

Posts: 5
Joined: November 14th, 2008, 11:03 pm

### Re: Vista Select Microphone

I hope you find the answer in the following post:
viewtopic.php?p=749#p749
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: Vista Select Microphone

Thanks I can now see all of my audio input lines in the listbox, however when i try to select one nothing happens.
Any Ideas, Here's my code:
Code: Select all
procedure TMainForm.FormCreate(Sender: TObject);var  I: Integer;begin  ListBox1.Items.Clear;  for I := Integer(WAVE_MAPPER) to LiveAudioRecorder.NumDevs - 1 do  begin  LiveAudioRecorder.DeviceID := I;  ListBox1.Items.Add(LiveAudioRecorder.DeviceName+' - Device ID '+inttostr(i));  end;end;procedure TMainForm.ChangeLineClick(Sender: TObject);begin   AudioMixer1.DestinationID:=1;   AudioMixer1.Master.SelectedLine := strtoint(edit1.Text);end

I enter the Device ID number into the editbox, and click my button but the recording line doesn't change, i've not got a clue why.
Should it work or have i done something dumb ?
Thanks
isi4h
Active Member

Posts: 5
Joined: November 14th, 2008, 11:03 pm

### Re: Vista Select Microphone

DeviceID and LineID are two different concepts.

Each device has a set of audio lines. We use the mixer to select the desired line of the device.

Your Wireless or WebCam microphone devices have only one audio line (usually is in this way), therefore setting LiveAudioRecorder.DeviceID to your selected microphone's ID should be enough.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: Vista Select Microphone

Thanks again for your help... I'm nearly there now.
Hopefully this wil be my last question.

I can get the recording devices id using this code

Code: Select all
procedure TMainForm.FormCreate(Sender: TObject);var  I: Integer;begin  ListBox1.Items.Clear;  for I := Integer(WAVE_MAPPER) to LiveAudioRecorder.NumDevs - 1 do  begin    LiveAudioRecorder.DeviceID := I;    ListBox1.Items.Add(LiveAudioRecorder.DeviceName+' - Device ID '+inttostr(i));      end;end;

And i can select which Device i want to record from using this code and entering the device id that i see in the above listbox
into an editbox

Code: Select all
procedure TMainForm.Button3Click(Sender: TObject);begin   LiveAudioRecorder.DeviceID := strtoint(edit1.Text);end;

What i would like to know is how do i change the recording volume for the selected device using a trackbar.
Thanks
isi4h
Active Member

Posts: 5
Joined: November 14th, 2008, 11:03 pm

### Re: Vista Select Microphone

Before Vista, you can use TAudioMixer to adjust controls of appropriate Mixer Line of the selected device.

For Vista, I have no idea. I didn't study about it yet.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Ok.