Skip to content

Failed to start recording using AVAudioRecorder: (null) code:1Β #396

@phiasco12

Description

@phiasco12

Bug Report

Failed to start recording using AVAudioRecorder: (null) code:1

Problem

when I try the simple code provided, I get the above error.

What is expected to happen?

Start recording Audio.

What does actually happen?

the above error happens.

Information

This is my code:

    var src = cordova.file.cacheDirectory + "myrecording.wav";
    //var src = "myrecording.wav";
    var mediaRec = new Media(src,
        // Success callback
        function() {
            alert("Recording success");
        },

        // Error callback
        function(err) {
            alert("Recording error: " + JSON.stringify(err));
        });

    // Start recording
    mediaRec.startRecord();

when I run this code, I get the above error. This is tested on iOS 17.1

I have the Audio permission set as well before calling this function/code.

Command or Code

Environment, Platform, Device

iOS 17.1 iPhone Pro

Version information

Checklist

  • [ x] I searched for existing GitHub issues
  • [ x] I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions