Solved

Mp3's using winmm.dll

Posted on 2001-06-11
4
665 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

919 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

17 Experts available now in Live!

Get 1:1 Help Now