Solved

how do i play a mdi file from delphi?

Posted on 1998-02-15
5
201 Views
Last Modified: 2010-04-04
how do i play mdi and realaudio files from delphi
using memory files in the background
when u are still running applications...?
0
Comment
Question by:superboy
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
inter earned 0 total points
ID: 1359278
Why using memory files? Such a thing is done automaticaly by mci controller:

So put on your form a TMediaPlayer from the component pallette and do this:

...
  MediaPlayer1.FileName := 'c:\test.mid';
  MediaPlayer1.Open;
...

... // when you want to start play
  MediaPlayer1.Play;
...

// if you want to continuously play the same file override notify event

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
  case MediaPlayer1.Mode of
    mpStopped : begin
                  MediaPlayer1.Rewind;
                  MediaPlayer1.Play;
                end;
  end;
end;


Ok?
Igor
0
 

Author Comment

by:superboy
ID: 1359279
how do i check the end of the file being played?
i want to do a application that continues playing midi files
like a jukebox..so i need to check the end of a midi file

and i don't want the media player to show up while playing the file that's why i need to use memory files..
0
 
LVL 5

Expert Comment

by:inter
ID: 1359280
Do the following:(We do need to use media player if you do not want to give over 500 points. Directly using MCI is not easy)

1 - Place the mediaplayer on form and set its Visible to false
2 - Change Notify property of MP to true
3 - Then when an action is taken the procedure I gave above is called. For example when MP is stopped mpNotify is set as the MP.mode and notify event is called.

Not satisfied? Please ask more.
Igor
0
 

Author Comment

by:superboy
ID: 1359281
does the MCI player support realaudio files , i want to play
realaudio files too?can u show me how to do it?
0
 
LVL 5

Expert Comment

by:inter
ID: 1359282
If realaudio drivers (these are called CODECS and you can check them from ControlPanel->Multimedia->Devices->AudioCodecs tab). If there is a RealAudio codec there, then you can. Or you should install the CODEC yourself. The MCI can play the all files listed in Audio and Video codec sections includes. You should check the real audio site for CODECS. I do not deal with real audio but I am sure it has windows compatible codecs since Web browsers support it.

Igor
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question