Actionscript 3 :: Php - Php Mp3 Byte Array Transport And Write
Feb 2, 2012
I'm working on a childrens game (flash as3) in which stories, poems, songs, etc are read to the child. There's a voice recording reading/singing the text, the text highlights as the words are spoken/sung. The child may toggle on and off the voice and word highlighting independantly. The child may also opt to make their own recording. Now said recording works fine. I'm able to capture it from the mic and the child may play it back no problem. The issue lies in that the client wants the child to be able to save this recording to a web server.
I thought I had the issue solved by using a URLRequest and URLLoader object. The mp3 was showing up in the specified folder on the webserver. I played it with a media player and it worked. The child could also load said file no problem. THEN, when I tried it via browser(instead of flash player) I got the dreaded sandbox error. The only way such an operation with said objects can occur in a browser environment is if it's user initiated via a dialogue window. This is children were talking about and we're not saving locally anyway.
The child is provided 3 save slots which they click on (WSprites). Which technically is user initiated, but flash has no way of knowing that. The 3 save slots hold the sounds in memory and only change when the user records or loads. When the user saves, they get sent off to php to save. Now I did try using js as a middleman, but I ended up losing my bytes in the process and my js and php are probly the weakest areas of all my programming skills.
[Code]...
View 2 Replies
Similar Posts:
Mar 28, 2012
convert pdf file into byte array.and also i tried in Google also but no results yet.can u prefer how to convert pdf file into byte array and retrieve byte array into pdf file in flex application.
View 1 Replies
Aug 17, 2010
is it possible to write an object as byte array (in Air)? Or would I have to serialize it?
I tried this - but get an error ..
[Code]....
View 1 Replies
Aug 4, 2009
I'm just trying to find the size of a array I created. I know how to find the size of the swf and movieclips with getBytesTotal but that doesn't seem to work for arrays. anyone know of a method to find this or some built in function. I searched google and other search engines but only find the getBytesTotal command for use with MCs.
View 3 Replies
Feb 3, 2011
I have written a alchemy code for reading the byte array that i have passed from flex.
When i print the value i get the error cannot convert "OggS" to flash.utils.ByteArray
Alchemy Code
[Code]....
View 1 Replies
Mar 16, 2012
I was wondering what the 0x0 in byteArray.writeByte(0x0) means?
Is it writing a null value into the byte array?
View 1 Replies
Jun 16, 2011
i recently posted a question on embeding XML,i have it working however im still struggling to access individual elements of an XML document i would like to work with, below is a basic XML structure id like to acess:
Code:
<Game>
<Level>
[code].....
View 1 Replies
May 18, 2010
Our web application has a feature which uses Flash (AS3) to take photos using the user's web cam, then passes the resulting byte array to PHP where it is reconstructed and saved on the server. However, we need to be able to take this web application offline, and we have chosen Gears to do so. The user takes the app offline, performs his tasks, then when he's reconnected to the server, we "sync" the data back with our central database.
We don't have PHP to interact with Flash anymore, but we still need to allow users to take and save photos. We don't know how to save a JPG that Flash creates in a local database. Our hope was that we could save the byte array, a serialized string, or somehow actually persist the object itself, then pass it back to either PHP or Flash (and then PHP) to recreate the JPG. We have tried:
[Code]...
View 1 Replies
Feb 3, 2011
I am trying to send a bytearray extracted from a file to the C code and return that bytearray again from the C code..I am printing the contents of the return value from C in a text view contents.text but all i can see is the byte array object "OggS". I can't see the contents of the byte array. Can anyone say where i am going wrong?.. I have posted the C code and the AS code.
AS Code:
private function copyByteArray(content:String):void{
try{
[code].....
View 1 Replies
Jul 18, 2010
How do you add null bytes to a byte array or in my case I need to pad a byte array with null bytes before its wrote to disk.
View 1 Replies
May 7, 2011
it is possible to open a gz or other format archive, which contains multiple files with flash and then process the files.i guess it should be possible with byte-array.i managed to open a gzipped xml file this way.however i am a little stumped on how to determine which file is what in the opened and decompressed archive.
View 4 Replies
Dec 9, 2009
I want to load an SWF object from a Memory Stream or a byte array instead of a file on disk.AxShockwaveFlash class provides methods and properties to load an SWF providing its path to disk as a string but I haven't seen another way of doing it. There is an InlineData property but generally the class is undocumented and I don't know what this property does. Can it be done at all?
View 2 Replies
Jun 5, 2011
I have a PHP image object created using imagecreatetruecolor(). I'd like to send this via AMFPHP to Flash. I understand the best format is using a ByteArray. How can I achieve this without writing the image to the disk?
View 2 Replies
Jun 13, 2011
I'm using Flex 4.5 in a Mobile air for android application. So, Using the Camera/Camera roll [URL]I want to do a simple upload using amfphp Note: Since this is how you get pictures on devices, i cant use the filreference because it wants you to get the pictures using "browse" which cant be done on android or ios My plan is, after I select a picture or capture one with the camera, in the event I can get the local url to the picture that was taken like this:
[URL]
I'm putting this in the imageURL var (i'm assuming i should make it into a byte array to transfer it, im not exactly sure this is my first time making something like this)Here's how i'm taking that image, making it into a byte array, and using amfphp to send the upload to the server:
protected function upload_btn_clickHandler(event:MouseEvent):void
{
var request:URLRequest = new URLRequest(imageURL);
var urlLoader:URLLoader = new URLLoader(request);
[code]....
But i'm getting an error NetConnection.Call.BadVersion.This is the first time im trying something like this so im not even really sure if im going about it right. All the examples I find online go about using the fileReference class, but that seems to require me to use the "browse" method, and im on a mobile application that uses the camera and camera roll to grab pictures off the device, and im not sure how to incorporate that into the fileref class. I figured i could just get the byte array and send it to php myself and it should be just fine.
View 1 Replies
Jul 29, 2011
I'm trying to serialize and deserialize a byte array to a string using Base64 for as3.
Here is my code
public function Serialize(vector:Vector.<Action>):String
{
var bytes:ByteArray = new ByteArray();
var serialized:String = "";
[Code].....
is the error I get after calling deserializedObj = deserialized.readObject(); Should I be get that error if I'm just trying to put this into an object? I'm not trying to put it into an action class object yet, but if it is then the action it's getting doesn't have parameters that were originally inside.
View 2 Replies
Jan 18, 2012
I'm trying to prepend the byte array of a sound object to a captured microphone sound byte array.
It works, but the extracted sound object get pichted down and doubled in length. I guess this is because the byte array of the sound object is in stereo, while the mic byte array is in mono.
I have this:
sound.extract(myByteArray, extract);
myByteArray now contains the stereo data. How can I turn this to mono
UPDATE:
Here's a working solution:
existingByte.position = 0;
var mono : ByteArray = new ByteArray();
while(existingByte.bytesAvailable) {
[Coe]....
View 1 Replies
Jun 22, 2010
I'm looking for an efficient way to filter a specific color from a bitmapData object in ActionScript 3. Currently I use a loop with readByte32(). This takes about a second to process which is unacceptable. I have been trying to get paletteMap() to work but so far haven't been able to grasp its API (any truly useful links? Google has failed me...). Here's my current logic, which I want to improve:
[Code]...
View 2 Replies
Mar 24, 2011
I have a video file in my local system.I am using windows XP in my system. Now i want to send this video file byte array to server in Flash Builder (Flex 4). I am using PHP at server end.
View 5 Replies
Dec 13, 2011
I'm currently recording and storing a ByteArray of sound and then playing it back. But for some reason the playback starting position of the ByteArray is 163840, not 0 as I need it to be.
var soundBA:ByteArray = new ByteArray();
var sound:Sound = new Sound();
var ch:SoundChannel = new SoundChannel();
var recordingsArray:Array = new Array();
[code]....
View 1 Replies
Mar 5, 2012
I upload a file using adobe air HTTPService.Send method by passing byte array of file content read using FileReference. When I write the set of bytes from the server side (php) it writes the details of the byte array (buff) to the file instead of contents of the file like "endian=bigEndian&position=0&bytesAvailable=61127&length=61127&objectEncoding=3" . Below I have included the code that how I read the file and send it to server. Is there anyway that i can directly pass the data in the byte array to send method?
File Read
var buff:ByteArray = new ByteArray();
var localFilePath:String = "/Videos/sample.txt";
var uploadedFile:File = new File(localFilePath);
[Code]....
View 1 Replies
Feb 1, 2009
Is there a way to write out an array without the that separates the elements in the array?
View 15 Replies
May 25, 2010
Invalid byte 1 of 1-byte UTF-8 sequencemy error is the above line.am using am calling java method using Blaze DS.
View 3 Replies
Jun 18, 2009
See below my display list pseudo root.instance178 is a swf loaded w/
vCtlrsLdr.load(reqst);
vidCtrls = MovieClip(vCtlrsLdr.content);
addChildAt(vidCtrls,2);
it is a transport control for video though the transport buttons work as a stand alone swf when the swf is loaded into the host swf they fail to respond to mouse over or clicks
[Code]...
View 1 Replies
Jun 25, 2010
I am a .NET Developer, but the question I am having is not related to .NETPlease keep this in mind even if my question sounds very trivial.This is my question:We have an swf in the browser, which communicates with a java extensionIts done using Smartfox Server(Used for MMO apllications)From the swf we are grabbing a portion of the screen as "Byte Array" in action script(3).And in Java, we are calling a function that converts the ByteArray to Image and then saves it.ur Java developer is encountering the errorSo basically, what I would like to know is this:How to accept the object type Byte Array from ActionScript in Java?Whats Java object type that is mapped to Byte Array in ActionScript?The conversion part is easy, I dare say. code in the ActionScript Section
public function savePhoto(uName:String, ba:ByteArray, descr:String):void{
var obj:Object = {};
obj.arr = ba;
[code]....
View 3 Replies
Dec 13, 2010
I have bought Learning AS 3.0 (O'Reilly) but I have been having difficulty getting one of the tutorials to run. The tutorial shows how to record data from a microphone to a byte array, playback the saved data and save as a WAV file. For some reason, I can't get this working. When the swf runs, the Flash Settings screen doesn't pop up to request permission to access the microphone but I can still trace properties such as gain.
I've uploaded a zip containing all the classes and an FLA - just use RecordMicrophone_Example.as file as the document class. Here is the problematic area of the code:
[Code]....
View 0 Replies
Oct 15, 2005
if I go to transport and keep interchanging between the two options the buttons for scrolling or forward keep freezing up after some time...not immediately, I am going nuts trying to solve this can someone tell me where I am going wrong, all the files source, text and html are (in two zipped folders)
View 14 Replies
Jan 8, 2007
how to use arrays.I have one object which changes to a different size everytime a different button is clicked. I have this on the button.
Code:
object1._xscale = 100;
object1._yscale = 100;[code]....
Now how would I put this in an arrray so I dont have to keep writing xscale, yscale everytime? In other words I want to be able to just write the values.
View 2 Replies
Aug 6, 2010
If I import an FLV video is there any way to remove the audio, put the audio into a byte array, and then re-add the audio to the flv video?
View 1 Replies
Feb 2, 2012
I have to read 2 different array of from c++ server using AS3 client. And write 2 different array of bytes to the server. How should I do it?
I have established a socket connection.
View 1 Replies
Feb 22, 2005
i want to write a function which has 2 dimensional array as one of its arguments
_global.getList = function ( type:Number, list[]:Array )
this is giving syntax error,
if i do
_global.getList = function ( type:Number, list:Array )
then there is no error, but then, list is now, single dimentional array, which i dont want.
whats the correct syntax to write it as two dimentional array ??
View 1 Replies