You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "jcesarmobile (Jira)" <ji...@apache.org> on 2020/06/24 15:58:00 UTC

[jira] [Closed] (CB-12742) Could not record audio at 'documents://beer.m4a'

     [ https://issues.apache.org/jira/browse/CB-12742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jcesarmobile closed CB-12742.
-----------------------------
    Resolution: Invalid

closing as invalid, documents://test.m4a is not a valid path. 
If the file is in the www folder you should just use the relative path to it, if not there, you need file plugin or other plugin to get the file path

> Could not record audio at 'documents://beer.m4a'
> ------------------------------------------------
>
>                 Key: CB-12742
>                 URL: https://issues.apache.org/jira/browse/CB-12742
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-media
>         Environment: iOS 10.2.1 (14D27)
> Cordova: 6.5.0
>            Reporter: Paedly
>            Priority: Major
>
> {code:javascript}
> var voiceMessage;
> function recordVoiceMessage() {
>   // tested direct file:// path, without folder and with documents://
>   voiceMessage = new Media(
>     'documents://test.m4a',
>     function() { },
>     function() {
>       alert('SUCCESS');
>     },
>     function(error) {
>       alert(JSON.stringify(error));
>     }
>   );
>   voiceMessage.startRecord();
> }
> function stopRecordVoiceMessage() {
>   voiceMessage.stopRecord();
>   voiceMessage.release();
>   var speechmemeUri = 'test.m4a';
>   this.file.readAsText(LocalFileSystem.TEMPORARY, speechmemeUri).then(function(res) {
>     alert('OK: ' + JSON.stringify(res));
>   }, function(err) { alert('ERR: ' + JSON.stringify(err)); });
>   this.file.readAsDataURL(LocalFileSystem.PERSISTENT, speechmemeUri).then(function(res) {
>     alert('OK: ' + JSON.stringify(res));
>   }, function(err) { alert(JSON.stringify(err)); });
> }
> {code}
> This is the script I tested with.
> If I want to record I get this messages.
> 1. Cannot use audio file from resource 'test.m4a'
> 2. Could not record audio at 'test.m4a'
> **And**
> 1. Cannot use audio file from resource 'file:///private/var/mobile/Containers/Data/Application/7381F546-C6A9-444F-A49A-CCAFFAF5B7A0/tmp/test.m4a'
> 2. Could not record audio at 'file:///private/var/mobile/Containers/Data/Application/7381F546-C6A9-444F-A49A-CCAFFAF5B7A0/tmp/test.m4a'
> **And**
> 1. Cannot use audio file from resource 'documents://test.m4a'
> 2. Could not record audio at 'documents://test.m4a'
> The question is why?
> Must I enable something special that cordova / ionic is able to write to the storage of the device?
> Or whats wrong with this?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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