import { Media, MediaObject } from '@awesome-cordova-plugins/media/ngx';
import { File } from '@awesome-cordova-plugins/file/ngx';
...
constructor(private media: Media, private file: File) { }
...
this.file.createFile(this.file.tempDirectory, 'my_file.m4a', true).then(() => {
let file = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a');
file.startRecord();
window.setTimeout(() => file.stopRecord(), 10000);
});