MP3 Player

In this category you can exchange your programming questions and solutions.
Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

MP3 Player

Post: # 804Post Marco
Thu Jan 12, 2012 4:22 pm

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

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

MP3 Player

Post: # 805Post cvirus
Fri Jan 13, 2012 11:50 am

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?

fred
Posts: 54
Joined: Thu Apr 23, 2009 10:08 am

MP3 Player

Post: # 806Post fred
Sat Jan 14, 2012 11:12 am

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 :)

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

MP3 Player

Post: # 807Post cvirus
Sun Jan 15, 2012 1:41 pm

Nope, i must see what is going wrong with my s.o.

fred
Posts: 54
Joined: Thu Apr 23, 2009 10:08 am

MP3 Player

Post: # 808Post fred
Sun Jan 15, 2012 3:40 pm

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?

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

MP3 Player

Post: # 809Post cvirus
Wed Sep 12, 2012 3:49 pm

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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

MP3 Player

Post: # 810Post Marco
Fri Sep 14, 2012 8:23 pm

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"

saqmo
Posts: 9
Joined: Sat Sep 15, 2012 4:13 pm

MP3 Player

Post: # 811Post saqmo
Sat Sep 15, 2012 4:28 pm

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

Post Reply