-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
56 lines (54 loc) · 1.93 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
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Seamless MSE Audio Test</title>
</head>
<body>
<div>
<p>
This page uses MSE to concatenate several encoded fragmented MP4 (AAC) files into a gapless audio stream.<br/>
Based on Dale Curtis' excellent article, <a href="https://developers.google.com/web/updates/2015/06/Media-Source-Extensions-for-Audio?hl=en">Media Source Extensions for Audio</a>.<br/>
Currently, this plays gaplessly on Chrome, but has audible gaps on <a href="http://caniuse.com/#feat=mediasource">other MSE-enabled browsers</a>.
</p><br/><br/><br/>
</div>
<div>
<audio id="audio0" controls=""></audio><br/>
<span>Sine wave - 10 segments @ 1 seconds each</span><br/><br/><br/>
</div>
<div>
<audio id="audio1" controls=""></audio><br/>
<span>Sintel - 5 segments @ ~6.5 seconds each</span><br/><br/><br/>
</div>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
'use strict';
// Initialize gapless audios
window.initGaplessAudio(
document.getElementById('audio0'),
[
'audio/sine_0.mp4',
'audio/sine_1.mp4',
'audio/sine_2.mp4',
'audio/sine_3.mp4',
'audio/sine_4.mp4',
'audio/sine_5.mp4',
'audio/sine_6.mp4',
'audio/sine_7.mp4',
'audio/sine_8.mp4',
'audio/sine_9.mp4'
]
);
window.initGaplessAudio(
document.getElementById('audio1'),
[
'audio/sintel_0.mp4',
'audio/sintel_1.mp4',
'audio/sintel_2.mp4',
'audio/sintel_3.mp4',
'audio/sintel_4.mp4'
]
);
</script>
</body>
</html>