Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 616
  • Last Modified:

Play a sound on onkeydown (Javascript)

I want to play a keystroke wav/mp3 whenever an onkeydown event is registered, in JavaScript.

What's the approved code?
0
edhasted
Asked:
edhasted
2 Solutions
 
Gurvinder Pal SinghCommented:
try this one (it says that its cross browser one)
http://stackoverflow.com/questions/187098/cross-platform-cross-browser-way-to-play-sound-from-javascript

just call this method at onkeydown
window.onkeydown = function(){
  //soundPlay("soundurl");
}
0
 
edhastedAuthor Commented:
Thanks, I'll need to spend some time on these and get to grips with the current prower limitations.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now