maxl0rd / standingwave3

Flash ActionScript3 dynamic audio library
http://www.noteflight.com
162 stars 28 forks source link

WaveFile.createSample Throws Index Out Of Range Error #2

Closed PsychoAcoustician closed 14 years ago

PsychoAcoustician commented 14 years ago

Hi maxl0rd,

This does not happen in standwave2, but does in standingwave3 using identical methods of calling the function.

It throws the error at line 124 during the beginning of the for loop. I believe no data is received when calling data1 = sample.channelData[0]; just above at line 120.

Following is some variables just before the error:

wav flash.utils.ByteArray (@11ad8401)
bytesAvailable 50772622 [0x306ba8e]
endian "littleEndian"
length 50772668 [0x306babc]
objectEncoding 3
position 46 [0x2e]

groupId "RIFF"

fileLen 50772668 [0x306babc]

riffType "WAVE"

sample com.noteflight.standingwave3.elements.Sample (@11adc5c1)

chunkType "data"

chunkSize 50772624 [0x306ba90]

chunkStart 44 [0x2c]

blockAlign 0

bitsPerSample 16 [0x10]

wFormatTag 1

channels 2

rate 44100 [0xac44]

dwAvgBytesPerSec 176400 [0x2b110]

numSamples 25386312 [0x1835d48]

numFrames 12693156 [0xc1aea4]

i 0

c 0

j 0

data1 Vector. (@11b65541) fixed true
length 0

data2 Vector. (@11b65681) fixed true
length 0

Thanks

maxl0rd commented 14 years ago

Hi

I think this is using the original code from Dec 09 or so? The wav file class was improved in the more recent release, and may not exhibit this error. It's also much faster, so you would want to use it, if you are loading 50 mb wave files.

These are a lot bigger than anything I've tried using, so there could also be other issues.

PsychoAcoustician commented 14 years ago

You're right, it must have been older code: I downloaded the lastest and it seems to be working fine.

Thanks!