RetroZilla/webshell/tests/viewer/samples/soundtest.html

21 lines
529 B
HTML
Raw Normal View History

2015-10-21 05:03:22 +02:00
<html>
<head>
<title>Sound Service Play Example</title>
</head>
<body>
<script>
var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance();
url = url.QueryInterface(Components.interfaces.nsIURL);
url.spec = "resource:/res/samples/test.wav";
var sample = Components.classes["@mozilla.org/sound;1"].createInstance();
sample = sample.QueryInterface(Components.interfaces.nsISound);
</script>
<form name="form">
<input type="button" value="Play Sound" onclick="sample.play(url);">
<form>
</body>
</html>