On 19/07/2011 10:27, Karl DeSaulniers wrote:
Hi Paul, Gerry,
Are these runtime calls, or calls to set up runtime?
How is the swf published? Local? Server?
If Local, you could try javascript.
Calling the javascript before you need the results in flash.
Then que the results so there is no latency, like a buffer?
If server, I would go with Paul's socket suggestion or a perl script.
Or call the php before you need the results in flash.
A small php script takes milliseconds to execute.
Maybe, but there's network latency to be added to that. DSP usually
requires fast real-time processing, so latency defeats the object of
using native code. My suggestion about the socket server would be to
install that on the client, not a remote server. Even so I suspect the
latency will be too big.
You can even build a php script that polls the dll on its own and que
the results
for flash to grab from.
Best,
Karl
On Jul 19, 2011, at 3:58 AM, Paul Andrews wrote:
On 19/07/2011 09:48, Karl DeSaulniers wrote:
Hi Gerry,
Can you utilize php as a mediator?
Flash<->PHP<->DLL
I think there would be a huge latency, which would defeat the
purpose. The fastest alternative I know would be an socket server on
the same machine as the flash app. The socket server would then
handle the requests and be able to process them natively. Again,
there would be a huge latency compared to a native call.
PHP eg:
<?php
if (is_file("path/To/yourfile.dll")) {
// true; we can proceed
//code to execute dll, format and send results to flash here
} else {
return false;
}
?>
HTH,
Best,
Karl
On Jul 19, 2011, at 3:06 AM, Paul Andrews wrote:
On 19/07/2011 08:46, Gerry Beauregard wrote:
Hi Paul, thanks for the quick response.
The use case would be to call some CPU-intensive audio signal
processing code, most likely written in C++ and packaged as a
DLL. The idea is that a SWF (or AIR app) would try to detect the
presence of the DLL on the user's machine; if the DLL is present,
the SWF (or AIR app) would use the native signal processing
functions implemented in it, otherwise it would rely on a
simplified lower-quality implementation coded in AS3.
I can't think of any way to do what you want. All the native code
workarounds I know of really aren't efficient for real-time calls
and the overhead would outweigh the benefit. Be interesting if
anyone suggests a method.
-Gerry
On 2011-07-19 , at 15:25 , Paul Andrews wrote:
On 19/07/2011 08:15, Gerry Beauregard wrote:
Hi folks,
Does anyone know whether there's a way to call native code from
a Flash SWF or AIR app, for example to call functions in a DLL?
Something like Java's JNI but for Flash?
I have never heard of anyone doing that and I know of no direct
mechanism to do so.
What is your use-case?
I realize it's possible to read and write local data files from
a SWF (using FileReference) or from an AIR app (using the File
class), but that's reading and writing data, not running code. I
also know it's possible to run C code compiled using Alchemy -
but that's not really native code, as Alchemy-compiled code
isn't native code, but rather byte-code that runs on the
ActionScript VM.
-Gerry
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders