ezuikit-js 0.7.2 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/demos/base-demo/ezuikit.js +287 -4434
  2. package/ezuikit.js +367 -2307
  3. package/package.json +1 -1
  4. package/demos/base-demo/ezuikit_static/v66/v1/css/theme.css +0 -121
  5. package/demos/base-demo/ezuikit_static/v66/v1/js/AudioRenderer.js +0 -225
  6. package/demos/base-demo/ezuikit_static/v66/v1/js/SuperRender_10.js +0 -395
  7. package/demos/base-demo/ezuikit_static/v66/v1/js/SystemTransform.js +0 -22
  8. package/demos/base-demo/ezuikit_static/v66/v1/js/SystemTransform.js.mem +0 -0
  9. package/demos/base-demo/ezuikit_static/v66/v1/js/jsPluginV1-1.0.0.min.js +0 -26
  10. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/AudioRenderer.js +0 -225
  11. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/DecodeWorker.js +0 -618
  12. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/Decoder.js +0 -1
  13. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/JSPlaySDKInterface.js +0 -2052
  14. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/SuperRender_10.js +0 -396
  15. package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/SuperRender_20.js +0 -1
  16. package/demos/base-demo/ezuikit_static/v66/v1/js/transform/SystemTransform.js +0 -22
  17. package/demos/base-demo/ezuikit_static/v66/v1/js/transform/SystemTransform.js.mem +0 -0
  18. package/demos/base-demo/ezuikit_static/v66/v1/js/transform/systemTransform-worker.min.js +0 -1
  19. package/demos/base-demo/ezuikit_static/v66/v1/js/tts-v4.js +0 -346
  20. package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.js +0 -1522
  21. package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.min.css +0 -36
  22. package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.zh-CN.js +0 -19
  23. package/demos/base-demo/ezuikit_static/v66/v1/rec/jquery.min.js +0 -2
  24. package/demos/base-demo/ezuikit_static/v66/v1/speed/speed.css +0 -144
  25. package/demos/base-demo/ezuikit_static/v66/v1/talk/adapeter.js +0 -5497
  26. package/demos/base-demo/ezuikit_static/v66/v1/talk/janus.js +0 -3507
  27. package/demos/base-demo/ezuikit_static/v66/v1/talk/tts-v4.js +0 -346
  28. package/demos/base-demo/ezuikit_static/v66/v2/css/theme.css +0 -121
  29. package/demos/base-demo/ezuikit_static/v66/v2/js/Decoder.js +0 -9198
  30. package/demos/base-demo/ezuikit_static/v66/v2/js/Decoder.wasm +0 -0
  31. package/demos/base-demo/ezuikit_static/v66/v2/js/jsPluginV2-2.0.1.min.js +0 -4662
  32. package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.js +0 -1522
  33. package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.min.css +0 -36
  34. package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.zh-CN.js +0 -19
  35. package/demos/base-demo/ezuikit_static/v66/v2/rec/jquery.min.js +0 -2
  36. package/demos/base-demo/ezuikit_static/v66/v2/speed/speed.css +0 -144
  37. package/demos/base-demo/ezuikit_static/v66/v2/talk/adapeter.js +0 -5497
  38. package/demos/base-demo/ezuikit_static/v66/v2/talk/janus.js +0 -3507
  39. package/demos/base-demo/ezuikit_static/v66/v2/talk/tts-v4.js +0 -343
  40. package/ezuikit_static/v66/v1/css/theme.css +0 -121
  41. package/ezuikit_static/v66/v1/js/AudioRenderer.js +0 -225
  42. package/ezuikit_static/v66/v1/js/SuperRender_10.js +0 -395
  43. package/ezuikit_static/v66/v1/js/SystemTransform.js +0 -22
  44. package/ezuikit_static/v66/v1/js/SystemTransform.js.mem +0 -0
  45. package/ezuikit_static/v66/v1/js/jsPluginV1-1.0.0.min.js +0 -26
  46. package/ezuikit_static/v66/v1/js/playctrl/AudioRenderer.js +0 -225
  47. package/ezuikit_static/v66/v1/js/playctrl/DecodeWorker.js +0 -618
  48. package/ezuikit_static/v66/v1/js/playctrl/Decoder.js +0 -1
  49. package/ezuikit_static/v66/v1/js/playctrl/JSPlaySDKInterface.js +0 -2052
  50. package/ezuikit_static/v66/v1/js/playctrl/SuperRender_10.js +0 -396
  51. package/ezuikit_static/v66/v1/js/playctrl/SuperRender_20.js +0 -1
  52. package/ezuikit_static/v66/v1/js/transform/SystemTransform.js +0 -22
  53. package/ezuikit_static/v66/v1/js/transform/SystemTransform.js.mem +0 -0
  54. package/ezuikit_static/v66/v1/js/transform/systemTransform-worker.min.js +0 -1
  55. package/ezuikit_static/v66/v1/js/tts-v4.js +0 -346
  56. package/ezuikit_static/v66/v1/rec/datepicker.js +0 -1522
  57. package/ezuikit_static/v66/v1/rec/datepicker.min.css +0 -36
  58. package/ezuikit_static/v66/v1/rec/datepicker.zh-CN.js +0 -19
  59. package/ezuikit_static/v66/v1/rec/jquery.min.js +0 -2
  60. package/ezuikit_static/v66/v1/speed/speed.css +0 -144
  61. package/ezuikit_static/v66/v1/talk/adapeter.js +0 -5497
  62. package/ezuikit_static/v66/v1/talk/janus.js +0 -3507
  63. package/ezuikit_static/v66/v1/talk/tts-v4.js +0 -346
  64. package/ezuikit_static/v66/v2/css/theme.css +0 -121
  65. package/ezuikit_static/v66/v2/js/Decoder.js +0 -9198
  66. package/ezuikit_static/v66/v2/js/Decoder.wasm +0 -0
  67. package/ezuikit_static/v66/v2/js/jsPluginV2-2.0.1.min.js +0 -4662
  68. package/ezuikit_static/v66/v2/rec/datepicker.js +0 -1522
  69. package/ezuikit_static/v66/v2/rec/datepicker.min.css +0 -36
  70. package/ezuikit_static/v66/v2/rec/datepicker.zh-CN.js +0 -19
  71. package/ezuikit_static/v66/v2/rec/jquery.min.js +0 -2
  72. package/ezuikit_static/v66/v2/speed/speed.css +0 -144
  73. package/ezuikit_static/v66/v2/talk/adapeter.js +0 -5497
  74. package/ezuikit_static/v66/v2/talk/janus.js +0 -3507
  75. package/ezuikit_static/v66/v2/talk/tts-v4.js +0 -343
