Solved

how do i play a mdi file from delphi?

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

Independent Software Vendors: 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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 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