WindozeNT wrote:
Not from me.
I'm a VB6er.
Maybe the script is still the same in VB 2008.
Offline
Add this procedure call to support playing WAV sound files:
Option Explicit 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 sounds asynchronously
Alright, now create a Timer on the form to play a sound. Set the interval to the length of the song in milliseconds. Then in the Form's Load event, type this in (assuming the file is C:\Sound.wav and the timer name is Timer1):
Call sndPlaySound("C:\Sound.wav", SND_ASYNC)
Timer1.Enabled = TrueIn the Timer's event, put this in:
Call sndPlaySound("C:\Sound.wav", SND_ASYNC)Get the sound to stop with this:
On Error Resume Next ' Enable error catching if it isn't already (required)
Call sndPlaySound("Null", SND_ASYNC) ' Stop Playing
On Error GoTo 0 ' Disable error catching (optional)Hope that helps!
WindozeNT
P.S. That is VB6 code so it might not work.
Last edited by WindozeNT (2011-02-18 17:37:58)
Offline
WindozeNT wrote:
Add this procedure call to support playing WAV sound files:
Code:
Option Explicit 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 sounds asynchronouslyAlright, now create a Timer on the form to play a sound. Set the interval to the length of the song in milliseconds. Then in the Form's Load event, type this in (assuming the file is C:\Sound.wav and the timer name is Timer1):
Code:
Call sndPlaySound("C:\Sound.wav", SND_ASYNC) Timer1.Enabled = TrueIn the Timer's event, put this in:
Code:
Call sndPlaySound("C:\Sound.wav", SND_ASYNC)Get the sound to stop with this:
Code:
On Error Resume Next ' Enable error catching if it isn't already (required) Call sndPlaySound("Null", SND_ASYNC) ' Stop Playing On Error GoTo 0 ' Disable error catching (optional)Hope that helps!
WindozeNT
P.S. That is VB6 code so it might not work.
Got errors SIGH.
Offline
WindozeNT wrote:
^ Where? What error did it say?
ERRORS:
Error 1 Statement is not valid inside a method. C:\Users\Thebuilderddd\AppData\Local\Temporary Projects\Bill Nye Forever\Form1.vb 4 9 Bill Nye Forever
Error 2 Keyword is not valid as an identifier. C:\Users\Thebuilderddd\AppData\Local\Temporary Projects\Bill Nye Forever\Form1.vb 6 9 Bill Nye Forever
Error 3 'Private' is not valid on a local constant declaration. C:\Users\Thebuilderddd\AppData\Local\Temporary Projects\Bill Nye Forever\Form1.vb 7 9 Bill Nye Forever
Offline
WindozeNT wrote:
bumpz
What does bump mean?
Offline
thebuilderdd wrote:
WindozeNT wrote:
bumpz
What does bump mean?
bring up my post
FMI wiki it.
Offline
werdna123 wrote:
thebuilderdd wrote:
WindozeNT wrote:
bumpz
What does bump mean?
bring up my post
FMI wiki it.
I can't find it.
Offline
WindozeNT wrote:
So did the sample work?
No, it just gave me a new thing ith code.
Offline
WindozeNT wrote:
^ ????
It opened in a new file with just coding.
Offline
What can I do for my next app?
Offline
Check out the website!
Last edited by thebuilderdd (2011-02-28 19:20:36)
Offline
I will get Vb 2010 full and recompile!
Offline
Bumpz!
Offline
Bumpz!
Offline
WindozeNT wrote:
thebuilderdd wrote:
WindozeNT wrote:
Just to make sure -- Are you copying me?
Errr.... No. well your making Fakera1n, I am making fakepois0n (Just so we are the same) and Notepad me! Was really one of my first VB 2008 apps, so no I am NOT copying you! Maybe we can Hamachi together to work with each other.
Perhaps... But ditch MediaFire and use something like Tiny Upload. I refuse to download from MF.
I'd also ditch Tiny Upload; I now use 4shared to upload my PowerPoint files.
Offline
rdococ wrote:
WindozeNT wrote:
thebuilderdd wrote:
Errr.... No. well your making Fakera1n, I am making fakepois0n (Just so we are the same) and Notepad me! Was really one of my first VB 2008 apps, so no I am NOT copying you! Maybe we can Hamachi together to work with each other.Perhaps... But ditch MediaFire and use something like Tiny Upload. I refuse to download from MF.
I'd also ditch Tiny Upload; I now use 4shared to upload my PowerPoint files.
Try 2shared.
Offline
B
U
M
P
Offline
thebuilderdd wrote:
rdococ wrote:
WindozeNT wrote:
Perhaps... But ditch MediaFire and use something like Tiny Upload. I refuse to download from MF.I'd also ditch Tiny Upload; I now use 4shared to upload my PowerPoint files.
Try 2shared.
2shared doesn't work either.
Offline
rdococ wrote:
thebuilderdd wrote:
rdococ wrote:
I'd also ditch Tiny Upload; I now use 4shared to upload my PowerPoint files.Try 2shared.
2shared doesn't work either.
Your own website? Dropbox?
Offline
thebuilderdd wrote:
WindozeNT wrote:
^ ????
It opened in a new file with just coding.
Just put that into the Sub requiring the code.
Offline