Dude, if you want help, you'll need to ask specific questions.
How far along are you in your media player project?
What would you like to do, but are having trouble with?
Printable View
Dude, if you want help, you'll need to ask specific questions.
How far along are you in your media player project?
What would you like to do, but are having trouble with?
Oh. My apologies. I wish to create a Media Player from scratch (meaning basically, everything has to be built). I can design the interface. But I have no idea about how to start the coding. Any suggestions???
Any suggestions at all???
What do you mean "design the interface"?
Does that mean you can design it on paper or in code with the Winforms editor?
I gave you pretty good advice before.
Start with just designing the UI in the WinForm designer view. Put _BASIC_ controls on your form (Play, Stop). Add event handlers for those buttons. Make the click event for Play start a hard coded song. Make the Stop event stop the song.
Create the UI, and hook up the backend behind it.
Yes, I know. I can prepare the interface with the events and stuff within no time. But I dont know what to write in the code! Do I need to create an object of System.Media.SoundPlayer??? or do i need to create some kind of file reader??? and then how will I Play, Pause or Stop a particular file??? I have no idea!!!
Thats why I wanted some help with the code. In the code I don't know what to start with!! :P
This page might help you: http://www.daniweb.com/code/snippet217151.html#
You could just copy the PlayMP3(string Location) function from that page. Then you can have your "Play"-button call that function.
That'd be an app that lets you play a certain song. Which is pretty useless but gets you started. :) (I hope)Code:public partial class Form1 : Form
{
public static void PlayMP3(String Location)
{
music = new Microsoft.DirectX.AudioVideoPlayback.Audio(Location);
music.Play();
}
private void btnPLAY_Click(object sender, EventArgs e)
{
// This is where you are taken if you double click the button in the WinForm editor.
PlayMP3("C:\\my_music_folder\\a_great_song.mp3");
}
}
Some advice:
1) When you're referring to a user interface, don't use the term "interface" in conversations. "interface" in software development refers to a contract that classes can choose to abide by, and implement. Use the term "user interface", or "UI" instead.
2) There are a plethora of web pages out there describing how to build media players in C#. The question to YOU is, do you want to create one from scratch or do you want to use a bare bone control that gives you all the necessities needed to start making one.
You need to answer that question first, then we can guide you further. I personally suggest creating your own from scratch... There's really only a couple of buttons in a basic media player, and a list of songs to choose, or a file browser dialog... Like I said before... Create the UI! Then, once you have basic buttons on there, research each one and how you would hook it up to do what it should. IE: How to make the Play button start playing a song...
Thanks dude!! :)
Actually, your explanation helped me better in understanding, rather than the explanation in the link that you gave.
And I have a small problem. VC# 2008 shows error in "Microsoft.DirectX.AudioVideoPlayback.Audio(Location)"
by saying that there's no reference. I tried searching for the reference but all I could find was "
"DirectX 7 for Visual Studio Library" & "DirectX 8 for Visual Studio Library". And neither of them have helped. Where can I find the reference???
Did you install DirectX SDK? It's included in the binaries with that I'm assuming.
what online install lol?. you should google this, i did and found a lot of solutions.
http://www.microsoft.com/express/vcsharp/#webInstall
visit this link. this is what you call an online install.