launchpadinteractive / popforge

Automatically exported from code.google.com/p/popforge
0 stars 0 forks source link

Hi, I have a file that can not be read by your code #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 

I am looking for a way to read wav file and your project is so awesome.
However when I try to read this file (attached), I am unable to do so. May
be it is encrypted or blocked, I don't know. I can still play it with
Windows Media Player.

Would you please help ?

Many thanks and Regards,

Tiger.P.

Original issue reported on code.google.com by vdati...@gmail.com on 9 Mar 2009 at 6:58

Attachments:

GoogleCodeExporter commented 8 years ago
I had the same issue and a couple of changes fixed it. I am using Flash Player 
10.
Here are the changes you need to make:
1. In WavDecoder.as add the following lines after the line:
wav.$bits = bytes.readUnsignedShort();

//extra format bytes
var temp:int = bytes.readUnsignedShort();
bytes.position += temp;

Basically just read the extra format bytes. I had no use for them so I throw 
them away.
2. Next you may get a sandbox security error so in SoundFactory::fromByteArray 
add
the following:
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.allowLoadBytesCodeExecution = true;
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onSWFLoaded );
loader.loadBytes( swf, loaderContext );

Original comment by viran...@gmail.com on 20 Mar 2009 at 8:27