[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 682
  • Last Modified:

Mp3's using winmm.dll

I can play an mp3 sending a string to the winmm.dll
But how can you test if the song has finished before sending another song?
0
codesucks
Asked:
codesucks
  • 2
1 Solution
 
Maxim10553Commented:
never used winmm.dll, however you could use the windows media player. here is some sample code, just make sure you go to components and add windows media player.

Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)

If OldState = 2 Then
  'play a song, because there is no song playing
  MediaPlayer1.Open ("C:\my music\amarillobymorning.mp3")
End If

End Sub
0
 
sharmonCommented:
You know how to send the string to play it, so why don't you just send the string to get the current mode and position.  Where mp3 is the alias of your open connection to winmm.dll

"status mp3 position"
"status mp3 mode"

If you want a good example of how to do everything, see this link...

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=1&txtCodeId=9783
0
 
codesucksAuthor Commented:
Maxim10553,
I am not keen on using windows media player.... too resource hungry.

Sharmon,
Thanks for the link, have downloaded the code and will investigate.

Regards
codesucks
0
 
codesucksAuthor Commented:
The link was to a very nice piece of well documented code that solved my query.
Cheers
codesucks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now