|
-
Feb 25th, 2001, 04:08 PM
#1
Thread Starter
Fanatic Member
hi
i know this should be in the API section but i will get more responce here, i know how to make a standard beep, but i found in windows api how to make specfic beeps, here is what i have got so far
Code:
Private Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
Private Sub Command1_Click()
MB_ICONEXCLAMATION As Long
End Sub
but it doesn't work it comes up with an error about statment invalid outside block, what am i doing wrong, i am new to api so please be gentle, thanks for your co-operation
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Feb 25th, 2001, 04:45 PM
#2
That's because you're using the statement wrong. It should be:
Code:
Private Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
Private Const MB_ICONASTERISK = &H40&
Private Const MB_ICONEXCLAMATION = &H30&
Private Const MB_ICONHAND = &H10&
Private Const MB_ICONQUESTION = &H20&
Private Sub Command1_Click()
MessageBeep (MB_ICONHAND)
End Sub
-
Feb 25th, 2001, 06:07 PM
#3
Monday Morning Lunatic
If you want an actual PC Speaker beep, then this does it: www.parksie.net/customwin.zip
Full source for that and some other stuff.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 27th, 2001, 02:23 PM
#4
Thread Starter
Fanatic Member
Thanks a lot, sorry that i got it wrong and took a long while to reply
thanks once again
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Feb 27th, 2001, 02:25 PM
#5
Monday Morning Lunatic
No problem
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 28th, 2001, 06:06 PM
#6
Junior Member
***?
What is all this coding for? Use the damn "BEEP" command. Here's an example for you lame brained...
Private Sub cmdCommandBtn_Click()
Beep
End Sub
Wow! What skill.
Software for the next century...
-
Feb 28th, 2001, 06:13 PM
#7
PowerPoster
Well...for one, that beep will vary depending on your hardware and system software. With the use of the API, you can specify your sound durations and frequencys.
-
Feb 28th, 2001, 06:15 PM
#8
Addicted Member
Wouldn't it be just easyer to play a wav file?
-
Feb 28th, 2001, 06:17 PM
#9
PowerPoster
Hmm....I think most would agree that the API Function Megatron provided is straight forward and can easily be understood.
-
Feb 28th, 2001, 06:22 PM
#10
Monday Morning Lunatic
The problem I found with the API "Beep" function (and the reason I coded my own) is that you can only use custom frequencies on NT.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 28th, 2001, 06:54 PM
#11
Lively Member
soundcard
.WAVs won't work if the machine does not have a sound card. Thanks for the code Megatron, I have been looking for something like this.
-
Feb 28th, 2001, 07:50 PM
#12
I wonder how many charact
more than meets the eye...
still wondering... how does a huge robot that stands over 15 feet tall transform into a gun about the size of a dog.... OPTIMUS lives...
-
Feb 28th, 2001, 10:18 PM
#13
Lively Member
because he's evil
-
Mar 1st, 2001, 04:17 AM
#14
Thread Starter
Fanatic Member
mmmmm
The reason that i wanted it in API is that i am experimenting with it, and it will play specific sounds on your computer, eg asterix, and exclamation, i know the beep command, but that wouldn't work for me as i don't have a pc speaker
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Mar 1st, 2001, 04:30 AM
#15
argh!
One complains that it doesn't work without a sound card, another that he doesn't have a speaker. Well the answer to both would be to have a flashing icon.
-
Mar 1st, 2001, 06:44 AM
#16
Thread Starter
Fanatic Member
mmmmm
but i wanted it for the specific windows sounds, and i wanted to do it in API, i am not moaning !!!
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Mar 1st, 2001, 09:25 AM
#17
Lively Member
?
neither am I, I just said that you can't play a .wav without a soundcard. I am going to use the code Megatron provided in an upcoming app.
-
Mar 1st, 2001, 02:20 PM
#18
the beep api call is another one that for some reason microsoft crippled in win 95/98 
The messagebeep now contains that functionality too. This one guy was trying to make a morse code program, and we were trying to figure out how to change beep duration... turns out that parksie's way is the only way.
-
Mar 1st, 2001, 09:26 PM
#19
Fanatic Member
Just thought you might be able to use this in conjunction with the Beep API if you wanted the option of playing a wav if the sound card was installed:
Code:
'Author: Karthikeyan
'Author's email: [email protected]
'Date Submitted: 1/11/2001
'Compatibility: VB 6
'Task: Check whether sound card is installed or not using waveOutGetNumDevs API
'Declarations
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
'Code:
Private Sub Form_Load()
Dim ndevice As Integer
ndevice = waveOutGetNumDevs()
If ndevice > 0 Then
MsgBox "Sound card is installed."
Else
MsgBox "Sound card is not installed."
End If
End
End Sub
James
Last edited by JamesM; Mar 1st, 2001 at 09:33 PM.
-
Mar 2nd, 2001, 04:26 AM
#20
Thread Starter
Fanatic Member
cheers
hi James,
i was looking for that code the other day, i have used it before and it is very useful, thanks a lot
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Apr 18th, 2003, 01:10 AM
#21
New Member
comparing beeps
thanks for the code I'm using for a training program but now want to build code for converting the other way except that I cant convert beeps to text?? can anyone give me a pointer on waht i could use. something that compares two wav files or that counts the number of beeps in a wav file ??
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
|