From 6f1963b4e9b3eb1534f9d6ce7565f90d26354ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=9D=9A=E6=9E=9C?= <753610399@qq.com> Date: Fri, 17 Jan 2020 22:45:47 +0800 Subject: [PATCH] =?UTF-8?q?demo=20codes=20Import=E7=BB=9F=E7=BB=9F?= =?UTF-8?q?=E7=A7=BB=E5=88=B0Ctrls=E5=89=8D=E9=9D=A2=EF=BC=8C=E5=B0=BD?= =?UTF-8?q?=E9=87=8F=E9=81=BF=E5=85=8D=E6=9C=AAimport=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=B0=B1=E6=98=BE=E7=A4=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/runtime-codes/lib.merge.mp3_merge.js | 14 +++++++------- assets/runtime-codes/lib.merge.wav_merge.js | 12 ++++++------ assets/runtime-codes/lib.samplerate.raise.js | 12 ++++++------ .../runtime-codes/lib.transform.mp32other.js | 16 ++++++++-------- .../runtime-codes/lib.transform.wav2other.js | 16 ++++++++-------- .../teach.realtime.encode_transfer.js | 14 +++++++------- .../teach.realtime.mix_multiple.js | 18 +++++++++--------- assets/runtime-codes/teach.sonic.transform.js | 19 ++++++++++--------- .../test.extensions.visualization.js | 17 +++++++++-------- 9 files changed, 70 insertions(+), 68 deletions(-) diff --git a/assets/runtime-codes/lib.merge.mp3_merge.js b/assets/runtime-codes/lib.merge.mp3_merge.js index f893086..d9e124d 100644 --- a/assets/runtime-codes/lib.merge.mp3_merge.js +++ b/assets/runtime-codes/lib.merge.mp3_merge.js @@ -144,6 +144,13 @@ var test=function(){ //=====以下代码无关紧要,音频数据源,采集原始音频用的================== +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} +]); + //显示控制按钮 Runtime.Ctrls([ {name:"mp3录音16khz",click:"recStart16"} @@ -153,13 +160,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} -]); - //调用录音 var rec; function recStart16(){ diff --git a/assets/runtime-codes/lib.merge.wav_merge.js b/assets/runtime-codes/lib.merge.wav_merge.js index 5a7d53e..2b915f0 100644 --- a/assets/runtime-codes/lib.merge.wav_merge.js +++ b/assets/runtime-codes/lib.merge.wav_merge.js @@ -145,6 +145,12 @@ var test=function(){ //=====以下代码无关紧要,音频数据源,采集原始音频用的================== +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} +]); + //显示控制按钮 Runtime.Ctrls([ {name:"16位wav录音",click:"recStart16"} @@ -154,12 +160,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} -]); - //调用录音 var rec; function recStart16(){ diff --git a/assets/runtime-codes/lib.samplerate.raise.js b/assets/runtime-codes/lib.samplerate.raise.js index f4686d2..2f7844b 100644 --- a/assets/runtime-codes/lib.samplerate.raise.js +++ b/assets/runtime-codes/lib.samplerate.raise.js @@ -114,6 +114,12 @@ var k16k441=function(){ //******音频数据源,采集原始音频用的****** +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} +]); + //显示控制按钮 Runtime.Ctrls([ {name:"开始录音",click:"recStart"} @@ -140,12 +146,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} -]); - //调用录音 var rec; function recStart(){ diff --git a/assets/runtime-codes/lib.transform.mp32other.js b/assets/runtime-codes/lib.transform.mp32other.js index 2549d7f..32b727d 100644 --- a/assets/runtime-codes/lib.transform.mp32other.js +++ b/assets/runtime-codes/lib.transform.mp32other.js @@ -94,6 +94,14 @@ var test=function(mp3Blob){ //=====以下代码无关紧要,音频数据源,采集原始音频用的================== +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} + ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} +]); + //显示控制按钮 Runtime.Ctrls([ {name:"开始mp3录音",click:"recStart"} @@ -111,14 +119,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} - ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} -]); - //调用录音 var rec; function recStart(){ diff --git a/assets/runtime-codes/lib.transform.wav2other.js b/assets/runtime-codes/lib.transform.wav2other.js index 555d636..f2158ce 100644 --- a/assets/runtime-codes/lib.transform.wav2other.js +++ b/assets/runtime-codes/lib.transform.wav2other.js @@ -107,6 +107,14 @@ var test=function(wavBlob){ //=====以下代码无关紧要,音频数据源,采集原始音频用的================== +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} + ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} +]); + //显示控制按钮 Runtime.Ctrls([ {name:"16位wav录音",click:"recStart16"} @@ -125,14 +133,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} - ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} -]); - //调用录音 var rec; function recStart16(){ diff --git a/assets/runtime-codes/teach.realtime.encode_transfer.js b/assets/runtime-codes/teach.realtime.encode_transfer.js index 3ff1fa3..8ad1538 100644 --- a/assets/runtime-codes/teach.realtime.encode_transfer.js +++ b/assets/runtime-codes/teach.realtime.encode_transfer.js @@ -154,13 +154,6 @@ var TransferUpload=function(number,blobOrNull,duration,blobRec,isClose){ //=====以下代码无关紧要,音频数据源,采集原始音频用的================== -//显示控制按钮 -Runtime.Ctrls([ - {name:"开始录音和传输mp3",click:"recStartMp3"} - ,{name:"开始录音和传输wav",click:"recStartWav"} - ,{name:"停止录音",click:"recStop"} -]); - //加载框架 Runtime.Import([ {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} @@ -169,6 +162,13 @@ Runtime.Import([ ,{url:RootFolder+"/src/engine/wav.js",check:function(){return !Recorder.prototype.wav}} ]); +//显示控制按钮 +Runtime.Ctrls([ + {name:"开始录音和传输mp3",click:"recStartMp3"} + ,{name:"开始录音和传输wav",click:"recStartWav"} + ,{name:"停止录音",click:"recStop"} +]); + //调用录音 var rec; diff --git a/assets/runtime-codes/teach.realtime.mix_multiple.js b/assets/runtime-codes/teach.realtime.mix_multiple.js index 494531a..4d8f0ef 100644 --- a/assets/runtime-codes/teach.realtime.mix_multiple.js +++ b/assets/runtime-codes/teach.realtime.mix_multiple.js @@ -112,6 +112,15 @@ var bgmSet=function(bgm){ //******音频数据源,采集原始音频用的****** +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} + + ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer +]); + //显示控制按钮 Runtime.Ctrls([ {name:"开始混音",click:"recStart"} @@ -155,15 +164,6 @@ Runtime.Ctrls([ ]); -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} - - ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer -]); - //调用录音 var rec; diff --git a/assets/runtime-codes/teach.sonic.transform.js b/assets/runtime-codes/teach.sonic.transform.js index 553907b..3262a00 100644 --- a/assets/runtime-codes/teach.sonic.transform.js +++ b/assets/runtime-codes/teach.sonic.transform.js @@ -177,6 +177,16 @@ var transformBufferPlayOnly=function(buffers,sampleRate,newBufferIdx,asyncEnd){ //******音频数据源,采集原始音频用的****** +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} + ,{url:RootFolder+"/src/extensions/sonic.js",check:function(){return !Recorder.Sonic}} + + ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer +]); + //显示控制按钮 Runtime.Ctrls([ {name:"开始录音",click:"recStart"} @@ -228,15 +238,6 @@ var resetCtrl=function(){ }; -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} - ,{url:RootFolder+"/src/extensions/sonic.js",check:function(){return !Recorder.Sonic}} - - ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer -]); //调用录音 var rec; diff --git a/assets/runtime-codes/test.extensions.visualization.js b/assets/runtime-codes/test.extensions.visualization.js index 92cd99f..1e7484c 100644 --- a/assets/runtime-codes/test.extensions.visualization.js +++ b/assets/runtime-codes/test.extensions.visualization.js @@ -86,6 +86,15 @@ var visualizationCreate=function(){ //******音频数据源,采集原始音频用的****** +//加载录音框架 +Runtime.Import([ + {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} + ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} + ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} + + ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer +]); + //显示控制按钮 Runtime.Ctrls([ {name:"打开音频输入",click:"recStart"} @@ -155,14 +164,6 @@ var resetCtrl=function(){ }; -//加载录音框架 -Runtime.Import([ - {url:RootFolder+"/src/recorder-core.js",check:function(){return !window.Recorder}} - ,{url:RootFolder+"/src/engine/mp3.js",check:function(){return !Recorder.prototype.mp3}} - ,{url:RootFolder+"/src/engine/mp3-engine.js",check:function(){return !Recorder.lamejs}} - - ,{url:RootFolder+"/assets/runtime-codes/fragment.playbuffer.js",check:function(){return !window.DemoFragment||!DemoFragment.PlayBuffer}}//引入DemoFragment.PlayBuffer -]); //调用录音