tags:

views:

1294

answers:

10
+8  A: 

What you're describing sounds like functionality programs like iTunes and Windows Media Player have had for years, and I would recommend just using one of those two programs. However, if you do want to play MP3s from .NET, a Google search found me this: http://www.codeproject.com/KB/audio-video/mp3player.aspx and this: http://www.codeproject.com/KB/audio-video/ManWMF.aspx

Also, if your wedding is in 4 days, this probably not the best idea. I wouldn't waste your time writing a media player. If you want it to be polished and idiot-proof, use iTunes. If you want to write a media player, do it after your wedding.

AriX
+3  A: 

Download MediaMonkey. You have better things to do a week before your wedding than write another MP3 player. MediaMonkey even has a DJ mode that locks your system so that your guests can't change your playlists.

Jamie Ide
+1  A: 

one word: zune

focus on getting married, dummy! :)

Jason
Don't call me a dummy.
Ronnie Overby
hey, you're the one getting married :D
Jason
Ohh..... Sick burn.
Ronnie Overby
A: 

You're reinventing the wheel. If "time is of the essence" just create the playlist files for your friend and put them all in the same directory. Label them 00 - Prelude, 01 - Processional, etc.

See this article on the M3U format for more info. You can list the files to play in this text based format. Or just use a media player such as winamp or windows media player to create the playlist files.

dss539
Dude. I'm trying to learn something I didn't already know.
Ronnie Overby
Software developers know that we have to give people what they need, not what they think they need. To prevent us from helping you properly, shorten your question.
dss539
+50 to dss539..
Andrew Coleson
+another 50 to dss539
Jason
+100 to dss539 .
Ronnie Overby
+4  A: 

By far the simplest and easiest solution here is to use the Windows Media Player COM control. This page offers a good guide to getting started with this approach. Just adjusting the volume level with a timer could create a fade in/out effect.

If you want full control over playback, then there's always the DirectShow.NET option, although this is probably overkill for you're task. What is more, it's quite painful to use unless you already have some amount of experience with the unmanaged DirectShow API. However, as I said, I would try to stay away from this if possible.

Edit: I have also now realised that the Microsoft.Xna.Framework.Media namespace could offer a nice managed solution for your task. It should certainly give more control than the WMP control (and is purely .NET rather than COM, as bonus). The only slight disadvantage is that it requires the XNA Framework 3.0 to be referenced.

Noldorin
A: 

I agree with most of the others here. I think you should really try to uncomplicate things by using another already build free option like itunes, Winamp or WMP. If you really want to learn something new, do this just for fun after when you won't be under so much pressure to make it work.

If, however you REALLY want to go through with this I think http://code.google.com/p/ffmpeg-sharp/ should do what you want.

mockedobject
I don't really know, but doesn't Ffmpeg seem like a bit of overkill to play a simple MP3 file?
AriX
A: 

Really interesting, but in my opinion you should use an already existent solution.

However, you can check these links:

Also the Windows media player com control should be a good option.

PS: I don't know if I can include a question in an answer, but How have you made that graphic?

Matias
What are you talking about? I drew it on paper. JK. Balsamiq Mockups is the software I used.
Ronnie Overby
A: 

I agree with the others, make several playlists and just load/play them with windows media player.

Rick Ratayczak
+1  A: 

As I said before,

"There are a lot of great suggestions on libraries to help with playing audio, and that's what I was really going for. I'm not really going to try to write the program. Thanks for the great responses."

Just for those who are curious: For my wedding, I used Winamp 5.whatever and saved playlists for different parts of the wedding and prefixing the filenames with 01, 02, ... so they would show up in order in the filesystem.

To normalize the audio I downloaded a plugin called RockSteady, which worked great. For fading on stop/pause/between songs, in Options -> Preferences -> Plugins -> Output -> Nullsoft DirectSound Output Configuration -> Fading Tab I set "on end of song" to 6000 ms and "on pause/stop" to 15000 ms. Then on the other tab I checked the "Logarithmic Fades" checkbox.

These settings made the audio sound nice and professional.

Ronnie Overby
Cool, I'm glad you got it to work out!
AriX
A: 

I wrapped mp3 decoder library and made it available for .net developers. You can find it here:

http://sourceforge.net/projects/mpg123net/

Included are the samples to convert mp3 file to PCM, and read ID3 tags.

You need something like waveOut wrapper, that I know it exists, and there you go!

Daniel Mošmondor