Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async startRecord(args) {
try {
if (!TNSRecorder.CAN_RECORD()) {
dialogs.alert('This device cannot record audio.');
return;
}
const audioFolder = knownFolders.currentApp().getFolder('audio');
console.log(JSON.stringify(audioFolder));
let androidFormat;
let androidEncoder;
if (platform.isAndroid) {
// m4a
// static constants are not available, using raw values here
// androidFormat = android.media.MediaRecorder.OutputFormat.MPEG_4;
androidFormat = 2;
// androidEncoder = android.media.MediaRecorder.AudioEncoder.AAC;
androidEncoder = 3;
}