发新帖  新投票  回帖 
14531个阅读者,9条回复 | 打印 | 订阅 | 收藏
km2012

发表时间:2016-12-4 20:05

蓝色水波频谱播放器[分享]



km2012 发表在 音乐播放器 华声论坛 http://bbs.voc.com.cn/forum-344-1.html

[全屏欣赏]

素材来源网络,播放器自己制作的,加上水波频谱。水波频谱在二楼,需要的朋友可以参阅

[本帖最后由 km2012 于 2016-12-4 20:21 编辑]

 
km2012

回复时间:2016-12-4 20:07
素材来源网络,播放器自己制作的,加上水波频谱。水波频谱在二楼,需要的朋友可以参阅

//Created by Action Script Viewer - [url]http://www.buraks.com/asv[/url]
package org.joelTong.dingX.twoD.visualizations {
import org.joelTong.dingX.common.palette.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.display.*;
import flash.filters.*;
import org.flintparticles.common.energyEasing.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import flash.media.*;
import flash.text.*;
//import org.flintparticles.common.displayObjects.*;

public class Type3 extends Sprite {

private var emitters_Emitter2D:Array;
private var _noParticles:int;
private var _noChannels:int;
private var timer:Timer;
private var jetZones_RectangleZone:Array;
private var jetStack:Array;
private var _barH:int;
private var _explosionThreshold:Number;
private var _barW:int;
private var _explosionExponent:int;
private var _colorPattern:ColorPattern;
private var renderer:BitmapRenderer;
private var _h:int;
private var _w:int;

public function Type3(_arg1:int, _arg2:int, _arg3:int=10, _arg4:int=20, _arg5:int=400, _arg6:Number=5, _arg7:Number=70, _arg8:int=100, _arg9:int=20, _arg10:int=-500, _arg11:int=50, _arg12:ColorPattern=null):void{
var _local13:uint;
var _local14:Emitter2D;
var _local15:RectangleZone;
var _local16:Jet;
emitters_Emitter2D = new Array();
jetZones_RectangleZone = new Array();
jetStack = new Array();
super();
_w = _arg1;
_h = _arg2;
_noChannels = _arg3;
_barW = (_w / _arg3);
_barH = _arg4;
_noParticles = _arg5;
_explosionThreshold = _arg7;
_explosionExponent = _arg9;
if (_arg12 == null){
_arg12 = new ColorPattern();
_arg12.pushColor(new MinMaxColor32(0x00FFFF,0x00FFFF));//在这里可以修改频谱的颜色 比如替换:4292725760, 4294954205
};
renderer = new PixelRenderer(new Rectangle(0, 0, _w, _h));
renderer.addFilter(new BlurFilter(8, 8, 1));
renderer.addFilter(new ColorMatrixFilter([2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0.95, 0]));
this.addChild(renderer);
_local13 = 0;
while (_local13 < _arg3) {
_local14 = new Emitter2D();
_local15 = new RectangleZone((_local13 * _barW), (_h - _barH), ((_local13 + 1) * _barW), _h);
emitters_Emitter2D.push(_local14);
jetZones_RectangleZone.push(_local15);
_local14.addInitializer(new Position(_local15));
_local14.addInitializer(new ColorInit(_arg12.getMinSpecificColor(_local13), _arg12.getMaxSpecificColor(_local13)));
_local14.addInitializer(new Lifetime(0, _arg6));
_local14.addAction(new Age());
_local14.addAction(new Move());
_local14.addAction(new Fade());
_local14.addAction(new Accelerate(0, _arg8));
_local14.addAction(new DeathZone(new RectangleZone(0, _h, _w, (_h + 20)), false));
_local16 = new Jet(0, _arg10, _local15);
_local14.addAction(_local16);
jetStack.push(_local16);
renderer.addEmitter(_local14);
_local14.start();
_local13++;
};
timer = new Timer(_arg11, 0);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
}
private function onTimer(_arg1:TimerEvent):void{
var _local2:ByteArray;
var _local3:uint;
var _local4:Number;
var _local5:*;
_local2 = new ByteArray();
SoundMixer.computeSpectrum(_local2, true, 0);
_local3 = 0;
_local4 = 0;
while (_local4 < 0x0200) {
_local5 = _local2.readFloat();
if (_local3 < _noChannels){
emitters_Emitter2D[_local3].counter = new Steady(Math.abs(new int((_local5 * _noParticles))));
if (Math.abs(new int((_local5 * 100))) > _explosionThreshold){
jetStack[_local3].y = (-(Math.abs(new int((_local5 * 100)))) * _explosionExponent);
} else {
jetStack[_local3].y = 0;
};
};
_local3++;
_local4 = (_local4 + (0x0200 / _noChannels));
};
}

}
}//package org.joelTong.dingX.twoD.visualizations

