Board index » delphi » Delphi 1 MediaPlayer problem

Delphi 1 MediaPlayer problem

I'm trying to play a .WAV file in Delphi 1 using a MediaPlayer.  No sound is
coming out.

In the OnShow event for my form, I have done a MediaPlayer1.Open, then at a
certain time, I execute the following:

      MediaPlayer1.FileName := cRightAud;
      MediaPlayer1.Play;

cRightAud is set to a variable in the OnShow event.  I've already checked,
and there is a value in the variable.

Are there any other functions I can try to use?  I've tried  sndPlaySound(),
but I keep getting an Unknown identifier error when trying to compile.

Any ideas?

Thanks,
Jesse

 

Re:Delphi 1 MediaPlayer problem


In article <6ol7um$n...@news10.ispnews.com>,
  "Jesse Castleberry" <D...@iThink.net> wrote:

Quote
> I'm trying to play a .WAV file in Delphi 1 using a MediaPlayer.  No sound is
> coming out.

> In the OnShow event for my form, I have done a MediaPlayer1.Open, then at a
> certain time, I execute the following:

>       MediaPlayer1.FileName := cRightAud;
>       MediaPlayer1.Play;

> cRightAud is set to a variable in the OnShow event.  I've already checked,
> and there is a value in the variable.

> Are there any other functions I can try to use?  I've tried  sndPlaySound(),
> but I keep getting an Unknown identifier error when trying to compile.

> Any ideas?

> Thanks,
> Jesse

MEDIAPLAYER1.CLOSE;
MEDIAPLAYER1.DEVICETYPE:=DTWAVEAUDIO;
MEDIAPLAYER1.FILENAME:='C:\WIN95\MEDIA\DING.WAV';
MEDIAPLAYER1.OPEN;
MEDIAPLAYER1.PLAY;

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:Delphi 1 MediaPlayer problem


In article <6ol7um$n...@news10.ispnews.com>, "Jesse Castleberry"

Quote
<D...@iThink.net> writes:
>In the OnShow event for my form, I have done a MediaPlayer1.Open, then at a
>certain time, I execute the following:

>      MediaPlayer1.FileName := cRightAud;
>      MediaPlayer1.Play;

>cRightAud is set to a variable in the OnShow event.  I've already checked,
>and there is a value in the variable.

Delphi help on TMediaPlayer.FileName says :-
"The FileName property specifies the media file to be opened by the Open
method, or the file to save by the Save method."

Note the " . . . to be opened . . .". In other words, set Filename, set
DeviceType, set DeviceID, then call Open, then call Play.

Quote
>Are there any other functions I can try to use?  I've tried  sndPlaySound(),
>but I keep getting an Unknown identifier error when trying to compile.

You've got to put MMSystem in your uses clause. The best help is in the Delphi
1 MMSystem.hlp, and thats not exciting. Doing a Search | Find menu selection
and entering some useful words, and then using the back and forward buttons
reveals some things.

Alan Lloyd
alangll...@aol.com

Other Threads