Solved

Mp3's using winmm.dll

Posted on 2001-06-11
4
671 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 61
Visual Studio 2005 text editor 10 48
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 61
Excel Automation VBA 19 102
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

756 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