Page 2 of 2

MP3 Player

Posted: Thu Jan 12, 2012 4:22 pm
by Marco
Hi, on my computer this program works. The only thing is i have to agree to run it because avg pops up, but i think the windows media player try to connect with internet is causing the problem. Sometimes that will happen. So if you have virus/firewall software installed it can cause a problem.
best regards

MP3 Player

Posted: Fri Jan 13, 2012 11:50 am
by cvirus
In my other machine doesn t work too, damm is there other way of doing this? ocx? 8-)

Or maybe is the path, i put my path like this:

c:somethingsomethingsomethingsoundsmymusic est.mp3

maybe the path is too long?

MP3 Player

Posted: Sat Jan 14, 2012 11:12 am
by fred
I found a problem when the path has spaces in it.
try this:
   mci.lpstrcommand="open "+chr$(34)+filename+chr$(34)+" type mpegvideo alias mysound"

btw., i removed the shortname :)

MP3 Player

Posted: Sun Jan 15, 2012 1:41 pm
by cvirus
Nope, i must see what is going wrong with my s.o.

MP3 Player

Posted: Sun Jan 15, 2012 3:40 pm
by fred
Hmm, strange, i copied your code and made the change for the open statement.
Beside this, i suppose after something has been played it must be closed too?

MP3 Player

Posted: Wed Sep 12, 2012 3:49 pm
by cvirus
Hello Admin, i?m back again to the mp3 app and i have a question.

Would it be possible to get the amout of time that the file have to play?

example:

time -> 2 minutes  the duration of the music

MP3 Player

Posted: Fri Sep 14, 2012 8:23 pm
by Marco
hi, figured it out, see the example below
best regards

``get duration of a mp3 file

Declare mciSendString as "mciSendStringA" of "winmm.dll"
  lpstrCommand As String
  lpstrReturnString As String byaddress
  uReturnLength As integer
  hwndCallback As integer
  result As integer
end declare

function GetMP3Duraton(filename as string) as integer
  mciSendString.lpstrcommand="Open " + FileName + " alias SoundFile"
  mciSendString.execute
  mciSendString.lpstrcommand="Set SoundFile time format milliseconds"
  mciSendString.execute
  mciSendString.uReturnLength=256
  mciSendString.lpstrcommand="Status SoundFile length"
  mciSendString.execute
  mciSendString.uReturnLength=0
  mciSendString.lpstrcommand="Close SoundFile"
  mciSendString.execute
  result=val(mciSendString.lpstrReturnString)
end function

``testing the function
dim d as integer
d=GetMP3Duraton("music.mp3")`` in miliseconds
d=d/1000
showmessage str$(d)+"seconds"

MP3 Player

Posted: Sat Sep 15, 2012 4:28 pm
by saqmo
Yeah i liked this,I think its a window problem,please install new window XP which is not complicated for use,and i think sound card problem also existed in your computer...please check the sound card