Actionscript 3 :: Streaming Large Amounts Of Data From Flash?
Nov 2, 2010
I'm currently working on a project where I generate a large amount of audio data to be stored on a users machine.
It works fine for small amounts of data but as the memory usage grows the flash application begins to struggle and eventually dies.
I've been thinking about possible ways to overcome this problem and I was thinking instead of storing all the data in memory (sometimes up to 100mb) a possible solution may be to stream the data to a server (44100 float numbers per second) as it is is being generated then once the accumulation of data has ended sending it back to the client.
1) can you see any problem with this idea and if so could you offer a better alternative?
2) could you reccommend a good server technology to achieve this?
Edit 1
To add more detail.
I am generating audio on the client using the sound.extract method. As the audio is being sent to the speaker I also send it to a byte array.
Once the user has hit a stop button I prepend a wav header to the audio data in the bytearray and allow the user to download a wav of the audio they have just being listening to.
Ideally I didnt want to impose a limit of how much data the user could save. This may not be possible.Storing all this audio data in memory was causing severe performance problems in flash. I don't know of any way to incrementally store this data on the client machines so I was thinking a solution may be to incrementally stream the data to a server somewhere to reduce the memory load.
View 2 Replies
Similar Posts:
Apr 25, 2011
Im not sure whats the best way is to make large amounts of data available to my android app on the local device.
For example records of food ingredients, in the 100's?
I have read and successfully created .db's using this tutorial.[url]...
However to populate the database I use flash? So this kind of defeats the purpose of it. No point in me shifting a massive array of data from flash to a sql database, when I could access the data direct from the as3 array?
So maybe I could create the .db with an external program? but then how would I include that .db in the apk file and then deploy it to users android device.
Or maybe I create a as3 class with an xml object init and use that as a means of data storage?
View 1 Replies
Aug 20, 2009
how "you" would do it and then deciding my strategy from there.What I'm setting out to do is as follows:I have a UI with about 10 sliders and 10 buttons.I'm using Senoculars Virtual Mouse class to record all of the users interactions into arrays (basically [x,y, action, time, value]) and then after a decided time (say 3 minutes) I play the users interaction back to them.All of that works fine but now the data is not persistent.I would like to be able to store the interaction data somewhere and then a user can log out, log in and view their previously saved interaction.how would you go about saving this data? I was thinking about storing it in a XML file but I'm concerned that the file would wind up being ridiculously huge. If a user drags a slider from left to right just once thats saving [x ,y action, time,value] 42 times.
View 3 Replies
Sep 12, 2006
I'm currently using XML to import geo-location data to my flash application.Even though my XML scheme is about as small as can be, I still feel i would do better downloading the variables as text and exploding them. If i manage to change the xml to raw text I can compress the data to about 35% of the original size.I want to load the data in the form a_b_c_d-e_f_g_h.So, to the question; how do I explode a datastring in flash?
View 2 Replies
Dec 12, 2007
What is the best way to work large amounts of external data in Flash? XML, remoting,something else??I'm looking into a project that has a lot and I'm not sure what the best way to handle it would be
View 1 Replies
Jun 29, 2009
I have a web application that functions as a dashboard, allowing a user to see summaries of historical data to view trends, etc. As an extension to this, I want to allow the user to drill-down into the historical data if they so wish.What this will amount to is a table of time-value pairs, showing the time a particular data point was recorded as well as its associated value. The issue is that there could be a very large amount of data on record (millions of points is entirely possible), which means it wouldn't work to load all the data up front and display it to the user.
So far, my best idea is to implement the table of time-value pairs with "infinite scrolling" - i.e. the first x points are loaded and then as the user scrolls down the next x points are fetched and so on until the user reaches the end of the data (with a fixed-size cache of points, so that I don't run out of memory). The issue with this approach, though, is that there's no way to get to the end of the data without first fetching every point in between.
Another option would be to have a navigation interface with forward and back buttons, as well as some sort of date chooser so the user can quickly navigate to any data point they wish. This solves the problem of the first idea, but this navigation interface is far more clunky and less intuitive.My question is: is there some happy medium? A UI where it's clean and easy to navigate through the data but at the same time provide some method of jumping to a specific point in time?
Edits based on comments below:The development environment is flex and the database is SQL Anywhere, though the back-end logistics are less important to me than a clean, functional UI.
View 1 Replies
Feb 18, 2010
how much memory (and swf size) the various built-in data types take up in actionscript 3? I'm specifically interested in int, Number, and (dense) Arrays or Vectors. I'm working on a project where I need to embed large amounts of structured array data, which is already in C++ format, so porting is just a matter of copy-paste, search-replace. I've already had a look at Adobe's lowdown on datatypes but it's not specific enough, and doesn't mention Arrays, etc.
View 5 Replies
Nov 8, 2006
i'm building a site for a pharmacutical company. it's a resource guide. it's essentially a 300 page document, and turning it into a flash site, with links to external pdfs/ppt/doc files. when dealing with so much copy, what is the best way to manage/display it? in the first round of this project, i was simply putting it in flash type, with thumbnail images scattered throughout. it worked, but seemed a little bit archaic. often, with such heavy copy (3 full page scrolls), the thumbnails wouldn't align where i wanted them, and would end up overlapping with text.
View 3 Replies
Jul 2, 2009
We are streaming a one hour F4V from streaming media server 3.5.2 and for some reason it is seeing our one hour video as being 10 hours long. We have tons of other videos and never ran into this problem in any of the other files. This is the only file that exceeds one hour. This occurs in the default player from the streaming server.
View 1 Replies
Nov 19, 2010
I have a component I created that works like a Viewstack but the next index component slides in from one of the four sides. I've got it working well enough that it's acceptable to use, but I want to make it more efficient.
Right now I'm using a Canvas as the base component, I create a snapshot of the current view using an ImageSnapshot (new Bitmap( ImageSnapshot.captureBitmapData( this ) )), and I slide the new index on top of that image on index change.
I'm basically looking for suggestions on how to do this a better way. By taking the Image after the component loads, and after the slide happens, I've gotten the initial jaded moves down to a minimum, but we normally use this for transitioning grids so it's almost always slow on the first or first couple slides.
[Code]...
View 4 Replies
Jul 28, 2009
I have recently "inherited" several websites that feature 1 to 10 minute video animations in SWF formatOne of my challenges is to get these files to appear or play in a timely manner so that the viewer does not loss interest as it is loading. My questions will start with file size.reduce or minimize the size of published SWF files while still maintaining high quality video output? Second, how about this business of preloading.I don't really understand that term but my thinking is that if a large movie could be loading while another, shorter, movie is playing, or a graphic displaying, that this could be useful in my case. Lastly, how about streaming in general. Are there ways to optimally use a given download speed to efficiently stream SWF video?
View 5 Replies
May 20, 2011
I have a large flash project and I'm trying to figure out the best way to handle it. I want to load in an XML file of groups and their members, and a bunch of attributes related to each group and its respective members - but these groups and members are only displayed on screen after a user clicks on their parent groups. My first thought was to just pull in the XML for the whole tree of groups and users, then assign movie clips for the groups, and attach properties related to their display and how the user will interact with them - but if they may never appear on screen, is it pointless to do this? How do I best structure this project? Build an object and attach properties only to the object, then add display data only on click?
View 2 Replies
Aug 31, 2009
I am writing in reference to Visualizing LARGE Data Sets .
Apparently, using the underlying Flash API for drawing:
g.beginFill( o.x * 0xFFFFFF, 1 )
g.drawCircle( o.x * w, h-(o.y * h), 2 );
[code]......
View 1 Replies
Feb 3, 2011
I'm developing a web application with Flash CS5 and AS3.0. The problem I'm having is this:At a certain state, the application goes to a frame with a "loading..." animation that loops continuously until the next state is reached. The animation is inside a MovieClip that lives on this frame on the stage (I'm not creating or animating it dynamically). While in this state, the app is waiting to receive a large xml file from an XmlSocket connection. The file takes a few seconds (literally - not milliseconds) to be received fully by the Flash player, and during this time the loading animation stops. I believe the socket is blocking the animation thread until it's done receiving the entire file.Does anyone know of a workaround that would allow the animation to keep playing while the socket is receiving? I've seen pseudo-threading hacks, but those always deal with computations or other activities that can be accomplished by calling a call-back function multiple times. Since I'm just listening on an open socket, there's no callback I could pass to a pseudo-thread.
View 2 Replies
Mar 11, 2012
The idea behind is a multiplayer browser game which interacts with a PHP server. Right now it works like this: Every second the browser is doing an ajax call to the php script which checks everything and returns the response. All in all it runs fine, but the problem is that the browser gets overloaded (because of thousands of ajax requests) after a while and it becomes impossible to play anymore. Also the delay of 1+ second is pretty much. My idea is to have a simple flash pixel which will have a 2-way communication with the server. For example:
[Code]...
View 2 Replies
Jan 30, 2012
Is it possible to investigate an html page that views a video streaming data using flash, and then use these data to view it on the phone? For example Al Jazeera website has a streaming service. I've looked through the html page and other resources using chrome developers tools. I found a lot of data, but couldnt figure it out which data I need.
View 1 Replies
Feb 3, 2007
I am new with Flash, and still trying to learn. There is one thing I can't find information about. How do I embed a Windows Media stream on a flash web site? If possible at all.
View 1 Replies
Apr 7, 2012
I'm developing an application using Flas Builder / Flex for Adobe Air. This application will be processing a large set of static text (100 - 200 MB) using a variable set of processing instructions.The target platforms will be iOS, Android and Desktop.The data set can be either one large XML file or broken into a bunch of XML files about 3MB each.This will be decided at design time.From your experience would it be better to store the text in an Adode Air database or a set of XML files for best performance (including speed and battery life)?What other considerations should I take into account?
View 1 Replies
Feb 16, 2011
Are there javascript libraries that can handle large data visualization? I've seen Protovis, but not sure how much data it can handle. Also, how do Actionscript libraries compare to Javascript in terms of performance?More:I've tried Flare, but seems to be slow for my applictaion. Now I'm yet to figure out if it is the rendering or if it is the shaping of data for rendering. I am looking at interactive graphs like the JobVoyager.
View 1 Replies
Jan 28, 2009
I'm building a sidescrolling world where you can move around.The idea is that you should be able to move to any point in the world, as well as travelling really fast.I'm pregenerating a long list of data about objects to place, their positions etc.
Now. When moving to a point far away from current position I don't want to loop through the whole list of objects to find what objects should be seen and not, so I'm thinking I should divide the position list into sections, each covering an area equal to the visible area. That way I would only have to roll through the lists closets to the new position.This would however result in an array of thousands of elements each consisting of about 20 objects and I'm figuring that might not be very healthy.One solution would be to split everything up further so that in the end I would have a handable nr of arrays containing a handable nr of elements.
You're probably thinking I should generate positions on the fly, but since one place in the world can be revisited I need to store all positions.
View 4 Replies
Mar 20, 2009
I've got a small problem with loadvars. I want to send data from Flash to PHP, which usually works well. But right now I need to send "larger" amounts of data around 10-20kb and loadvars doesn't work anymore.
Using loadvars to open browser-windows seems to work fine, but I want everything to happen inside of flash.
The code is:
Code:
datastring = "1, 2, 3 (...) 4998, 4999, 5000"; // long text
loadstring = 'save.php?data='+datastring;
db = new LoadVars();
[Code].....
Works fine with small text, with big text nothing happens. How to do this the right way?
Edit: Loadvars seems to work up until 4050 characters, 4051 and it doesn't send anymore. But I can't really split the query..
View 1 Replies
Sep 8, 2009
I've run into some problems trying to handle large text files in AIR (300+ MB in size). I can open a filestream and read the file just fine and even store it into a string variable. the problem occurs when i try to manipulate this data. Im trying to get each line as an element in an array so i can manipulate this data.Here's what i've tried:1. read the file into a string variable and perform a split looking for the newline character ). this freezes the program2. i've tried reading the file in one byte at a time and putting each line into an array AS it is being read from the filestream. This not only takes long but eventually freezes.
3. i've tried splitting the final string variable which contains the entire text file into chunks to process it separately.4. i've even tried putting the file contents into a sqlite database, but this also freezes.At this point, im not sure what my options are. Is AIR even equipped to manipulate data at this level? I could use a point in the right direction
View 2 Replies
Aug 1, 2006
I had to manipulate a large number of XML and GIF files. In this case I will need to use a compressed file, like zip. if the flash can access this type of data like the Java do.
View 1 Replies
Feb 8, 2010
Requirement: Create single very large bitmap data which contain some 30 PNG images loaded and for each image it should have some text. Images and text are loaded dynamically (AS2 code. Images are stored in a remote server). The bitmap data display should show 8 images at a time and corresponding text. We can see rest content by scrolling (kinetic scroll is implemented). How can I go for it?Some questions:Is there any limit for size of bitmap data ( As per link there is restriction on the height of the bitmap we can create in AS2 (max value is 2880 which is not enough for some 30 element list If we create individual bitmap data for 30 individual PNG files, we find some jerks in scroll. How can we have smooth scrolling?
View 5 Replies
Jan 13, 2012
I have a large ArrayCollection that need to be displayed in series of Datagrid.After testing, the loading time is around 30secs-1minute.My question here, is there a way to gradually add each datagrid and display it instead of waiting until all datagrids to fully created?Existing :
AddChild 1
AddChild 2
AddChild 3
[code].....
View 1 Replies
Aug 3, 2011
I am using this code for an odometer on a site to count amounts per second...
[Code]...
But I would like the amount to go up by (5) every second not by one. Is there a simple fix for this?
View 2 Replies
Jun 29, 2011
I have a Flex/AIR desktop application that connects a local camera and microphone to a NetStream for delivery to a Flash media server.However, I would also like to archive a copy of the outgoing stream locally on the filesystem. Is there any access to the actual bytestream of a NetStream object (even in the dreaded mx.internal namespace) that I could turn around and feed to a FileStream for the local archive?
View 1 Replies
May 25, 2009
AS3 to animate dynamic xml text values to -X direction means left side of the screen. The text boxes will be holding dynamic numbers which willl be basically some amounts passed by the user and these amounts will be animated as running towards left. For getting these dynamic text values from an external XML file every n second say every 5 second the xml connection will be refreshed with a timer. Now am working on is like creating text boxes at run time as per the number of amounts coming to the flash while refreshing once. Here the issue what am facing is like first time when the flash loads then there will be some 10 values so 10 text boxes will be generated and the movieclip holding these will be moving to -x direction with a timer, so when the next time the connection refreshes its again creating new text boxes and appending the movieclip and this process repeats in every refresh, if a new value is coming to the flash may be in 6th refreshing time then to see this new values there is a big delay happening because all the old generated set of amounts has to be moved to see the new one. Here we are looking for a instant change on these amounts once the new values gets to flash.
View 5 Replies
Sep 15, 2011
I'm completely new to FMS but a seasoned Flex developer. We're building a Flash Builder 4.5 application which will be deployed to iPads. The basic functional requirements are as follows:
1. Presenter in a room has a camera streaming video of themselves2. Participants in the same room have an iPad - there are 30 participants and the stream is sent to all 30 iPads simultaneously.3. There must be lowest delay possible with good quality video - we understand this can be achieved with RTMP and that VP6 has to be used (as there is no H.264 support at present in AIR on iOS)4. The presenter will trigger certain things from their iPad which will then display certain alerts, content on the partcipants iPad (from server connection the participant iPads are listening to)
Firstly, I'm interested to know your thoughts on this current spec. This was put together from zero initial experience with FMS and having read a lot online and creating a proof-of-concept. Secondly, with regards to the two-way interaction: Is this something FMS handles? Previously I have used LCDS or BlazeDS for the data events & streaming aspects of our applications. Initially I was planning on using BlazeDS again, in addition to FMS. But from what I have read FMS possible handles data push too? Does FMS have LCDS/Blaze built in in some way?
View 4 Replies
Apr 21, 2011
I have a streaming server (for pushing data not video) setup with GraniteDS and it works great. I have to include multiple swf files in a web page. Each of these swf files has a data table which includes streaming data(this is a specific requirement - so I really cant combine all data tables into 1 huge data table/swf file). All the swf files however, connect to the same gravity channel/streaming endpoint.
How many connections are there from the web page to the streaming server? Does each swf file start a new streaming connection? Or do all them share the same connection since they are just connecting to a single channel?
View 1 Replies