it is related with my Ram? I have 8gb. The limit it´s different between computers...
the flash runtime uses different memory limits then could be imposed by hosting environment (read: browser or other native application). So if for example Flash runtime has no clear upper memory limit it could use at runtime the hosting application can have such limits (so if you are hitting e.g. 0.5Gb memory increase will be denied to runtime).
You could help people to solve issue by testing:
- in standalone Flash player (debugger e.g.)
- in Air application
- use flash.system.System.totalMemory to see what memory is used by Flash runtime itself (but it could not be exactly the same as total memory used by hosting application - e.g. by browser process)
So basically this could not be related directly to amount of memory available on your system (modern systems can assign more memory to processes then "hardware" RAM as there are disks)
btw: can you write to local file stream or is it Flash runtime application (so you cannot create File object that could store bytes read from Microphone). Is your "recording" feature limit-less in terms of length?
To find the error I write the following while cicle:
public function record_clickHandler(event:MouseEvent):void
mic = Microphone.getMicrophone();
mic.gain = 20;
mic.rate = 44;
soundBytes.length = 0;
public function sampleHandler(event:SampleDataEvent):void
And when we press stop:
soundBytes.position = 0;
file = File.desktopDirectory.resolvePath(FILE_NAME);
f.open( file, FileMode.WRITE);
(I don´t add the vars here...)
I will try to test soon to find out the memory, but until now I´m just using air 2.7 as debugger or released .exe. At least in 3 computers the ammount of time it´s different, the wave file should be limited to about 300Mb, It´s difficult to reduce more the quality because I need it...
1 person found this helpful
if you run profiler it will show you line graph of used memory (peak/current in timeline graph) - so you should be able to see where it crash
you could use debugger to set computed criterium for breakpoint - e.g. to length of your recorded bytes ByteArray lenght: so you could stop when it pass some precomputed value:
(or just write it to debugger output so when applicaton crash you would see length of existing byte array)
It'd be best if you are able to repeat that runtime error with values writed down about above values and e.g. process memory value read from e.g. process monitor on your machine.
The solution you're trying to implement is frequently used from the time raw-access to microphone data was introduced in Flash 10.
I will try, thanks!