-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
47 lines (41 loc) · 1.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<title>SAME encoder client-side demo</title>
<script src="js/lib/SAME.js"></script>
<script type="text/javascript">
var Encoder = window.SAME.Encoder;
var Writer = window.SAME.Writer;
var message = {
originator: 'PEP',
code: 'EAN',
region: {
subdiv: '0',
stateCode: '00',
countyCode: '000'
},
length: 600,
start: {
day: 123,
hour: 5,
minute: 30
},
sender: 'WHITEHSE'
};
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('pre#obj').innerHTML =
JSON.stringify(message, false, 2);
var player = Writer.write(Encoder.encode(message), 'div#player');
document.querySelector('a#wav')
.href = player.querySelector('source').src;
});
</script>
</head>
<body>
<p>Message object</p>
<pre id="obj"> </pre>
<p>Audio player</p>
<div id="player"></div>
<p>Wave file link</p>
<a id="wav" href="" download="output.wav">output.wav</a>
</body>
</html>