mazarelo edited a comment on issue #178:
URL:
https://github.com/apache/cordova-plugin-media/issues/178#issuecomment-733000078
I have the same problem:
`"cordova-android": "^9.0.0"`
I minimized the code to a bare minimum to test it:
```ts
async recordDemo() {
const audioId = 'test.mp3';
const path = this.filesService.getAudioDataDirectory() + '/' + audioId;
const audio = this.media.create(path);
// listeners
audio.onStatusUpdate.subscribe(status => console.log('state:', status));
audio.onSuccess.subscribe(() => console.log('Action is successful'));
audio.onError.subscribe(error => console.log('Error!', error));
// Errors when executing startRecord() here with { code: 1 }
audio.startRecord();
// Delay to stop
setTimeout(() => {
audio.stopRecord();
audio.release();
}, 3000);
}
```
and output as soon as `audio.startRecording()` is triggered, I get error: {
code: 1 }
Both listeners then return "Action is successful" from the `onSuccess` and
"state: 4" from `onStatusUpdate`
A few permissions were requested and are granted:
```ts
await this.androidPermissions.requestPermissions([
this.androidPermissions.PERMISSION.RECORD_AUDIO,
this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE,
this.androidPermissions.PERMISSION.MODIFY_AUDIO_SETTINGS,
]);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]