Actionscript: SoundMixer.computeSpectrum()
Source: The Flash blog[link]
Action Sclipt video tutorial[link]
//////////////////////code sample /////////////////////////
Source: The Flash blog[link]
Action Sclipt video tutorial[link]
//////////////////////code sample /////////////////////////
- var s:Sound = new Sound();
- var sc:SoundChannel;
- var ba:ByteArray = new ByteArray();
- var array:Array;
-
- s.load(new URLRequest("mix.mp3"));
- sc = s.play(0,1000);
-
- this.addEventListener(Event.ENTER_FRAME, spectrum);
-
- var a:Number = 0;
-
- function spectrum(event:Event)
- {
- a = 0;
- graphics.clear();
- SoundMixer.computeSpectrum(ba,true,0);
- for(var i=0; i <256; i=i+8)
- {
- a = ba.readFloat();
- var num:Number = a*360;
- graphics.lineStyle(num/15,0x0066FF|(num <<8));
- graphics.drawCircle(stage.stageWidth/2,stage.stageHeight/2,i);
- }
-
- }
0 件のコメント:
コメントを投稿