CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2002
    Location
    Ukraine
    Posts
    228

    Question How to play MP3 files using C#?

    Hi,

    There is a question:
    How to play MP3 files using C#?

    Thanks,
    Alex.

  2. #2
    Join Date
    Jul 1999
    Location
    Malmö, Sweden
    Posts
    126

    Re: How to play MP3 files using C#?

    Well, one way to find out is to do a search on 'MP3' here on CG. :-)

    Another way, if you have access to Windows Media Player, is to right-click on your toolbox, select 'Choose Items...' and select the Windows Media Player ActiveX component from the COM Components tab, and use that to play your MP3 file!
    A third way is to search your favorite search engine for 'MP3 playback', which in my case would yield (among tons of hits) this hit: http://www.gamedev.net/reference/art...rticle2053.asp. This solution uses the MCI, which is also to be found if you search for MP3 right here at CG: http://www.codeguru.com/forum/showthread.php?t=213820

    Now, if you don't want to use an ActiveX component, or MCI, or a third party component/assembly/whatever, then I can only advice you (as the 4th way) to read and playback (somehow) the MP3 file format yourself: http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm

    Oh, this is so fun , I am currently listening to Debelah Morgan - Dance With Me.mp3 using the 2nd way, without writing a single line of code. (Ofcourse I have the original CD, and decoded the song in MP3 format only for backup purpose :-) (yeah right...)

    HTH!

  3. #3
    Join Date
    Sep 2004
    Location
    Tehran(Ir)
    Posts
    469

    Re: How to play MP3 files using C#?

    the easiest way is,
    Code:
    System.Diagnostics.Process.Start("[Path].mp3");
    it opens the appropriate player which is determined on the local machine(ususally Media Player) and play the music.

  4. #4
    Join Date
    May 2002
    Location
    Ukraine
    Posts
    228

    Cool Re: How to play MP3 files using C#?

    the problem is: I want to contro volume,
    background music etc.
    I want to have much more control.

    Thanks,
    Alex.

  5. #5
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Re: How to play MP3 files using C#?

    use windows media player. it's nicely intergrated and you can control it too...

    right click toolbox and click customize ... select COM and find media Player and say Ok.

    now drag the player from toolbox on to your form and off you go programming...
    If you think you CAN, you can, If you think you CAN'T, you are probably right.

    Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.

  6. #6
    Join Date
    May 2002
    Location
    Ukraine
    Posts
    228

    Re: How to play MP3 files using C#?

    Thorry, I forgot say that I wan to play mp3 a Pocket PC
    and it must not be a standard player.
    In a Desctop PC I can all and much more using C++/MFC.
    There is such instrument as DirectShow.
    I used it.
    But I do not know how you low functions in a Pocket PC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured