snapshoot()from javascript. Like this:
<button onclick="snapshoot()">click</button> audio/ogg added, so should work in Mozilla.
On Codepen.io simply add this link to the JS resource link, and you can use it in your pens.
http://codepen.io/netsi1964/pen/IHwco
An example of use here on Codepen.io the sound will play when you paste image to app.:
HTML5 paste image to page