Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Audio Recorder

There are no errors in the console i guess.
Can i know which code to put in the button event? Isit this code?

navigator.device.capture.captureAudio(
CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]
);

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Audio Recorder

Hello Lim,

Could you try this way:

codefunction captureSuccess(mediaFiles) {
var i, len;
for (i = 0, len = mediaFiles&#46;length; i < len; i += 1) {
&#47;&#47;do something with mediaFiles
}
}

&#47;&#47; Called if something bad happens&#46;
&#47;&#47;
function captureError(error) {
var msg = 'An error occurred during capture: ' + error&#46;code;
navigator&#46;notification&#46;alert(msg, null, 'Uh oh!');
}

&#47;&#47; A button will call this function
&#47;&#47;
function captureAudio() {
&#47;&#47; Launch device audio recording application,
&#47;&#47; allowing user to capture up to 1 audio clips
navigator&#46;device&#46;capture&#46;captureAudio(captureSuccess, captureError, {limit: 1});
}/code
You may find more info here: http://cordova.apache.org/docs/en/3.3...

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Audio Recorder

Hi, i added the codes in my button event.
When I run my application and wish to test it, i click on the 'record your voice'. but nothing happens. how do i know if it is recorded??
please assist. thanks

Image Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Audio Recorder

Hello Lim,

Please clarify, do you perform "Full example" as it is described here:
http://cordova.apache.org/docs/en/3.3... ?

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Audio Recorder

hi yes. i followed the 'full example' as shown.

Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Audio Recorder

Lim,

You don't do anything with the files. There, where there is the comment in the code
pre&#47;&#47;do something with mediaFiles/pre
you should add code which will send the file to the database. You may read more here: https://getsatisfaction.com/apperyio/...

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Audio Recorder

in my case, i would like to send audio files to the database.

what codes should i add? able to provide me?

thank you

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Audio Recorder

Hello,

Please show us what you have tried.
Please read post Evgene suggested.

Lim Samantha
Posts: 0
Joined: Wed Jun 11, 2014 6:50 am

Audio Recorder

hi, i followed this tutorial: http://devcenter.appery.io/tutorials/... but still does not save into database. please assist me.
how do i record my voice without start and stop button?

anyway here are the steps i did:

Image

added the upload files codes here:
Image

and the success and error codes here:
Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Audio Recorder

Hello Lim,

Could you please try to send files this way: https://getsatisfaction.com/apperyio/...
Not through uploadMultipleFilesHelper

Return to “Issues”