Solved

Mp3's using winmm.dll

Posted on 2001-06-11
4
663 Views
Last Modified: 2007-11-27
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
Comment
Question by:codesucks
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6178880
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
 
LVL 6

Accepted Solution

by:
sharmon earned 100 total points
ID: 6179204
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
 

Author Comment

by:codesucks
ID: 6182564
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
 

Author Comment

by:codesucks
ID: 6183062
The link was to a very nice piece of well documented code that solved my query.
Cheers
codesucks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now