@@ -1,225 +0,0 @@
1
- /**
2
- * Created by wangweijie5 on 2016/12/16.
3
- */
4
-
5
- "use strict";
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
-
11
- var __instance = function () {
12
- var instance = void 0;
13
- return function (newInstance) {
14
- if (newInstance) instance = newInstance;
15
- return instance;
16
- };
17
- }();
18
-
19
- var AudioRenderer = function () {
20
- function AudioRenderer() {
21
- _classCallCheck(this, AudioRenderer);
22
-
23
- if (__instance()) return __instance();
24
-
25
- // 确保只有单例
26
- if (AudioRenderer.unique !== undefined) {
27
- return AudioRenderer.unique;
28
- }
29
-
30
- AudioRenderer.unique = this;
31
-
32
- this.oAudioContext = null;
33
- this.currentVolume = 80; // 初始音量
34
- this.bSetVolume = false;
35
- this.gainNode = null;
36
- this.iWndNum = -1; // 窗口号
37
- this.mVolumes = new Map(); // 用于存储所有音量
38
-
39
- // Init AudioContext
40
- var AudioContext = window.AudioContext || window.webkitAudioContext;
41
- this.oAudioContext = new AudioContext();
42
-
43
- this.writeString = function (view, offset, string) {
44
- for (var i = 0; i < string.length; i++) {
45
- view.setUint8(offset + i, string.charCodeAt(i));
46
- }
47
- };
48
-
49
- this.setBufferToDataview = function (output, offset, input) {
50
- for (var i = 0; i < input.length; i++, offset++) {
51
- output.setUint8(offset, input[i]);
52
- }
53
- };
54
-
55
- __instance(this);
56
- }
57
-
58
- /**
59
- * @synopsis 音频播放
60
- *
61
- * @param dataBuf [IN] 音频缓存
62
- * @param dataLen [IN] 缓存长度
63
- * @param audioInfo [IN] 音频参数
64
- *
65
- * @returns 状态码
66
- */
67
-
68
-
69
- _createClass(AudioRenderer, [{
70
- key: 'Play',
71
- value: function Play(dataBuf, dataLen, audioInfo) {
72
- var bufferData = new ArrayBuffer(44 + dataLen);
73
- var viewTalk = new DataView(bufferData);
74
- var sampleRates = audioInfo.samplesPerSec;
75
- var channels = audioInfo.channels;
76
- var bitsPerSample = audioInfo.bitsPerSample;
77
-
78
- //console.log("audiorender sampleRates"+sampleRates+"channels:"+channels+"bitsPerSample:"+bitsPerSample);
79
-
80
- /* RIFF identifier */
81
- this.writeString(viewTalk, 0, 'RIFF');
82
- /* file length */
83
- viewTalk.setUint32(4, 32 + dataLen * 2, true);
84
- /* RIFF type */
85
- this.writeString(viewTalk, 8, 'WAVE');
86
- /* format chunk identifier */
87
- this.writeString(viewTalk, 12, 'fmt ');
88
- /* format chunk length */
89
- viewTalk.setUint32(16, 16, true);
90
- /* sample format (raw) */
91
- viewTalk.setUint16(20, 1, true);
92
- /* channel count */
93
- viewTalk.setUint16(22, channels, true);
94
- /* sample rate */
95
- viewTalk.setUint32(24, sampleRates, true);
96
- /* byte rate (sample rate * block align) */
97
- viewTalk.setUint32(28, sampleRates * 2, true);
98
- /* block align (channel count * bytes per sample)/8 */
99
- viewTalk.setUint16(32, channels * bitsPerSample / 8, true);
100
- /* bits per sample */
101
- viewTalk.setUint16(34, bitsPerSample, true);
102
- /* data chunk identifier */
103
- this.writeString(viewTalk, 36, 'data');
104
- /* data chunk length */
105
- viewTalk.setUint32(40, dataLen, true);
106
- this.setBufferToDataview(viewTalk, 44, dataBuf);
107
-
108
- var self = this;
109
- this.oAudioContext.decodeAudioData(viewTalk.buffer, function (buffer) {
110
-
111
- var bufferSource = self.oAudioContext.createBufferSource();
112
- if (bufferSource == null) {
113
- return -1;
114
- }
115
-
116
- bufferSource.buffer = buffer;
117
- bufferSource.start(0);
118
-
119
- if (self.gainNode == null || self.bSetVolume) {
120
- self.gainNode = self.oAudioContext.createGain();
121
- // self.gainNode.gain.value = self.currentVolume;
122
- // // self.currentVolume = self.gainNode.gain.value;
123
- // self.gainNode.connect(self.oAudioContext.destination);
124
-
125
- self.bSetVolume = false;
126
- }
127
-
128
- self.gainNode.gain.value = self.currentVolume/100;
129
- // self.currentVolume = self.gainNode.gain.value;
130
- self.gainNode.connect(self.oAudioContext.destination);
131
-
132
- bufferSource.connect(self.gainNode);
133
- }, function (e) {
134
- console.log("decode error");
135
- return -1;
136
- });
137
-
138
- return 0;
139
- }
140
-
141
- /**
142
- * @synopsis 停止播放
143
- *
144
- * @returns 返回音量
145
- */
146
-
147
- }, {
148
- key: 'Stop',
149
- value: function Stop() {
150
- if (this.gainNode != null) {
151
- this.gainNode.disconnect();
152
- this.gainNode = null;
153
- }
154
-
155
- // this.oAudioContext.close();
156
-
157
- // AudioRenderer.unique = undefined;
158
- // __instance() = null;
159
- return true;
160
- }
161
-
162
- /**
163
- * @synopsis 设置音量
164
- *
165
- * @param iVolume [IN] 音量
166
- *
167
- * @returns 状态码
168
- */
169
-
170
- }, {
171
- key: 'SetVolume',
172
- value: function SetVolume(iVolume) {
173
- this.bSetVolume = true;
174
- this.currentVolume = iVolume;
175
-
176
- // 储存当前窗口设置音量值
177
- this.mVolumes.set(this.iWndNum, this.currentVolume);
178
- return true;
179
- }
180
-
181
- /**
182
- * @synopsis 设置窗口号
183
- *
184
- * @param iWndNum [IN] 窗口号
185
- *
186
- * @returns 状态码
187
- */
188
-
189
- }, {
190
- key: 'SetWndNum',
191
- value: function SetWndNum(iWndNum) {
192
- this.iWndNum = iWndNum;
193
-
194
- // 获取当前窗口设置音量值
195
- var iVolume = this.mVolumes.get(iWndNum);
196
- if (iVolume == undefined) {
197
- iVolume = 80; // 默认音量
198
- }
199
- this.currentVolume = iVolume;
200
-
201
- return true;
202
- }
203
-
204
- /**
205
- * @synopsis 获取音量
206
- *
207
- * @returns 返回音量
208
- */
209
-
210
- }, {
211
- key: 'GetVolume',
212
- value: function GetVolume() {
213
- // 获取当前窗口设置音量值
214
- var iVolume = this.mVolumes.get(this.iWndNum);
215
- if (iVolume == undefined) {
216
- iVolume = 80; // 默认音量
217
- }
218
-
219
- return iVolume;
220
- }
221
- }]);
222
-
223
- return AudioRenderer;
224
- }();
225
- //# sourceMappingURL=AudioRenderer.js.map