Skip to main content
←API Reference ←com.nianticspatial.nsdk.recording ←RecordingExporter

exportSplitArchives


Declaration​

suspend fun exportSplitArchives( scanDirPath: String, scanId: String, maxFramesPerArchive: Int, userData: Map<String, Any>? = null, exportAsVideo: Boolean = true, exportResolution: ExportResolution = ExportResolution.HIGH, timeoutMillis: Long = TIMEOUT_MS, onProgress: ((Float) -> Unit)? = null ): AsyncResult<Array<String>, Nothing>

Summary​

Asynchronously exports a scan recording as multiple archive files.


This function suspends execution until the export operation is complete,
has failed, or has timed out.

Returns​

An AsyncResult which will be either AsyncResult.Success containing the path to the exported file, or AsyncResult.Timeout.

Throws​

  • java.lang.NullPointerException — if any of the map's keys are null.
  • ArdkNullArgumentStatusException — if the scanId is empty.
  • ArdkInvalidArgumentStatusException — if no export with scanId could be found.
  • ArdkInvalidOperationStatusException — if the export is not complete, or there was no data exported.

Parameters​

NameTypeSummary
scanDirPathString
The base directory path where the export will be saved
scanIdString
The unique identifier of the scan to export
maxFramesPerArchiveInt
The maximum number of frames to include in each archive of the exported recording. Must be greater than 0.
userDataMap<String, Any>?
-
exportAsVideoBoolean
If true, the RGB frames in the scan will be exported as an .mp4 video. If false, they will be individual image files.
exportResolutionExportResolution
Resolution option for exported images (default: [ExportResolution.HIGH]).
timeoutMillisLong
How long to wait for the export, 10 seconds by default ([TIMEOUT_MS]). When it passes, the export is aborted and [AsyncResult.Timeout] is returned. Large scans can take longer than the default: pass a larger value for them. Cancelling the calling coroutine also aborts the export.
onProgress((Float) -> Unit)?
Called on the calling coroutine with export progress in [0, 1].