|
-
Mar 30th, 2001, 12:30 PM
#1
Thread Starter
Fanatic Member
Hi!
I want to ask something:
There is this function:
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Right?
Now, how can I: Play, Stop and Pause?
Explain...
Thank you,
Arie.
-
Mar 30th, 2001, 03:57 PM
#2
Good Ol' Platypus
Use SND_PURGE to stop, SND_SYNC or SND_ASYNC to play, and SND_??? to pause. (SND_??? isn't a varb.)
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 30th, 2001, 04:28 PM
#3
Thread Starter
Fanatic Member
Thank you!!
-
Mar 30th, 2001, 06:09 PM
#4
Just a note. sndPlaySound has been upgraded by PlaySound.
-
Mar 30th, 2001, 07:59 PM
#5
Good Ol' Platypus
Yeah, I heard 'bout that too. Is it any better (using DSOUND)
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 31st, 2001, 06:06 AM
#6
Thread Starter
Fanatic Member
Does anyone have a tutorial for sndPlaySound or DSOUND?
Thank you,
Arie.
-
Mar 31st, 2001, 11:47 AM
#7
Thread Starter
Fanatic Member
Ok, I found it...
But now...
When I play a WAV file it slows the computer down.
WHY?
Maybe you FOX, do you know why?
Help, Please...
Arie.
-
Mar 31st, 2001, 01:20 PM
#8
Slow wave
Make sure you only load the wav once(put it in you form_load). It should go allot faster(but it will take longer for your program to load).
-
Mar 31st, 2001, 01:25 PM
#9
Thread Starter
Fanatic Member
But...
How do I run a WAV file.
How do I load it?
What do you mean???
I am loading a WAV file like this:
Dim SND as Long
SND = sndPlaySound("C:\1.wav",&H0)
What do you mean?
Thank you,
Arie.
-
Mar 31st, 2001, 01:42 PM
#10
Check out this tutorial:
DirectSound:
http://rookscape.com/vbgaming/tutP.php
Put the following line of the tutorial somewhere in your form_load(after directsound is initialised):
Set DSBuffer = ds.CreateSoundBufferFromFile(App.Path & "\WaveFile.WAV", DSBufferDescription, DSFormat)
-
Mar 31st, 2001, 02:24 PM
#11
Thread Starter
Fanatic Member
-
Mar 31st, 2001, 03:03 PM
#12
Good Ol' Platypus
If using PlaySnd, use the LoadBuffer Function:
Code:
Function LoadBuffer(ByVal FileName as String) as String
Dim SB as String
Dim Data as String
Dim f as Integer
Data = Space$(1024)
f = FreeFile
Open FileName for Binary as f
Do While Not EOF(f)
Get #f, , Data
SB = SB & Data
Loop
Close f
LoadBuffer = Trim$(SB)
End Function
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 31st, 2001, 03:19 PM
#13
transcendental analytic
how about this sas?
Code:
Function LoadBuffer(ByVal FileName as String) as String
f = FreeFile
Open FileName for Binary as f
LoadBuffer = Space(lof(f))
Get #f, , LoadBuffer
Close f
End Function
-
Mar 31st, 2001, 05:22 PM
#14
Originally posted by Sastraxi
Yeah, I heard 'bout that too. Is it any better (using DSOUND)
No, DirectSound is a lot better, but the downside is that it requires the type library, whereas PalySound doesn't. But then again, if you're using DirectX in your application anyways, this isn't a problem.
-
Mar 31st, 2001, 07:54 PM
#15
Addicted Member
I had that code originally on a 486 with VB3, it gives you crashes if you do any more than 1k. I just had the time to put it on and not edit it for "fun".
BTW. kedaman, do you know that your avatar is completely black?
I am not a bowel.
NON SVM BOVELLVS.
Je ne suis pas des entrailles.
Ich bin nicht ein Darm.
No soy un intestino.
Chan eil mi innigh.
Ik ben niet een organenstelsel.
Jeg er ikke en tarm.
Jag är inte en tarm.
Я не кишка.
Can you say it in another language?
If so, don't hesitate to tell me!
-
Mar 31st, 2001, 07:55 PM
#16
Addicted Member
No, I mean by:
(using DSOUND) - means that I am using DSOUND and haven't used the new PlaySnd before, so I wouldnt know if it's any bettert than sndPlaySnd. What are the differences between PlaySound and sndPlaySound?
I am not a bowel.
NON SVM BOVELLVS.
Je ne suis pas des entrailles.
Ich bin nicht ein Darm.
No soy un intestino.
Chan eil mi innigh.
Ik ben niet een organenstelsel.
Jeg er ikke en tarm.
Jag är inte en tarm.
Я не кишка.
Can you say it in another language?
If so, don't hesitate to tell me!
-
Mar 31st, 2001, 07:57 PM
#17
Good Ol' Platypus
Whoops!
Sorry, I'm on a friends computer so I was in their account.. that was actaully ME posting there...
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 31st, 2001, 07:58 PM
#18
Good Ol' Platypus
And posting the one before... silly me. *hits himself several times with his friend's english etymological dictionary*
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Apr 1st, 2001, 03:08 PM
#19
Thread Starter
Fanatic Member
Ok... Ok.
Thank you.
I've already got to play many many WAV files.
Thank you, All.
If I'll have more questions, I'll come here...
Arie.
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
|