We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,134 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Playing mp3 or wav by mousemove VB6

Alright, I'm at it again, trying another version of my game. Sorry, it's been a while since I've been here and while I tried checking to see if anyone else had asked about this, I didn't see anything that was to the point.

I'm trying to play an mp3 or wav file by simply mousing over a label, thus using the below:

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

But I'm confused as to how to what I play this with. I don't want a player, just a song to play. I'd like it as simple as possible as I'm not the brightest bulb. I've tried such things as below:

Private Sub Command1_Click()

Dim sCmd As String

sCmd = "mplayer.exe /Play c:your.mp3"

Shell sCmd, vbMinimizedNoFocus

End Sub

or this one:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1         '  play asynchronously

Private Sub Form_Load()
  Call sndPlaySound("C:\Windows\Media\Explode.wav", SND_ASYNC)
End Sub

But I'm getting errors all over the place. I'd really love some help please.

2
Contributors
1
Reply
1 Hour
Discussion Span
1 Year Ago
Last Updated
2
Views
venomocity
Newbie Poster
16 posts since Aug 2007
Reputation Points: 2
Solved Threads: 0
Skill Endorsements: 0

in the bottom example shouldn't you be using the alias sndPlaySoundA in your call

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0729 seconds using 2.64MB