Page 1 of 1

[WaveAudio] 2 soundcards

PostPosted: June 5th, 2004, 1:26 pm
by jhakroeze
Hi there,

I am working on an application that can record 2 different audiostreams to two different wave-files. Therefore i have installed 2 audio cards and i am using the component WaveAudio Version 1.52.

I have assigned AudioMixer0 to MixerId=0 and the second AudioMixer1 to MixerId=1 in the code, since one cannot set those at runtime. Besides those 2 components i am using WaveStorage (twice) and the StockAudioRecorder (twice). I have connected the WaveStorage and the StockAudioRecorder to eachother, but i cannot connect one of those components to a Mixer. This is where it goes wrong in my opinion, because i get an error as soon as i try to record the second audiostream. "Device is busy or something like that".

So, is there a workaround for this or am I doing something wrong?

PostPosted: June 5th, 2004, 6:07 pm
by Kambiz
Hi,

You have to use DeviceID property of the component to select the proper device on one of the mixers. Unfortunately, there's no straight way to find DeviceID's of a mixer. However, using the similarity between name of the Mixer and name of the Device you can find the right Device.

The following code lists the available input/output devices in two listboxes.

Code: Select all
uses
  mmSystem;

procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
begin
  // Lists the available input devices in the first ListBox
  ListBox1.Items.Clear;
  for I := Integer(WAVE_MAPPER) to AudioRecorder1.NumDevs - 1 do
  begin
    AudioRecorder1.DeviceID := I;
    ListBox1.Items.Add(AudioRecorder1.DeviceName);
  end;
  // Lists the available output devices in the second ListBox
  ListBox2.Items.Clear;
  for I := Integer(WAVE_MAPPER) to AudioPlayer1.NumDevs - 1 do
  begin
    AudioPlayer1.DeviceID := I;
    ListBox2.Items.Add(AudioPlayer1.DeviceName);
  end;
end;

By the way, the default value for DeviceID is WAVE_MAPPER (Microsoft Sound Mapper).

Kambiz

PostPosted: June 6th, 2004, 11:54 am
by jhakroeze
It's working! Great, thanks for the quick response. I got confused with the MixerId. I did not look good enough in the documentation to see that there was a DeviceID as well.

Thanks again!

Re: [WaveAudio] 2 soundcards

PostPosted: September 3rd, 2015, 2:03 pm
by drama22
but why this always make the sound as sterio mix and cant talk from microphone ?

Re: [WaveAudio] 2 soundcards

PostPosted: September 6th, 2015, 7:00 am
by Kambiz
drama22, it depends on your device's capabilities.