On Thursday, February 13, 2014 2:54:03 PM UTC+1, Steve wrote: > > There's an exportWAV within Recorder.js which returns a blob (see below) > which I could hold in a JavaScriptObject, would that be sufficient? however > i still don't know how to send this object to the server and then allow > other clients to retrieve the blob and play it. Are you suggesting that I > shouldn't send the wav/ogg to the server using RPC either? >
That's right. You should use an XMLHttpRequest which can send a Blob without prior conversion needed: http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-send As I said, you'd have to call the send() method using JSNI, given that com.google.gwt.xhr.client.XMLHttpRequest only exposes send() without argument or with a String. You could also possibly use a FormData if you want/need to send other data with your "file". > > rec.exportWAV([callback][, type]) > > *This will generate a Blob object containing the recording in WAV format. > The callback will be called with the Blob as its sole argument. If a > callback is not specified, the default callback (as defined in the config) > will be used. If no default has been set, an error will be thrown.* > > *In addition, you may specify the type of Blob to be returned (defaults to > 'audio/wav').* > > On Thursday, 13 February 2014 13:11:36 UTC, RyanZA wrote: >> >> You definitely don't want to be sending raw audio over the web to your >> server - it's huge. What you want to do is take that raw audio, convert it >> to an ogg or similar using something like >> https://github.com/muaz-khan/WebRTC-Experiment/tree/master/ffmpeg >> Then you'd take the ogg output and upload it to your server using an http >> post as converting the ogg to base64 would probably use a lot of ram. >> >> GWT-RPC to transfer raw wav data is just right out >> >> On Wednesday, February 12, 2014 8:12:48 PM UTC+2, Steve wrote: >>> >>> Would using a JSONObject to send the buffers to the server help? >>> >>> e.g. >>> >>> JSONObject jsonValue = new JSONObject(myJSObject); >>> >>> >>> and then using the following to convert the JSON object back? >>> >>> JavaScriptObject jsObject = jsonValue.getJavaScriptObject(); >>> >>> -- 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.
