Hi, I'm making music visualization in papervision3d using FlashDevelop. The script generates 150 cubes each acting as different tone (from basses with red colors to high notes with blue).
The song starts, everything works fine, but after 44 seconds song stops. I hadn't wrote function that would do that. I've turned off every useless visual functions and even papervision3d rendering. The scene is just black and the song still stops playing after 44 seconds.
File is included with:
[Embed(source = "../assets/8bp069-05-she-session.mp3")]
because I'm not writing it in flash.
I've tried different song and it stops after 1:10...
Flash uses ~30MB of Ram and 50% of my Athlonx2 64 2.6Ghz in action.
Here's some code:
sound
[Embed(source = "../assets/8bp069-03-she-pioneer.mp3")]
private var Music:Class;
private var sp:Sound = new Music();
// [...] and in initialisation function:
sp.play();
on enter frame
private function oef(e:Event = null):void
{
SoundMixer.computeSpectrum(_bytes, true, 0);
var value:Number;
for (i = 0; i < 256; i++)
{
value = _bytes.readFloat();
value = (value * 256) << 0;
values[i] = value;
}
// CALCULATE `BEAT`
SoundMixer.computeSpectrum(_bytes);
beat = 0;
for (i = 0; i < 256; i++) {
beat += _bytes.readFloat();
}
rotateCamera();
randomizeCubes();
cameraBeat();
}
those last 3 functions have nothing to do with playback.
Am I doing something wrong with computeSpectrum function?
![[as3+pv3d] Music stops...](http://bbsimg.ngfiles.com/2/18955000/ngbbs49e383c34613d.jpg)