Click here to Skip to main content
   

C#

 
AnswerRe: need full tutorial for making audio player in C# PinmvpEddy Vluggen21-Feb-13 9:37 
AnswerRe: need full tutorial for making audio player in C# PinmvpAbhinav S21-Feb-13 16:36 
AnswerRe: need full tutorial for making audio player in C# PinprofessionalAmir Mohammad Nasrollahi29-Jul-13 22:53 
Questionsimple audio player in C# PinmemberChaman Saini21-Feb-13 6:07 
Hello
      I wanna ask that what is the reason that I am not able to play the mp3 file.     
my whole code for the "class" for simple audio player is as below:-
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
 
namespace myplayer
{
      class Player
      {
            [DllImport("winmm.dll")]
            private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwndCallback);
 
            public void open(string file)
            {
                  string command = "open\"" + file + "\" type mpegvideo alias MediaFile";
                  mciSendString(command, null, 0, 0);
            }
 
            public void play()
            {
                  string command = "play MediaFile";
                  mciSendString(command, null, 0,0);
            }
 
            public void stop()
            {
                  string command = "stop MediaFile";
                  mciSendString(command, null, 0, 0);
 
                  command = "close MediaFile";
                  mciSendString(command, null, 0, 0);
                 
            }
 
      }
}
AnswerRe: simple audio player in C# PinprotectorPete O'Hanlon21-Feb-13 6:35 
GeneralRe: simple audio player in C# PinmemberChaman Saini21-Feb-13 6:50 
GeneralRe: simple audio player in C# PinmvpDave Kreskowiak21-Feb-13 7:04 
GeneralRe: simple audio player in C# PinmemberChaman Saini21-Feb-13 7:10 
GeneralRe: simple audio player in C# PinmemberChaman Saini21-Feb-13 7:14 
GeneralRe: simple audio player in C# PinmvpDave Kreskowiak21-Feb-13 13:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 29 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid