The last point of interest from RecordModel might be the save method, which will export our recording from the app's tmp directory to the app's documents folder while converting it to the smaller filesize .m4a audio format:
this._recorder.audioFile .exportAsynchronouslyWithNameBaseDirExportFormatFromSampleToSampleCallback( fileName, BaseDirectory.Documents, ExportFormat.M4a, null, null, (af: AKAudioFile, err: NSError) => { this.savedFilePath = documentsFilePath(fileName); });
Long method name, right? Yes, indeed; some Swift/ObjC parameterized method names collapse to become very long. That particular method in Swift is defined as follows:
exportAsynchronously(name:baseDir:exportFormat:fromSample:toSample:callback:) ...