"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote 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.AudioVideoPlayba ck.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();