Freddy Junior Guest
|
Posted: Thu Oct 20, 2005 3:28 pm Post subject: How to choose the audio device for TMediaPlayer when more th |
|
|
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 ?
|
|