DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[WaveAudio] 2 soundcards

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
jhakroeze
Member


Joined: 05 Jun 2004
Posts: 2
Location: Renkum, Netherlands

PostPosted: 05/06/04 13:26    Post subject: [WaveAudio] 2 soundcards Reply with quote

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
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 360

PostPosted: 05/06/04 18:07    Post subject: Reply with quote

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:
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
Back to top
View user's profile Send e-mail Visit poster's website
jhakroeze
Member


Joined: 05 Jun 2004
Posts: 2
Location: Renkum, Netherlands

PostPosted: 06/06/04 11:54    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group