private void StartRecording() { isRecording = true; GameObject recorderObj = new GameObject("CriAtomRecorderInstance"); recorderInstance = recorderObj.AddComponent <CriAtomRecorderInstance>(); recorderObj.hideFlags = HideFlags.HideInHierarchy; var tempFileName = fileName; if (addTimeStampToFileName) { tempFileName += "_" + DateTime.Now.ToString("yyyyMMdd_hh_mm_ss"); } var initializer = FindObjectOfType <CriWareInitializer>(); int samplingRate = initializer.atomConfig.outputSamplingRate; recorderInstance.SetParameters(GetDataPathDirectoryOrCreate(savePath) + "/" + tempFileName, samplingRate); recorderInstance.StartRecordingCoroutine(); var fullPath = recorderInstance.GetCreatedFileFullPath(); savedFileName = Path.GetFileName(fullPath); savedDirectoryPath = fullPath.Replace(savedFileName, ""); }