Actionscript 3: Se reproduce la animación de espectro de sonido, pero el sonido está silenciado. es posible?

Kinda of an oxy-moron question but I thought I would go ahead and ask anyhow.... I am looking for my soundspectrum animation to play but my sound will be muted...This will be inserted in a banner ad, so their are specific rsestrictrictions with vendors where the sound has to be user initiated...

Any ideas would be appreciated...

var SpectrumLineWidth:Number;
var SpectrumLineColor:Number;
var SpectrumGlowDirection:String;
var SGD:String;
var ss:ByteArray = new ByteArray();
var bmpData:BitmapData;
var bmp:Bitmap;
var lsp:Sprite = new Sprite();
var blur:BlurFilter;
// Main sounds object
var _sound:Sound = new Sound();
var _soundChannel:SoundChannel;
var _soundTransform:SoundTransform=new SoundTransform(1);
var _soundLoaderContext:SoundLoaderContext = new SoundLoaderContext();

bmpData = new BitmapData(10,10,true,0xcccccc);
bmp = new Bitmap(bmpData);
spectrumArea.specArea.addChild(lsp);
spectrumArea.specArea.addChild(bmp);
// filter;
blur = new BlurFilter(8,8,4);
// save configuration
SpectrumLineWidth = 1;
SpectrumLineColor = 0x0066FF;

var s:Sound = new Sound();
//s.setVolume(0);

 var sc:SoundChannel;
 var ba:ByteArray = new ByteArray();
 var array:Array;

 s.load(new URLRequest("test.mp3"));
 sc = s.play(0,1000);
 sc.soundTransform = _soundTransform;

 this.addEventListener(Event.ENTER_FRAME, spectrum);

 function spectrum(event:Event){
lsp.graphics.clear();
lsp.graphics.lineStyle(SpectrumLineWidth, SpectrumLineColor);
lsp.graphics.moveTo(-1, 50);
SoundMixer.computeSpectrum(ss);
for (var i:uint = 0; i<350; i++)
{
    var num:Number =  -  ss.readFloat() * 50 + 50;
    lsp.graphics.lineTo(i, num);
}
bmpData.draw(lsp);
bmpData.applyFilter(bmpData, bmpData.rect,new Point(), blur);

//SGD = SpectrumGlowDirection;
//lsp.graphics.clear();
//lsp.alpha=.5
bmpData.draw(lsp);
   }

//var sd:SoundTransform = new SoundTransform();
//sd.volume=0;
//SoundMixer.soundTransform = new SoundTransform(1);

preguntado el 08 de noviembre de 11 a las 17:11

1 Respuestas

No puedes hacerlo con SoundMixer.computeSpectrum(ss);
Investigar Sound.extract

respondido 08 nov., 11:23

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.