-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio-buffer-source
52 lines (47 loc) · 1.07 KB
/
audio-buffer-source
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
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="audio-node.html">
<link rel="import" href="audio-param.html">
<polymer-element name="audio-buffer-source" extends="audio-node">
<template>
<shadow></shadow>
</template>
<script>Polymer((function static(){
const sfx = window["::sfx::"];
const METHODS = {
start:{
value:function(){
this.node.start();
return this;
}
},
stop:{
value:function(){
this.node.stop();
return this;
}
},
};
const PROTOTYPE = {
publish:{
loop:false,
loopStart:0,
loopEnd:0,
},
typeChanged:function(o,n){
this.node.type = n;
},
ready:function(){
this.node = sfx.createBufferSource();
this.start();
this.super();
},
attached:function(){
this.connect(this.parentElement);
},
};
Object.defineProperties(PROTOTYPE,METHODS);
return PROTOTYPE;
})());
/*
*/</script>
</polymer-element>