Solved

how do i play a mdi file from delphi?

Posted on 1998-02-15
5
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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