Key click sound
Moderators:Administrator, Global Moderator
-
- Full Member
- Posts:36
- Joined:Tue Mar 18, 2003 3:04 am
- Location:Lancashire, UK
- Contact:
Does anyone have a code snippet which would generate a click sound each time a key is pressed when typing a string of characters?
I can make a beep when I press "Enter" or but I'd like to be able to hear a click each time a key is pressed as a string is built up as well.
Is that possible?
Cheers!
I can make a beep when I press "Enter" or but I'd like to be able to hear a click each time a key is pressed as a string is built up as well.
Is that possible?
Cheers!
Key click sound
Hello again John.
This is probably not what you want but the best I have come up with so far:
Note that the loop is closed, leave it up to you to sort out an appropriate exit. You can also adjust the speed and key to suit.
Regards
Valerie.
This is probably not what you want but the best I have come up with so far:
Code: Select all
CLS
DO
a$ = INPUT$(1)
PLAY "T255 L64 g-"
b$ = b$ + a$
LOCATE 1, 1: PRINT b$
LOOP
Regards
Valerie.
-
- Full Member
- Posts:36
- Joined:Tue Mar 18, 2003 3:04 am
- Location:Lancashire, UK
- Contact:
Hello Ralph.
I don't understand why Play didn't work for you either. I'm getting the click thru' my soundcard not from the inbuilt speaker.
I had tried Sound before posting but thought that Play was a tad faster, am probably wrong on that. Also Play gives me more of a click than a tone.
Beep also works for me but is only good for very s-l-o-w typing.
BTW am using QB 4.5 in XP Home cmd.exe although Command.com made only one difference, that being that Beep no longer worked.
Regards
Valerie
I don't understand why Play didn't work for you either. I'm getting the click thru' my soundcard not from the inbuilt speaker.
I had tried Sound before posting but thought that Play was a tad faster, am probably wrong on that. Also Play gives me more of a click than a tone.
Beep also works for me but is only good for very s-l-o-w typing.
BTW am using QB 4.5 in XP Home cmd.exe although Command.com made only one difference, that being that Beep no longer worked.
Regards
Valerie
-
- Full Member
- Posts:36
- Joined:Tue Mar 18, 2003 3:04 am
- Location:Lancashire, UK
- Contact:
I've found that Valerie's PLAY instructions gives a pretty quiet click which is ok with a silent keyboard but not my clacky old thing here at home - the keys make more noise!!
By experimentation, I've settled on SOUND 950, .2 as being just about right for my particular requirement in a potentially slightly noisy enviromnent. If I need to make it more audible I just extend the duration to .5 or something and/or slightly reduce the frequency.
Both come out through the built in speaker rather than the sound card, which fits the bill for me.
I've managed to squeeze the SOUND instruction into a section of code I found in an old program which builds a string from key presses so this works fine for me now.
Thanks for your help.
By experimentation, I've settled on SOUND 950, .2 as being just about right for my particular requirement in a potentially slightly noisy enviromnent. If I need to make it more audible I just extend the duration to .5 or something and/or slightly reduce the frequency.
Both come out through the built in speaker rather than the sound card, which fits the bill for me.
I've managed to squeeze the SOUND instruction into a section of code I found in an old program which builds a string from key presses so this works fine for me now.
Thanks for your help.
-
- Full Member
- Posts:36
- Joined:Tue Mar 18, 2003 3:04 am
- Location:Lancashire, UK
- Contact: