Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to select a sound card for the TMediaPlayer when two sound cards are install Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
30-Aug-02
Category
Multimedia
Language
Delphi 2.x
Views
152
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to select a sound card for the TMediaPlayer when two sound cards are installed

Answer:

1   procedure send(name: string; out: integer; );
2   var
3     lpset: MCI_WAVE_SET_PARMS;
4   begin
5     with MediaPlayer1 do
6     begin
7       try
8         filename := name;
9         Open;
10        lpset.wOutput := out; {number of the sound card. zero through number of 
11  outputs-1}
12        mciSendCommand(DeviceID, MCI_SET, MCI_WAVE_OUTPUT, longint(@lpset));
13        Play;
14      except
15        on EMCIDeviceError do
16          statusbar := '[OUTPUT FAILED]:' + IntToStr(out);
17      else
18        ShowMessage(Exception(ExceptObject).message);
19      end;
20    end;
21  end;
22  
23  
24  Note that for MIDI files the right command to pass to MCI is related to the 
25  sequencer port, not to the wave port, so the following adjustments have to be made:
26  
27  
28  var
29    lpset: MCI_SEQ_SET_PARMS;
30  
31    {number of the sound card. zero thru number of outputs-1}
32    lpset.dwPort := mydeviceid;
33    mciSendCommand(DeviceID, MCI_SET, MCI_SEQ_SET_PORT, longint(@lpset));


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC