# Someone can do this\[dynamic mp3 streamed from php into flash\]

**URL:** <https://forum.kirupa.com/t/someone-can-do-this-dynamic-mp3-streamed-from-php-into-flash/147818>\
**Category:** Uncategorized\
**Created:** [May 14, 2005, 12:06am UTC](https://forum.kirupa.com/t/someone-can-do-this-dynamic-mp3-streamed-from-php-into-flash/147818 "2005-05-14T00:06:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oportocala](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@oportocala](https://forum.kirupa.com/u/oportocala)\
**Post date:** [May 14, 2005, 12:06am UTC](https://forum.kirupa.com/t/someone-can-do-this-dynamic-mp3-streamed-from-php-into-flash/147818/1 "2005-05-14T00:06:03Z")

</div>

Hi!  
I`m not sure this is the right forum to post this but i need some help. :h:  
I made a small php program that reades files in binary and streames them along the line.

I managed to make this stream images to flash, flash loads them, gets file size via Content-Length Header, then dispalys the image.

Now i go and try to do the same for mp3`s using standard Sound Class and i get nothing.  
Let me see if i can make this a little clearer for you:  
this is what i use for image-streaming (&downloads):

```php
$fp = fopen($file,"r");
header("Content-Type: application/download");
header("Content-Transfer-Encoding: binary"); 
header("Content-Length: $size");
header("Content-Disposition: attachment; filename=".basename($filename));
fpassthru($fp);

```

and

```auto

read="http://someip/somefoleder/whatever.php?mode=stream&file="+Name;
my_mcl = new MovieClipLoader();
listen = new Object();
listen.onLoadComplete = function() {//gotoAndPlay ...
}
my_mcl.addListener(listen);
this.createEmptyMovieClip("pic", this.getNextHighestDepth());
my_mcl.loadClip(read,pic);

```

Now, this works fine with the whole set of attachment headers.  
but when i try and stream [not flash stream/binary stream] a mp3 file intro flash using the same php function it does not work, furthermore i tryed changing the heders to Content-Type:audio/mpeg nothing

If anyone can help, i would really apreciate it! :jailbreak  
oh, and here is the code for the sound loading

```auto
var sound = new Sound();
sound.loadSound("http://someip/somefoleder/whatever.php?mode=stream&file="+Name,false);

```

THANKS in advance! :kommie:
