Solved

how do i play a mdi file from delphi?

Posted on 1998-02-15
5
198 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now