Using nativescript-audio's TNSRecorder for Android in our RecordModel

We could use some fancy Android APIs and/or libraries for our recorder, but in this case, the nativescript-audio plugin we're using for our cross-platform multitrack player also provides a cross-platform recorder. We could have even used it with iOS, but we wanted to specifically work with AudioKit's powerful APIs there. However, here on Android, let's use the recorder from the plugin and make the following modifications to record.model.android.ts:

import { Observable } from 'data/observable';import { IRecordModel, IRecordEvents, RecordState, documentsFilePath } from './common';import { TNSRecorder, AudioRecorderOptions } from 'nativescript-audio';import { Subject } from ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.