|
-
Feb 21st, 2000, 06:03 AM
#1
Thread Starter
Registered User
Hello,
I'm having a problem i'm using VB 6 and i want it so when the user clicks on a commandbutton i want it to play a "waveAudio"
this is the Code i have....and it only plays once....and when i click it again...it won't work ....nothing happens....
[]code[/]
Private Sub Command1_Click()
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "WaveAudio"
MMControl1.FileName = "C:\unzipped\dopewars\uhoh.wav"
MMControl1.Command = "Open"
MMControl1.Command = "Play"
thats thats it! help if u can thanks for your time! bye!
-
Feb 21st, 2000, 06:16 AM
#2
You should close the sound if you want to open it again:
Code:
With MMControl1
.Notify = False
.Wait = True
.Shareable = False
.DeviceType = "WaveAudio"
.FileName = "C:\unzipped\dopewars\uhoh.wav"
.Command = "Open"
.Command = "Play"
.Command = "Close"
End With
------------------
Serge
Senior Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 02-21-2000).]
-
Feb 21st, 2000, 06:35 AM
#3
Thread Starter
Registered User
when i add the mmcontrol1.Command = "CLose" it wont' even play the file....if i take it out....it plays the file once....and thats it! Do u know how to fix it?
-
Feb 21st, 2000, 06:44 AM
#4
Frenzied Member
I don't know the answer to your problem (I've never used an MMControl), but you can play .wav files using the API function PlaySound. Visit this site for details on VB implemetation:
http://www.vbapi.com/ref/p/playsound.html
Also, to put code into your messages on this site, you almost had it right. Use...
{code}
Your
code
here
{/code}
except replace the curly braces with square brakets [] around the "code" and "/code" statements.
~seaweed
-
Feb 21st, 2000, 06:46 AM
#5
Try this:
Code:
With MMControl1
.Command = "Open"
.Notify = True
.Wait = True
.Shareable = False
.DeviceType = "WaveAudio"
.FileName = "C:\winnt\media\office97\Whoosh.wav"
.Command = "Play"
.Command = "Close"
End With
------------------
Serge
Senior Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
-
Feb 21st, 2000, 06:49 AM
#6
Thread Starter
Registered User
Alright thanks for the tip! and the information!
------------------
Cory Sanchez
Young Student
ICQ#: 18640149
-
Feb 21st, 2000, 06:53 AM
#7
Thread Starter
Registered User
That one didn't work either....everyone i asked doesn't know how to make it so u can click on it and for it too keep playing ....they all said for me to use an API and i suck with them heh but i'll try
------------------
Cory Sanchez
Young Student
ICQ#: 18640149
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|