c# - Windows Phone Dev: Play internal mp3 files with winmm.dll -
I need a help in displaying MP3 player files. I search the internet and I think If I need to take an MP3 file from an external directory then just use winmm.dll. I need to modify it for the internal directory of my app.
We show the code:
I create MP3 player in this way:
Class MP3 Player: IDisposable [ DllImport ("winmm.dll")] Private static extern lengthy MCAsted string (string lpstr comand, stingbuilder LPstrReturnString, intraTransport lang, int HWDD callback); Public Zero open (string file) {const string FORMAT = @ "Open" "{0}" "Type mpeg video nickname memabs"; String command = string.format (format, file); MciSendString (command, blank, 0, 0); } Public Zero Play () {string command = "play mymp3"; MciSendString (command, blank, 0, 0); } Public Zero Stop () {string command = "Stop MyMp3"; MciSendString (command, blank, 0, 0); } Public Zero () {string command = "Turn off MyMp3"; MciSendString (command, blank, 0, 0); } Public Double Duration () {string command = "Status MyMp3 Length"; Double bho = mciSendString (command, blank, 0, 0); Return bio; } and call to open the internal file here:
var soundfile = "property / audio / myaudio.mp3"; Private mp3 player _mp3player = new mp3 player (); _mp3player.open (soundfile); _mp3player.play (); This gives me an error when opening the file, so I'm sure the problem is in the path that I send to the class. I tried some versions but nobody works and I can not get any help on the internet
Thank you very much to all of you.
Sorry for my very bad english
According to Windows Mobile, all wave audio functions are implemented in 'coredll.dll'. Use this DLL instead of 'winmm.dll'.
Comments
Post a Comment