[WaveAudio] 2 soundcards

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

[WaveAudio] 2 soundcards

Postby jhakroeze » June 5th, 2004, 1:26 pm

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?
It's nice to be important, but it is more important to be nice
jhakroeze
Member
Member
 
Posts: 2
Joined: June 5th, 2004, 1:14 pm
Location: Renkum, Netherlands

Postby Kambiz » June 5th, 2004, 6:07 pm

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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby jhakroeze » June 6th, 2004, 11:54 am

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!
It's nice to be important, but it is more important to be nice
jhakroeze
Member
Member
 
Posts: 2
Joined: June 5th, 2004, 1:14 pm
Location: Renkum, Netherlands

Re: [WaveAudio] 2 soundcards

Postby drama22 » September 3rd, 2015, 2:03 pm

but why this always make the sound as sterio mix and cant talk from microphone ?
drama22
Member
Member
 
Posts: 3
Joined: June 21st, 2014, 8:08 pm

Re: [WaveAudio] 2 soundcards

Postby Kambiz » September 6th, 2015, 7:00 am

drama22, it depends on your device's capabilities.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest

cron