[本帖最后由 km2012 于 2016-12-4 20:30 编辑]

 
km2012

回复时间:2016-12-4 20:18
创建一个文件侠名为zhangyu 在文件侠中创建Main.as 把下面的代码复制粘贴进去保存

打开CS3以上版本 在舞台创建空影片剪辑 名为zhangyu.Main在第一针打勾
其他的不说了,需要的联系本人。

package zhangyu{
import org.joelTong.dingX.common.palette.*;
import flash.display.*;
import org.joelTong.dingX.twoD.initializers.*;
import org.joelTong.dingX.twoD.visualizations.*;
import flash.media.*;
import flash.net.*;

public class Main extends MovieClip {

public function Main():void{
var _local1:Sound;
var _local2:URLRequest;
var _local3:ColorPattern;
var _local4:InitializerTwoD;
super();
stage.quality = StageQuality.LOW;
_local1 = new Sound();
_local2 = new URLRequest("http://www.lxeblog.cn/UploadFiles/2016-10/22648915305.mp3");//
_local1.load(_local2);
_local1.play(0, int.MAX_VALUE);
_local3 = new ColorPattern();
_local3.pushColor(new MinMaxColor32(0x00FFFF, 0x00FFFF));//(4278203340, 4278216396)
_local3.pushColor(new MinMaxColor32(0x00FFFF, 0xF00FFFF));//(4278242559, 4278229503)
_local4 = new InitializerTwoD(stage.stageWidth, stage.stageHeight);
_local4.addVisualizer(new Type3(870, 562, 20));
addChild(_local4);
}
}
}//package

按此在新窗口浏览图片

[本帖最后由 km2012 于 2016-12-4 23:51 编辑]

 
小扣子2014

回复时间:2016-12-4 22:00
我顶的是楼主分享精神,
//Created by Action Script Viewer - http://www.buraks.com/asv
这句注释掉的东西其实是在为asv做广告。
asv尽管很聪明,它始终无法还原变量名称,只能用N多个_loca。并且顺序颠倒杂乱无章
能够在cs6里追求运行效果的话,asv是个好东西,或许一个as3码农在中国并没有商业价值吧?
国外大神写SoundVisualizer的这样多。

 
del256

回复时间:2016-12-5 11:16
有价值下载玩玩,楼主辛苦。

 
江边微风

回复时间:2017-1-13 11:13
看不懂

 
km2012

回复时间:2018-10-15 20:20

原帖由 del256 于 2016-12-5 11:16 发表
有价值下载玩玩,楼主辛苦。


 
天线宝宝88

回复时间:2018-11-4 22:41
楼主辛苦。

 
发新帖 新投票
 回帖
查看积分策略说明快速回复主题
你的用户名: 密码:   免费注册(只要30秒)


启用 Html 代码
使用个人签名
(请您文明上网理性发言!并遵守相关规定贴文发布前,请确认贴文内容完全由您个人创作或您得到了版权所有者的授权。版权声明
   



Processed in 0.020766 s, 8 q - sitemap,