You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Kerri Shotts (JIRA)" <ji...@apache.org> on 2016/07/27 17:42:20 UTC

[jira] [Commented] (CB-11603) captureAudio on iOS 9.2+ can't record more than 2 seconds

    [ https://issues.apache.org/jira/browse/CB-11603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15396040#comment-15396040 ] 

Kerri Shotts commented on CB-11603:
-----------------------------------

You're conflating an upload problem vs a recording problem. I'm assuming you can indeed record audio for longer than 2 seconds, just that the upload of that recording fails. If this is not the case, please let us know.

Assuming the problem is with uploading:

All you post is how you are reading the file contents into a variable. You don't share how you're sending that information to your server. Without that, it's going to be hard to help. Furthermore, base64 is increasing the recording size by 33%, which, for a long recording, could be straining device resources.

My suggestion would be to use the File Transfer plugin instead, because I'm guessing you're running into a memory limit somewhere. The FT plugin uses native code to perform the transfer, and shouldn't incur the hit of transferring large files over the native bridge. 

> captureAudio on iOS 9.2+ can't record more than 2 seconds
> ---------------------------------------------------------
>
>                 Key: CB-11603
>                 URL: https://issues.apache.org/jira/browse/CB-11603
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>         Environment: Cordova CLI: 6.1.1
> Gulp version:  CLI version 3.9.1
> Gulp local:
> Ionic Framework Version: 1.3.1-nightly-3792
> Ionic CLI Version: 1.7.16
> Ionic App Lib Version: 0.7.3
> ios-deploy version: 1.8.2
> ios-sim version: 5.0.8
> OS: Mac OS X El Capitan
> Node Version: v5.0.0
> Xcode version: Xcode 7.3.1 Build version 7D1014
>            Reporter: James Manlapid
>            Priority: Critical
>
> I'm using https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media-capture/ and on iOS v. 9.2+ it won't allow me to upload recordings greater than 2 seconds. The same code works for Android and can capture audio for more than 2 seconds. I'm using a file reader to get the base64 string of the whole recording and uploading it to a server.
>  var audioFile = audioFiles[0],
>                 fileReader = new FileReader(),
>                 file;
>             fileReader.onload = function (readerEvt) {
>                 var base64 = readerEvt.target.result;
>                 saveRecording(base64);
>             };
>             file = new window.File(audioFile.name, audioFile.localURL, 
>                                    audioFile.type, audioFile.lastModifiedDate, audioFile.size);
>             fileReader.readAsDataURL(file);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org