Skip to content

Commit 6256df9

Browse files
committed
feat: recorder options for Android
1 parent b76e6bc commit 6256df9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

demo/app/main-view-model.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,17 @@ export class AudioDemo extends Observable {
4040
let androidEncoder;
4141
if (platform.isAndroid) {
4242
// m4a
43-
if (android.media.MediaRecorder) {
44-
for (let key in android.media.MediaRecorder) {
45-
console.log(key);
46-
}
47-
}
43+
// static constants are not available, using raw values here
4844
// androidFormat = android.media.MediaRecorder.OutputFormat.MPEG_4;
4945
androidFormat = 2;
5046
// androidEncoder = android.media.MediaRecorder.AudioEncoder.AAC;
5147
androidEncoder = 3;
5248
}
5349

50+
let recordingPath = `${audioFolder.path}/recording.${this.platformExtension()}`;
5451
let recorderOptions: AudioRecorderOptions = {
5552

56-
filename: `${audioFolder.path}/recording.${this.platformExtension()}`,
53+
filename: recordingPath,
5754

5855
format: androidFormat,
5956

0 commit comments

Comments
 (0)