Home All Groups Group Topic Archive Search About
Author
28 Nov 2007 2:26 AM
Kevin
Hi!
What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)?

Thanks =)

Author
28 Nov 2007 2:52 AM
Nicholas Paldino [.NET/C# MVP]
Kevin,

    Reproduce?  Or play, as the title suggests?  If you want to play a file,
just embed Windows Media Player in your app.


--
          - Nicholas Paldino [.NET/C# MVP]
          - mvp@spam.guard.caspershouse.com

Show quote
"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 =)
>
Author
28 Nov 2007 2:56 AM
Peter Duniho
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
Author
28 Nov 2007 3:25 AM
Nicholas Paldino [.NET/C# MVP]
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
>
Author
28 Nov 2007 4:46 AM
Liz
"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)?

> "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).

cool ... thanks for posting that, Peter ...

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();
Author
28 Nov 2007 5:06 AM
Peter Duniho
On 2007-11-27 20:46:10 -0800, "Liz" <liz@tiredofspam.com> said:

> [...]
> let me flesh it out a bit for those (like me) who didn't immediately get how
> to make it work:

Thanks.  Sorry, it's been awhile since I used it and all of that was
off the top of my head.  Thankfully between you and Nicholas I think we
have a much more complete answer now.  Much obliged.  :)

AddThis Social Bookmark Button