473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Play media files

Hi!
What is the best way to reproduce media files (mp3, wav, wma, wmv, etc)?

Thanks =)
Nov 28 '07 #1
4 8030
On 2007-11-27 18:26:03 -0800, "Kevin" <a@a.comsaid:
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

Nov 28 '07 #2
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]
- mv*@spam.guard.caspershouse.com

"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:2007112718564477923-NpOeStPeAdM@NnOwSlPiAnMkcom...
On 2007-11-27 18:26:03 -0800, "Kevin" <a@a.comsaid:
>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
Nov 28 '07 #3
Liz

"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();
Nov 28 '07 #4
On 2007-11-27 20:46:10 -0800, "Liz" <li*@tiredofspam.comsaid:
[...]
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. :)

Nov 28 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: The Road To Utopia | last post by:
Here's one for the trolls...a common jibe from them is setting up audio/video hardware under linux. Ok, true story: at work today, someone asked me if I could tell him why his XP Home would play...
0
by: charbonneau | last post by:
I need to develop a WinForm application which can play .mp3 music files stored on another machine on a LAN. This applicaiton needs to run on servaral different client machines at the same time. I...
22
by: MLH | last post by:
I have some audio help files that play fine from within Access 97 and Access 2.0. Both are running on a Windows XP box. But I do not know what program plays the files. If I click Start, Run and...
3
by: felecha | last post by:
I can get Windows Media Player to start, and play a wav file just fine using a command line "C:\Program Files\Windows Media Player\wmplayer.exe" c:\Temp\temp.wav But I want it to come up from...
3
by: Jared | last post by:
I'm using the first code sample below to play WAV files stored as embedded resources. For some reason I *occasionally* get scratching and crackling. I'm using a couple WAVs that ship with...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
2
by: rodchar | last post by:
hey all, how do i play media files on my web page? thanks, rodchar
9
by: ZikO | last post by:
Hi. I'm struggle with playing a wav in Visual Basic. First I wanted to use My.Computer.Audio.Play() method but I realized it's not working if I want to have music in background. I found in...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.