Sound of a typewriter!

Asked

Viewed 163 times

-1

I’m here to start a project, but am I in any doubt? I need typewriter sound when writing on a form, for example when clicking on a key plays the sound giving a typewriter sound effect. Does anyone know if it’s possible and can provide me with some documentation?

  • I don’t understand what you’re wanting... the sound of typewriter or don’t know how to play an audio key up?

  • yes and even that do not know how to play a sound with the keyup

  • 1

    then see the question indicated there on and edit your case can not, presenting exactly where you encountered difficulty

1 answer

2


Here’s an example that might help you:

<html>
	<head>
		<title>Maquina de Escrever</title>
		<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
		<script type="text/javascript">
		var clack = new Audio('http://www.sounddogs.com/previews/104/mp3/561076_SOUNDDOGS__co.mp3');
		$(document).ready(function() {
			$("#campo").keyup(function() {
				clack.play();
			});
		});
		</script>
	</head>
	<body>
		<input type="text" id="campo">
	</body>
</html>

  • The jQuery there would just be to do the keyup?

  • and even that thank you very much!!

  • It would be better with keydown instead of keyup!

  • @Anderson Carlos Woss, how do you make the words in the comments to be marked?

  • @Le248dev Severe accent, as in questions/answers.

  • Thanks, pal, it’s just that I started in the stack these days and I didn’t know.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.