BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to choose the audio device for TMediaPlayer when more th

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
Freddy Junior
Guest





PostPosted: Thu Oct 20, 2005 3:28 pm    Post subject: How to choose the audio device for TMediaPlayer when more th Reply with quote



I've found a way to choose the output device for the TMediaPlayer if one
has more than one sound card:
- uses MMSystem
- add these variables:
LocalWaveSetParm: TMCI_Wave_Set_Parms;
LocalError: Longint;
- with MediaPlayer1 do the following:
Close;
FileName:= 'C:...Sound.wav';
Open;
- at this point the device is opened, we must set the output device:
FillChar(LocalWaveSetParm, SizeOf(TMCI_Wave_Set_Parms), 0);
LocalWaveSetParm.wOutput:= 1; // <-- 0 is the first device, 1 the
second...
LocalError:= mciSendCommand(DeviceID, MCI_SET, MCI_WAVE_OUTPUT,
Longint(@LocalWaveSetParm));
- finally, play the sound:
Play;
end; // with MediaPlayer1

Unfortunally this works only with wave files. I need to adapt it for mp3.
Any Clues ?

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia 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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.