how to play a audio/video file in a dialog window

hi,

i am the beginner of visual c++. My question has two parts. One is for video, the other is for audio.

For the video :

I would like to know how can i play a mpeg file in a dialog window. I find out that i can use some functions AVIxxxxx to play a ".avi" file. However, this cannot play the mpeg file.

For the audio:

i would like to know how can i play a mp3 file I find out that i can use Playsound function to play a ".wav" file but not a mp3 file.

i have tried to use the msdn web site, i could not find anything about it. DirectX(i don't know much about this) seems too complicated for this small problem. Could someone point me where to look

thank you!

smile




Answer this question

how to play a audio/video file in a dialog window

  • Ronie Rodriguez

     To play the file you pass the file name to the control's URL property.

     e.g.

       private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
         
      axWindowsMediaPlayer1->URL = "e:\\temp\\CrazyFrog.mp3";
      }

    I have tested it with an mp3 file and it works fine. 

     Cheers 

         Sahir


  • Troy L

    i was wondering how to insert windows media player into my form

  • Cest la vie

    thank you for your answer.
    i have found out that there is another example(remote skin) in
    http://windowssdk.msdn.microsoft.com/en-us/library/ms748742.aspx which does a very similiar thing.
    i think microsoft has too many solutions, however, you may need to know which one to use and how to use it well.

    smile


  • Chris Richner

     Ir Smile wrote:
     I would like to know how can i play a mpeg file in a dialog window. 

    You can insert Windows Media Player into your form as a control and make it  play files.


  • how to play a audio/video file in a dialog window