Skip to content

Commit

Permalink
demo codes Import统统移到Ctrls前面,尽量避免未import完成就显示按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Jan 17, 2020
1 parent dd2756a commit 6f1963b
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 68 deletions.
14 changes: 7 additions & 7 deletions assets/runtime-codes/lib.merge.mp3_merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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(){
Expand Down
12 changes: 6 additions & 6 deletions assets/runtime-codes/lib.merge.wav_merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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(){
Expand Down
12 changes: 6 additions & 6 deletions assets/runtime-codes/lib.samplerate.raise.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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(){
Expand Down
16 changes: 8 additions & 8 deletions assets/runtime-codes/lib.transform.mp32other.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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(){
Expand Down
16 changes: 8 additions & 8 deletions assets/runtime-codes/lib.transform.wav2other.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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(){
Expand Down
14 changes: 7 additions & 7 deletions assets/runtime-codes/teach.realtime.encode_transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions assets/runtime-codes/teach.realtime.mix_multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 10 additions & 9 deletions assets/runtime-codes/teach.sonic.transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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;
Expand Down
17 changes: 9 additions & 8 deletions assets/runtime-codes/test.extensions.visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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
]);


//调用录音
Expand Down

0 comments on commit 6f1963b

Please sign in to comment.