Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

ngogiatuong

@ngogiatuong
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Windows Media Player - Play MP3.
    N ngogiatuong

    Thanks Afzaal Ahmad Zeeshan! my playlist size is more than 3 (often 10). and I user WMPLib. I'm trying to find out the problem but still not find!!!

    C# help

  • Windows Media Player - Play MP3.
    N ngogiatuong

    Dear all I create a method to play mp3 base on Text input. I create a playlist and import it to player. but the problem is that, the player plays only 3 files. (and i debugged and found that attributeCount always=3). Please help for this case. Below is my code:

    private void PlayMP3()
    {
    try
    {
    string strLP = this.textBox1.Text.Trim();
    string strPath = Application.StartupPath;
    WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
    WMPLib.IWMPPlaylist myplaylist = player.playlistCollection.newPlaylist("myplaylist");
    //Clear playlist before create new one.
    myplaylist.clear();
    //Create new playlist
    foreach (char c in strLP)
    {
    //read
    string strFileName = "raw\\" + string.Concat(c, ".mp3");
    string strFileLocation = Path.Combine(strPath, strFileName);
    WMPLib.IWMPMedia media = player.newMedia(strFileLocation);
    myplaylist.appendItem(media);
    }
    player.playlistCollection.importPlaylist(myplaylist);
    player.currentPlaylist = myplaylist;
    //Play
    player.controls.play();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    
    C# help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups