user tristan.paige
tristan.paig.. (7)

another mp3 player take-2

a few more updates. redesigned in AS3. use the right-click menu for more options. xml driven with a few custom options. create a skin to match your site.

if people seem to like where it's going, the next update will be custom colors for the visualization, more skins availiable and a more comprehensive menu system integrated into the module.

thanks for downloading. i hope you enjoy it as...
more >
2127 downloads, 19778 views

xml mp3 player


Download (2.89 MB)

Comments

You need to login to post a comment.

user brettmcmaugh
brettmcmaugh 9 years ago

Perfect circle yeah.

user tristan.paige
the listing author tristan.paige 1 decade ago

cinnah: sorry for not getting back sooner. CHANNEL_LENGTH must be 256. the code i posted below should make the visualization the width of the stage already. please send me a quick and dirty photoshoped image of what you want the player to look like, i'll apply that image to the stage and create the viaualization to match the dimensions of the area you give. be clear where you want it to show. draw some arrows indicating the limits of where it will be shown. i'll try my best to help out. mixing the colors on diffrent backgrounds really gives a cool effect as well. i'm going to try and upload another player with a few diffrences so you can see how flexible the spectrum can be. post your link when your player's finished, i'd like to see what you came up with. good luck.
ciao.

user cinnah
cinnah 1 decade ago

THX tristan, i'm still confusing as2-3. but, i couldn't solve it yet. > height gives no problem, but if you change the width, the lines get messed up. (const CHANNEL_LENGTH:int = stage.stageWidth; //gives just one soundwave) Peace

user tristan.paige
the listing author tristan.paige 1 decade ago

hey cinnah. i did call the function equilizer. thats just awful :)remember, it's stage.stageWidth in AS3. replace the the function with:
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
var bytes:ByteArray = new ByteArray();
const PLOT_HEIGHT:int = stage.stageHeight/2;
const CHANNEL_LENGTH:int = 256;
SoundMixer.computeSpectrum(bytes, false, 0);
var g:Graphics = this.graphics;
g.clear();
g.lineStyle(0, 0x6600CC);
g.beginFill(0x6600CC);
g.moveTo(0, PLOT_HEIGHT);
var n:Number = 0;
for (var i:int = 0; i < CHANNEL_LENGTH; i++) {
n = (bytes.readFloat() * PLOT_HEIGHT);
g.lineTo(i * 2, PLOT_HEIGHT - n);
}
g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
g.endFill();
g.lineStyle(0, 0xCC0066);
g.beginFill(0xCC0066, 0.5);
g.moveTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
for (i = CHANNEL_LENGTH; i > 0; i--) {
n = (bytes.readFloat() * PLOT_HEIGHT);
g.lineTo(i * 2, PLOT_HEIGHT - n);
}
g.lineTo(0, PLOT_HEIGHT);
g.endFill();
}

that should get you started.
ciao

user cinnah
cinnah 1 decade ago

tristan.paige: in the script, i think it's called 'equalizer'. and i still couldn't change the width of it (i can, but no stage.width). does it has something to do with 'CHANNEL_LENGTH'? the 256, is this in function with something else? I don't get it. if you could fix me that, it would be super!

show all 10 comments