Solved

how do i play a mdi file from delphi?

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

19 Experts available now in Live!

Get 1:1 Help Now