# Getting NetStream.Play.FileStructureInvalid when trying to stream local MP3

**URL:** <https://forum.kirupa.com/t/getting-netstream-play-filestructureinvalid-when-trying-to-stream-local-mp3/259147>\
**Category:** flash\
**Created:** [May 1, 2008, 2:12pm UTC](https://forum.kirupa.com/t/getting-netstream-play-filestructureinvalid-when-trying-to-stream-local-mp3/259147 "2008-05-01T14:12:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ven](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@ven](https://forum.kirupa.com/u/ven)\
**Post date:** [May 1, 2008, 2:12pm UTC](https://forum.kirupa.com/t/getting-netstream-play-filestructureinvalid-when-trying-to-stream-local-mp3/259147/1 "2008-05-01T14:12:35Z")

</div>

```php

var connection:NetConnection;
var stream:NetStream;
var streamURL:String;
            
function loadStream(url:String):void {
    streamURL = url;
    connection = new NetConnection();
    connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    connection.connect(null);
}
function netStatusHandler(event:NetStatusEvent):void {
    trace(event.info.code);
    switch (event.info.code) {
        case "NetConnection.Connect.Success":
            connectStream();
            break;
        case "NetStream.Play.StreamNotFound":
            trace("Stream not found: " + streamURL);
            break;
    }
}
function connectStream():void {
    trace("try to play");
    stream = new NetStream(connection);
    stream.client = this;
    stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    stream.play(streamURL);
}

loadStream("testsong.mp3")

```

Anyone know anything about this?
