# WEIRD \> MP3-player question - Song plays at triple speed (or something)

**URL:** <https://forum.kirupa.com/t/weird-mp3-player-question-song-plays-at-triple-speed-or-something/231160>\
**Category:** flash\
**Created:** [July 2, 2007, 3:50pm UTC](https://forum.kirupa.com/t/weird-mp3-player-question-song-plays-at-triple-speed-or-something/231160 "2007-07-02T15:50:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iChemicalSoul](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@iChemicalSoul](https://forum.kirupa.com/u/iChemicalSoul)\
**Post date:** [July 2, 2007, 3:50pm UTC](https://forum.kirupa.com/t/weird-mp3-player-question-song-plays-at-triple-speed-or-something/231160/1 "2007-07-02T15:50:51Z")

</div>

[FONT=Trebuchet MS]Hello all! I’m not really familiar with Flash, but I need it for an MP3-player.  
It’s based on [THIS](http://www.gotoandlearn.com/download.php). The second, third and fourth item to be exactly.  
I used it on a website before and then it did his job.  
But now the “client” had send me four new songs and  
I had to replace these with the old, you know? ;p  
So um, yeah, no problem, right?  
I just needed to edit the xml file with the new urls, artists and titles of the song.  
I test it, the songs plays way faster then normal.  
I test it with another song, it works just fine.  
So I thought, it must be the mp3 files.  
But no, I played them with Winamp and Foobar.  
Everything was just fine. Then he re-uploaded them, still the same…

CODE::

The SWF file  
[/FONT]

```auto
#include "mp3_as.files/mp3player.as"

```

[FONT=Trebuchet MS]

mp3player.as  
[/FONT]

```auto
//Setup song object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(70);

//Array of songs
var sa:Array = new Array();

//Currently playing song
var cps:Number = -1;

//Position of music
var pos:Number;

//Load the songs XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
    var nodes:Array = this.firstChild.childNodes;
    for (var i=0;i<nodes.length;i++)
    {
        sa.push(new Song(nodes*.attributes.url, nodes*.attributes.artist, nodes*.attributes.track));
    }
    playSong();
}

xml.load("mp3_xml.file/songs.xml");

//Play the MP3 File
function playSong():Void
{
    s = new Sound();
    s.onSoundComplete = playSong;
    if(cps == sa.length - 1)
    {
        cps = 0;
        s.loadSound(sa[cps].earl, true);
    }
    else
    {
        s.loadSound(sa[++cps].earl, true);
    }
    trackInfo.text = sa[cps].artist + " - " + sa[cps].track;
    playPause.gotoAndStop("pause");
}

//Pauses the music
function pauseIt():Void
{
    pos = s.position;
    s.stop();
}

//Unpauses the music
function unPauseIt():Void
{
    s.start(pos/1000);
}

//MUSIC CONTROLS

//Play/Pause Toggle
playPause.onRollOver = function()
{
    if(this._currentframe == 1) this.gotoAndStop("pauseOver");
    else this.gotoAndStop("playOver");
}

playPause.onRollOut = playPause.onReleaseOutside = function ()
{
    if(this._currentframe == 10) this.gotoAndStop("pause");
    else this.gotoAndStop("play");
}

playPause.onRelease = function()
{
    if(this._currentframe == 10)
    {
        this.gotoAndStop("playOver");
        this._parent.pauseIt();
    }
    else
    {
        this.gotoAndStop("pauseOver");
        this._parent.unPauseIt();
    }
}

//Next Button
next.onRollOver = function()
{
    this.gotoAndStop("nextOver");
}

next.onRollOut = next.onReleaseOutside = function()
{
    this.gotoAndStop("next");
}

next.onRelease = function()
{
    this._parent.playSong();
}

//Mute Button
/*
mute.onRollOver = function()
{
    if(this._currentframe == 1) this.gotoAndStop("onOver");
    else this.gotoAndStop("offOver");
}

mute.onRollOut = playPause.onReleaseOutside = function ()
{
    if(this._currentframe == 10) this.gotoAndStop("on");
    else this.gotoAndStop("off");
}

mute.onRelease = function()
{
    if(this._currentframe == 10)
    {
        this.gotoAndStop("offOver");
        s.setVolume(0);
    }
    else
    {
        this.gotoAndStop("onOver");
        s.setVolume(70);
    }
}
*/

```

[FONT=Trebuchet MS]

Song.as  
[/FONT]

```auto
class Song
{
    public var earl:String;
    public var artist:String;
    public var track:String;
    
    public function Song(e:String, a:String, t:String)
    {
        earl = e;
        artist = a;
        track = t;
    }
}

```

[FONT=Trebuchet MS]

songs.xml  
[/FONT]

```auto
<?xml version="1.0" encoding="iso-8859-1"?>
<songs>
 <song url="test.mp3" artist="test" track="test"/>
</songs>

```

[FONT=Trebuchet MS]

That’s about it, I don’t have a clue what could be the reason of this.  
Plus, I’m too lazy to build a new one, I have better things to do =p  
[/FONT]
