>
> Why are you using JSNI to call StoreAudio, and/or why are you calling it 
> from this storeAudioCallback method rather than right from your callback in 
> StoreAudioJSNI?
> (anyway, that doesn't change your issue).
>  
>

I want to call StoreAudio once the buffers have been returned from the 
Recorder.js getBuffer() method. So my understanding was that i would have 
to call GetBuffer first which will return the buffers to storeAudioCallback 
and from there I can pass the buffers onto StoreAudio which in turn can 
pass them onto the server. Would this not be the right way to do it?

 

>
> The problem has nothing to do with JSNI: you cannot send a 
> JavaScriptObject through GWT-RPC. A JavaScriptObject is a "view" (a 
> "handle", a "pointer") on an object that lives in the browser, it has no 
> meaning on the server-side, and GWT would not know how to serialize it 
> through GWT-RPC.
>
> To send the audio to your server, you'll have to either use XMLHttpRequest 
> (knowing that the "buffers" is an array of 2 
> Float32Arrays<http://www.gwtproject.org/javadoc/latest/com/google/gwt/typedarrays/client/Float32ArrayNative.html>;
>  
> you'll have to use JSNI to send them though, as 
> com.google.gwt.xhr.client.XMLHttpRequest only allows sending a String), or 
> convert the data to non-JavaScriptObject objects that could be sent through 
> GWT-RPC (beware the performance! those buffers probably are huge, so 
> GWT-RPC definitely isn't the way to go here)
>

Can JavaScriptObjects definitely not be sent to the server? the MyJSObject 
class is my own class which extends JavaScriptObject and implements 
IsSerializable. When i manually call StoreAudio by creating an instance of 
MyJSObject just to test if the call is happening, it seems to work and the 
RPC call is made however its only when i'm making the call after the JSNI 
calback that calling audioRecordService.StoreAudio(mjo, callback); does not 
call my server side method.

Unfortunately i will have to use RPC to send the data to the server as i'm 
building this recording functionality as part of an existing application 
which uses RPC to send data to the server and the recording functionality 
i'm putting together should ideally plug into the existing implementation. 
If you're 100% sure sending the JavaScript object will not work, what could 
i convert these to when making the RPC call? I will also need to convert 
these back to the buffers (JavaScriptObject) to play the audio back, which 
is why i thought i could just store these as they are returned by 
Recorder.js, store them on the server and then retrieve them from the 
server and call the appropriate function within Recorder.js when the audio 
was to be played again.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to