| View previous topic :: View next topic |
| Author |
Message |
jhakroeze Member
Joined: 05 Jun 2004 Posts: 2 Location: Renkum, Netherlands
|
Posted: 05/06/04 13:26 Post subject: [WaveAudio] 2 soundcards |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 362
|
Posted: 05/06/04 18:07 Post subject: |
|
|
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 |
|
 |
jhakroeze Member
Joined: 05 Jun 2004 Posts: 2 Location: Renkum, Netherlands
|
Posted: 06/06/04 11:54 Post subject: |
|
|
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 |
|
 |
|