A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: reading an mp3

  1. #1
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404

    reading an mp3

    Hi, I am having abit of trouble reading this mp3 files raw data


    I tried tracing its data but I get undefined, also some other methods just output [object Object] since it is being read as an object I need to find out how to read the data streaming from this object, the link is temporary so if it doesn't work try using another mp3 link
    PHP Code:
    tune = new Sound(sound_loader);
    tune.loadSound("http://p1.bcbits.com/download/track/1521d1716f7fed44c224a4931ca67bfa/mp3-128/3111307778?fsig=35e7bef1a4e888ccb9c8c73edfb0fd8f&id=3111307778&stream=1&ts=1433793600.0&e=1433793660&h=d6305e8e031969ff5da1249c73792cd3"true);

    onEnterFrame = function(){
        
    trace(tune.data);


  2. #2

  3. #3
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    hi in regards to your socket idea I got this from the adobe documentation
    i get a connection success when i test it from my compiler but when i switch it to localhost or 127.0.0.1 and upload it to my site i get a no connection is made do you know why? 2083 is the correct port btw
    PHP Code:
    // Create XMLSocket object
    var theSocket:XMLSocket = new XMLSocket();
    // Connect to a site on unused port above 1024 using connect() method.
    // Enter localhost or 127.0.0.1 for local testing.
    // For live server, enter your domain www.yourdomain.com
    theSocket.connect("www.indocastles.com"2083);
    // displays text regarding connection
    theSocket.onConnect = function(myStatus) {
        if (
    myStatus) {
            
    conn_txt.text "connection successful";
        } else {
            
    conn_txt.text "no connection made";
        }
    };
    // data to send
    function sendData() {
        var 
    myXML:XML = new XML();
        var 
    mySend myXML.createElement("thenode");
        
    mySend.attributes.myData "someData";
        
    myXML.appendChild(mySend);
        
    theSocket.send(myXML);
    }
    // button sends data
    btn.onRelease = function() {
        
    sendData();
    };
    // traces data returned from socket connection
    theSocket.onData = function(msg:String):Void {
        
    trace(msg);
    }; 

  4. #4
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    looks like my hosting plan doesn't allow socket tunneling :/

  5. #5
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    I thought you could only access sound data from AS3
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center