|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Play media filesHi!
What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)? Thanks =) Kevin,
Reproduce? Or play, as the title suggests? If you want to play a file, just embed Windows Media Player in your app. -- Show quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "Kevin" <a@a.com> wrote in message news:eUoyHYWMIHA.4476@TK2MSFTNGP06.phx.gbl... > Hi! > What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)? > > Thanks =) > On 2007-11-27 18:26:03 -0800, "Kevin" <a@a.com> said: "Best" is extremely subjective. However, _a_ way to do it is to use > Hi! > What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)? the AudioVideoPlayback class in the managed DirectX library. Just add the necessary reference to your project, create an instance of the AudioVideoPlayback class, and you're good to go. It will create an ActiveMovie playback window for video playback (I forget if there's a way to set an existing window as the render target...there might be). Pete Just to elaborate, I believe that AudioVideoPlayback is a namespace (the
full namespace being the Microsoft.DirectX.AudioVideoPlayback namespace). The OP should be able to create an instance of the Video class in that namespace and then set the Owner property to the control that should play the video. -- - Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "Peter Duniho" <NpOeStPe***@NnOwSlPiAnMk.com> wrote in message news:2007112718564477923-NpOeStPeAdM@NnOwSlPiAnMkcom...Show quote > On 2007-11-27 18:26:03 -0800, "Kevin" <a@a.com> said: > >> Hi! >> What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)? > > "Best" is extremely subjective. However, _a_ way to do it is to use the > AudioVideoPlayback class in the managed DirectX library. > > Just add the necessary reference to your project, create an instance of > the AudioVideoPlayback class, and you're good to go. It will create an > ActiveMovie playback window for video playback (I forget if there's a way > to set an existing window as the render target...there might be). > > Pete > "Peter Duniho" <NpOeStPe***@NnOwSlPiAnMk.com> wrote in message news:2007112718564477923-NpOeStPeAdM@NnOwSlPiAnMkcom...>> What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)? cool ... thanks for posting that, Peter ...> "Best" is extremely subjective. However, _a_ way to do it is to use the > AudioVideoPlayback class in the managed DirectX library. > > Just add the necessary reference to your project, create an instance of > the AudioVideoPlayback class, and you're good to go. It will create an > ActiveMovie playback window for video playback (I forget if there's a way > to set an existing window as the render target...there might be). let me flesh it out a bit for those (like me) who didn't immediately get how to make it work: -- add the reference to Microsoft.DirectX -- (C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.dll) -- add the reference to Microsoft.DirectX.AudioVideoPlayback -- (C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.AudioVideoPlayback.dll) // using Microsoft.DirectX; using Microsoft.DirectX.AudioVideoPlayback; // video string movie = @"c:\GoneWithTheWind.mpeg"; Video av = new Video(movie); av.Owner = panel1; // can be ANY Windows.Forms control; Button works, eg av.Play(); // audio string song = @"c:\SongForYou.mp3"; Audio au = new Audio(song); au.Volume = -100; // amt of volume attenuation (-) au.Play(); On 2007-11-27 20:46:10 -0800, "Liz" <liz@tiredofspam.com> said: Thanks. Sorry, it's been awhile since I used it and all of that was > [...] > let me flesh it out a bit for those (like me) who didn't immediately get how > to make it work: off the top of my head. Thankfully between you and Nicholas I think we have a much more complete answer now. Much obliged. :) |
|||||||||||||||||||||||