/// <summary> /// Gets the data output folder for the current experiment and participant. /// /// The default participant folder is the folder where the application is running, plus /data/experiment/participant/. If you have already overridden the default, however, this will throw a warning and return your specified path. /// </summary> /// <returns>The participant folder.</returns> public static string GetParticipantFolder() { if (dataPath != null) { Debug.LogWarning("You have already set a non-default data path. Returning that instead."); return(dataPath); } string defaultRoot = ""; if (Application.isEditor) { defaultRoot = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop); } else { defaultRoot = System.IO.Path.GetFullPath("."); } defaultRoot = System.IO.Path.Combine(defaultRoot, "data"); string directory = System.IO.Path.Combine(defaultRoot, UnityEPL.GetExperimentName()); directory = System.IO.Path.Combine(directory, string.Join("", UnityEPL.GetParticipants())); return(directory); }
private void WriteWordpoolToOutputFolder(bool isCategoryPool) { string directory = UnityEPL.GetParticipantFolder(); string filename; if (isCategoryPool) { filename = "ram_categorized_en"; } else { filename = "ram_wordpool_en"; } string filePath = System.IO.Path.Combine(directory, filename); string[] ram_wordpool_lines = GetWordpoolLines(filename); if (isCategoryPool) { for (int i = 0; i < ram_wordpool_lines.Length; i++) { string line = ram_wordpool_lines[i]; string[] split_line = line.Split('\t'); ram_wordpool_lines[i] = split_line[1]; } } System.IO.Directory.CreateDirectory(directory); System.IO.File.WriteAllLines(filePath + ".txt", ram_wordpool_lines); }
void CollectKeyEvents() { if (IsMacOS()) { int eventCount = UnityEPL.CountKeyEvents(); if (eventCount >= 1) { int keyCode = UnityEPL.PopKeyKeycode(); double timestamp = UnityEPL.PopKeyTimestamp(); bool downState; keyDownStates.TryGetValue(keyCode, out downState); keyDownStates[keyCode] = !downState; ReportKey(keyCode, keyDownStates[keyCode], OSXTimestampToTimestamp(timestamp)); } } else { foreach (KeyCode keyCode in System.Enum.GetValues(typeof(KeyCode))) { if (Input.GetKeyDown(keyCode)) { ReportKey((int)keyCode, true, DataReporter.RealWorldTime()); } if (Input.GetKeyUp(keyCode)) { ReportKey((int)keyCode, false, DataReporter.RealWorldTime()); } } } }
private IEnumerator DoRecall() { VAD.DoVAD(true); highBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "high beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", "*******"); yield return(PausableWait(settings.recallTextDisplayLength)); textDisplayer.ClearText(); //path int listno = (wordsSeen / 12) - 1; string output_directory = UnityEPL.GetDataPath(); string wavFilePath = System.IO.Path.Combine(output_directory, listno.ToString() + ".wav"); string lstFilePath = System.IO.Path.Combine(output_directory, listno.ToString() + ".lst"); WriteLstFile(lstFilePath); soundRecorder.StartRecording(wavFilePath); yield return(PausableWait(settings.recallLength)); soundRecorder.StopRecording(); textDisplayer.ClearText(); lowBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "low beep" }, { "sound duration", lowBeep.clip.length.ToString() } }); VAD.DoVAD(false); }
public static void SaveState() { string filePath = SessionFilePath(session, UnityEPL.GetParticipants()[0]); string[] lines = new string[settings.numberOfLists * settings.wordsPerList + 3]; lines[0] = session.ToString(); lines[1] = wordsSeen.ToString(); lines[2] = (settings.numberOfLists * settings.wordsPerList).ToString(); if (words == null) { throw new UnityException("I can't save the state because a word list has not yet been generated"); } int i = 3; foreach (IronPython.Runtime.PythonDictionary word in words) { foreach (string key in word.Keys) { string value_string = word[key] == null ? "" : word[key].ToString(); lines[i] = lines[i] + key + ":" + value_string + ";"; } i++; } System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filePath)); System.IO.File.WriteAllLines(filePath, lines); }
void Start() { UnityEPL.SetExperimentName("prelim"); LoadWords(); LoadNumberingPool(); StartCoroutine(RunExperiment()); }
private IEnumerator DoFreeRecal(int trial_number) { textDisplayer.DisplayText("display day objects recall prompt", LanguageSource.GetLanguageString("day objects recall")); yield return(SkippableWait(RECALL_MESSAGE_DISPLAY_LENGTH)); textDisplayer.ClearText(); highBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "high beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", RECALL_TEXT); yield return(SkippableWait(RECALL_TEXT_DISPLAY_LENGTH)); textDisplayer.ClearText(); string output_directory = UnityEPL.GetDataPath(); string wavFilePath = System.IO.Path.Combine(output_directory, trial_number.ToString()) + ".wav"; Dictionary <string, object> recordingData = new Dictionary <string, object>(); recordingData.Add("trial number", trial_number); scriptedEventReporter.ReportScriptedEvent("object recall recording start", recordingData); soundRecorder.StartRecording(wavFilePath); yield return(SkippableWait(FREE_RECALL_LENGTH)); scriptedEventReporter.ReportScriptedEvent("object recall recording stop", recordingData); soundRecorder.StopRecording(); textDisplayer.ClearText(); lowBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "low beep" }, { "sound duration", lowBeep.clip.length.ToString() } }); }
private Environment EnableEnvironment() { System.Random reliable_random = new System.Random(UnityEPL.GetParticipants()[0].GetHashCode()); Environment environment = environments[reliable_random.Next(environments.Length)]; environment.parent.SetActive(true); return(environment); }
void OnDestroy() { if (IsMacOS() && nativePluginRunning) { UnityEPL.StopCocoaPlugin(); nativePluginRunning = false; } }
protected IEnumerator DoMicrophoneTest() { microphoneTestMessage.SetActive(true); bool repeat = false; string wavFilePath; do { yield return(PressAnyKey("Press any key to record a sound after the beep.")); lowBeep.Play(); textDisplayer.DisplayText("microphone test recording", "Recording..."); textDisplayer.ChangeColor(Color.red); yield return(new WaitForSeconds(lowBeep.clip.length)); wavFilePath = System.IO.Path.Combine(UnityEPL.GetDataPath(), "microphone_test_" + DataReporter.RealWorldTime().ToString("yyyy-MM-dd_HH_mm_ss") + ".wav"); soundRecorder.StartRecording(wavFilePath); yield return(new WaitForSeconds(MICROPHONE_TEST_LENGTH)); soundRecorder.StopRecording(); textDisplayer.ClearText(); yield return(new WaitForSeconds(MICROPHONE_TEST_GAP)); textDisplayer.DisplayText("microphone test playing", "Playing..."); textDisplayer.ChangeColor(Color.green); audioPlayback.clip = soundRecorder.AudioClipFromDatapath(wavFilePath); audioPlayback.Play(); yield return(new WaitForSeconds(MICROPHONE_TEST_LENGTH)); textDisplayer.ClearText(); textDisplayer.OriginalColor(); SetRamulatorState("WAITING", true, new Dictionary <string, object>()); textDisplayer.DisplayText("microphone test confirmation", "Did you hear the recording? \n(Y=Continue / N=Try Again / C=Cancel)."); while (!Input.GetKeyDown(KeyCode.Y) && !Input.GetKeyDown(KeyCode.N) && !Input.GetKeyDown(KeyCode.C)) { yield return(null); } textDisplayer.ClearText(); SetRamulatorState("WAITING", false, new Dictionary <string, object>()); if (Input.GetKey(KeyCode.C)) { Quit(); } repeat = Input.GetKey(KeyCode.N); }while (repeat); if (!System.IO.File.Exists(wavFilePath)) { yield return(PressAnyKey("WARNING: Wav output file not detected. Sounds may not be successfully recorded to disk.")); } microphoneTestMessage.SetActive(false); }
private void SetSessionNumber() { int nextSessionNumber = 0; UnityEPL.SetSessionNumber(0); while (System.IO.Directory.Exists(UnityEPL.GetDataPath())) { nextSessionNumber++; UnityEPL.SetSessionNumber(nextSessionNumber); } }
private void WriteStoreNamesFile() { string outputFilePath = System.IO.Path.Combine(UnityEPL.GetParticipantFolder(), "all_stores.txt"); List <string> allStores = new List <string>(); foreach (StoreAudio storeAudio in storeNamesToItems) { allStores.Add(LanguageSource.GetLanguageString(storeAudio.storeName)); } allStores.Sort(); System.IO.File.AppendAllLines(outputFilePath, allStores); }
private bool LanguageMismatch() { if (UnityEPL.GetParticipants()[0].Equals("unspecified_participant")) { return(false); } if (System.IO.File.ReadAllText(GetLanguageFilePath()).Equals("")) { return(false); } return(!LanguageSource.current_language.ToString().Equals(System.IO.File.ReadAllText(GetLanguageFilePath()))); }
private string GetLanguageFilePath() { string dataPath = UnityEPL.GetParticipantFolder(); System.IO.Directory.CreateDirectory(dataPath); string languageFilePath = System.IO.Path.Combine(dataPath, "language"); if (!System.IO.File.Exists(languageFilePath)) { System.IO.File.Create(languageFilePath).Close(); } return(languageFilePath); }
void Awake() { random = new System.Random(UnityEPL.GetParticipants()[0].GetHashCode()); WriteRemainingItemsFiles(); WriteAlphabetizedItemsFile(); WriteStoreNamesFile(); foreach (StoreAudio storeAudio in storeNamesToItems) { unused_store_names.Add(storeAudio.storeName); } }
private IEnumerator DoCuedRecall(int trial_number) { this_trial_presented_stores.Shuffle(new System.Random()); textDisplayer.DisplayText("display day cued recall prompt", LanguageSource.GetLanguageString("store cue recall")); yield return(SkippableWait(RECALL_MESSAGE_DISPLAY_LENGTH)); textDisplayer.ClearText(); highBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "high beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", RECALL_TEXT); yield return(SkippableWait(RECALL_TEXT_DISPLAY_LENGTH)); textDisplayer.ClearText(); foreach (StoreComponent cueStore in this_trial_presented_stores) { cueStore.familiarization_object.SetActive(true); string output_file_name = trial_number.ToString() + "-" + cueStore.GetStoreName(); string output_directory = UnityEPL.GetDataPath(); string wavFilePath = System.IO.Path.Combine(output_directory, output_file_name) + ".wav"; string lstFilepath = System.IO.Path.Combine(output_directory, output_file_name) + ".lst"; AppendWordToLst(lstFilepath, cueStore.GetLastPoppedItemName()); Dictionary <string, object> cuedRecordingData = new Dictionary <string, object>(); cuedRecordingData.Add("trial number", trial_number); cuedRecordingData.Add("store", cueStore.GetStoreName()); cuedRecordingData.Add("item", cueStore.GetLastPoppedItemName()); cuedRecordingData.Add("store position", cueStore.transform.position.ToString()); scriptedEventReporter.ReportScriptedEvent("cued recall recording start", cuedRecordingData); soundRecorder.StartRecording(wavFilePath); yield return(SkippableWait(CUED_RECALL_TIME_PER_STORE)); cueStore.familiarization_object.SetActive(false); scriptedEventReporter.ReportScriptedEvent("cued recall recording stop", cuedRecordingData); soundRecorder.StopRecording(); lowBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "low beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", RECALL_TEXT); yield return(SkippableWait(RECALL_TEXT_DISPLAY_LENGTH)); textDisplayer.ClearText(); } }
public static void ConfigureExperiment(ushort newWordsSeen, ushort newSessionNumber, IronPython.Runtime.List newWords = null) { wordsSeen = newWordsSeen; session = newSessionNumber; settings = FRExperimentSettings.GetSettingsByName(UnityEPL.GetExperimentName()); bool isEvenNumberSession = newSessionNumber % 2 == 0; bool isTwoParter = settings.isTwoParter; if (words == null) { SetWords(settings.wordListGenerator.GenerateListsAndWriteWordpool(settings.numberOfLists, settings.wordsPerList, settings.isCategoryPool, isTwoParter, isEvenNumberSession, UnityEPL.GetParticipants()[0])); } SaveState(); }
void CollectMouseEvents() { if (IsMacOS()) { int eventCount = UnityEPL.CountMouseEvents(); if (eventCount >= 1) { int mouseButton = UnityEPL.PopMouseButton(); double timestamp = UnityEPL.PopMouseTimestamp(); bool downState; mouseDownStates.TryGetValue(mouseButton, out downState); mouseDownStates[mouseButton] = !downState; ReportMouse(mouseButton, mouseDownStates[mouseButton], OSXTimestampToTimestamp(timestamp)); } } }
protected IEnumerator DoSubjectSessionQuitPrompt(int sessionNumber) { yield return(null); SetRamulatorState("WAITING", true, new Dictionary <string, object>()); textDisplayer.DisplayText("subject/session confirmation", "Running " + UnityEPL.GetParticipants()[0] + " in session " + sessionNumber.ToString() + " of " + UnityEPL.GetExperimentName() + ".\n Press Y to continue, N to quit."); while (!Input.GetKeyDown(KeyCode.Y) && !Input.GetKeyDown(KeyCode.N)) { yield return(null); } textDisplayer.ClearText(); SetRamulatorState("WAITING", false, new Dictionary <string, object>()); if (Input.GetKey(KeyCode.N)) { Quit(); } }
private int NextSessionNumber() { string dataPath = UnityEPL.GetParticipantFolder(); System.IO.Directory.CreateDirectory(dataPath); string[] sessionFolders = System.IO.Directory.GetDirectories(dataPath); int mostRecentSessionNumber = -1; foreach (string folder in sessionFolders) { int thisSessionNumber = -1; if (int.TryParse(folder.Substring(folder.LastIndexOf('_') + 1), out thisSessionNumber) && thisSessionNumber > mostRecentSessionNumber) { mostRecentSessionNumber = thisSessionNumber; } } return(mostRecentSessionNumber + 1); }
/// <summary> /// Writes data from the waitingPoints queue to disk. The waitingPoints queue will be automatically updated whenever reporters report data. /// /// DoWrite() will also be automatically be called periodically according to the settings in the component inspector window, but you can invoke this manually if desired. /// </summary> public void DoWrite() { while (waitingPoints.Count > 0) { string directory = UnityEPL.GetDataPath(); System.IO.Directory.CreateDirectory(directory); string filePath = System.IO.Path.Combine(directory, "unnamed_file"); DataPoint dataPoint = waitingPoints.Dequeue(); string writeMe = "unrecognized type"; string extensionlessFileName = "session";//DataReporter.GetStartTime ().ToString("yyyy-MM-dd HH mm ss"); switch (outputFormat) { case FORMAT.JSON_LINES: writeMe = dataPoint.ToJSON(); filePath = System.IO.Path.Combine(directory, extensionlessFileName + ".jsonl"); break; } System.IO.File.AppendAllText(filePath, writeMe + System.Environment.NewLine); } }
//this coroutine connects to ramulator and communicates how ramulator expects it to //in order to start the experiment session. follow it up with BeginNewTrial and //SetState calls public IEnumerator BeginNewSession(int sessionNumber) { //Connect to ramulator/////////////////////////////////////////////////////////////////// zmqSocket = new NetMQ.Sockets.PairSocket(); zmqSocket.Bind(address); //Debug.Log ("socket bound"); yield return(WaitForMessage("CONNECTED", "Ramulated not connected.")); //SendSessionEvent////////////////////////////////////////////////////////////////////// System.Collections.Generic.Dictionary <string, object> sessionData = new Dictionary <string, object>(); sessionData.Add("name", UnityEPL.GetExperimentName()); sessionData.Add("version", Application.version); sessionData.Add("subject", UnityEPL.GetParticipants()[0]); sessionData.Add("session_number", sessionNumber.ToString()); DataPoint sessionDataPoint = new DataPoint("SESSION", DataReporter.RealWorldTime(), sessionData); SendMessageToRamulator(sessionDataPoint.ToJSON()); yield return(null); //Begin Heartbeats/////////////////////////////////////////////////////////////////////// InvokeRepeating("SendHeartbeat", 0, 1); //SendReadyEvent//////////////////////////////////////////////////////////////////// DataPoint ready = new DataPoint("READY", DataReporter.RealWorldTime(), new Dictionary <string, object>()); SendMessageToRamulator(ready.ToJSON()); yield return(null); yield return(WaitForMessage("START", "Start signal not received")); InvokeRepeating("ReceiveHeartbeat", 0, 1); }
void Awake() { if (!startTimeInitialized) { realWorldStartTime = System.DateTime.UtcNow; unityTimeStartTime = Time.realtimeSinceStartup; stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); startTimeInitialized = true; } if (IsMacOS() && !nativePluginRunning) { OSStartTime = UnityEPL.StartCocoaPlugin(); nativePluginRunning = true; } if (QualitySettings.vSyncCount == 0) { Debug.LogWarning("vSync is off! This will cause tearing, which will prevent meaningful reporting of frame-based time data."); } }
public DataPoint(string newType, System.DateTime newTime, System.Collections.Generic.Dictionary <string, object> newDataDict) { if (newDataDict == null) { newDataDict = new System.Collections.Generic.Dictionary <string, object>(); } string[] participants = UnityEPL.GetParticipants(); if (participants != null) { for (int i = 0; i < participants.Length; i++) { string participant_key = "participant " + (i + 1).ToString(); if (!newDataDict.ContainsKey(participant_key)) { newDataDict.Add(participant_key, participants[i]); } } } if (UnityEPL.GetExperimentName() != null) { string experiment_key = "experiment"; if (!newDataDict.ContainsKey(experiment_key)) { newDataDict.Add(experiment_key, UnityEPL.GetExperimentName()); } } string session_key = "session number"; if (!newDataDict.ContainsKey(session_key)) { newDataDict.Add(session_key, UnityEPL.GetSessionNumber()); } type = newType; dataDict = newDataDict; time = newTime; }
/// <summary> /// Initializes a new instance of the <see cref="T:DataPoint"/> class. This represents a piece of data that you might want to keep about your project. /// /// "Type" is a short description of the data. Time is the time when the datapoint occured (or was collected, if it's a continuous event). /// /// dataDict contains the actual data that you might want to analyze later. Each element of the data is a key-value pair, the key representing its name. /// The value can be any C# object. If the datapoint is written to disk using a WirteToDiskHandler, the handler will try to deduce an appropriate way of /// serializing the object. This is easy for strings, integers, booleans, etc., but for other objects the object's ToString method might be used as a fallback. /// </summary> /// <param name="newType">New type.</param> /// <param name="newTime">New time.</param> /// <param name="newDataDict">New data dict.</param> public DataPoint(string newType, System.DateTime newTime, System.Collections.Generic.Dictionary <string, object> newDataDict) { if (newDataDict == null) { newDataDict = new System.Collections.Generic.Dictionary <string, object>(); } string[] participants = UnityEPL.GetParticipants(); if (participants != null) { for (int i = 0; i < participants.Length; i++) { newDataDict.Add("participant " + (i + 1).ToString(), participants[i]); } } if (UnityEPL.GetExperimentName() != null) { newDataDict.Add("experiment", UnityEPL.GetExperimentName()); } type = newType; dataDict = newDataDict; time = newTime; }
private void Update() { if (IsValidParticipantName(participantCodeInput.text)) { UnityEPL.ClearParticipants(); UnityEPL.AddParticipant(participantCodeInput.text); UnityEPL.SetExperimentName("DBOY1"); beginExperimentButton.SetActive(true); greyedOutButton.SetActive(false); int nextSessionNumber = NextSessionNumber(); UnityEPL.SetSessionNumber(NextSessionNumber()); beginButtonText.text = LanguageSource.GetLanguageString("begin session") + " " + nextSessionNumber.ToString(); } else { greyedOutButton.SetActive(true); beginExperimentButton.SetActive(false); } if (DeliveryItems.ItemsExhausted()) { beginExperimentButton.SetActive(false); finishedButton.SetActive(true); } else { finishedButton.SetActive(false); } if (LanguageMismatch()) { beginExperimentButton.SetActive(false); languageMismatchButton.SetActive(true); } else { languageMismatchButton.SetActive(false); } }
private void WriteAlphabetizedItemsFile() { string outputFilePath = System.IO.Path.Combine(UnityEPL.GetParticipantFolder(), "all_items.txt"); List <string> allItems = new List <string>(); foreach (StoreAudio storeAudio in storeNamesToItems) { AudioClip[] languageAudio; if (LanguageSource.current_language.Equals(LanguageSource.LANGUAGE.ENGLISH)) { languageAudio = storeAudio.englishAudio; } else { languageAudio = storeAudio.germanAudio; } foreach (AudioClip clip in languageAudio) { allItems.Add(clip.name); } } allItems.Sort(); System.IO.File.AppendAllLines(outputFilePath, allItems); }
public static string CurrentExperimentFolderPath() { return(System.IO.Path.Combine(Application.persistentDataPath, UnityEPL.GetExperimentName())); }
private IEnumerator DoDelivery(Environment environment, int trialNumber) { SetRamulatorState("ENCODING", true, new Dictionary <string, object>()); messageImageDisplayer.please_find_the_blah_reminder.SetActive(true); this_trial_presented_stores = new List <StoreComponent>(); List <StoreComponent> unvisitedStores = new List <StoreComponent>(environment.stores); for (int i = 0; i < DELIVERIES_PER_TRIAL; i++) { StoreComponent nextStore = null; int random_store_index = -1; int tries = 0; do { //Debug.Log(tries.ToString()); tries++; random_store_index = Random.Range(0, unvisitedStores.Count); nextStore = unvisitedStores[random_store_index]; }while (nextStore.IsVisible() && tries < 17); unvisitedStores.RemoveAt(random_store_index); playerMovement.Freeze(); messageImageDisplayer.please_find_the_blah_reminder.SetActive(false); messageImageDisplayer.SetReminderText(nextStore.GetStoreName()); yield return(DoPointingTask(nextStore)); messageImageDisplayer.please_find_the_blah_reminder.SetActive(true); playerMovement.Unfreeze(); while (!nextStore.PlayerInDeliveryPosition()) { //Debug.Log(nextStore.IsVisible()); yield return(null); } ///AUDIO PRESENTATION OF OBJECT/// if (i != DELIVERIES_PER_TRIAL - 1) { playerMovement.Freeze(); AudioClip deliveredItem = nextStore.PopItem(); string deliveredItemName = deliveredItem.name; audioPlayback.clip = deliveredItem; audioPlayback.Play(); scriptedEventReporter.ReportScriptedEvent("object presentation begins", new Dictionary <string, object>() { { "trial number", trialNumber }, { "item name", deliveredItemName }, { "store name", nextStore.GetStoreName() }, { "serial position", i + 1 }, { "player position", playerMovement.transform.position.ToString() }, { "store position", nextStore.transform.position.ToString() } }); AppendWordToLst(System.IO.Path.Combine(UnityEPL.GetDataPath(), trialNumber.ToString() + ".lst"), deliveredItemName); this_trial_presented_stores.Add(nextStore); all_presented_objects.Add(deliveredItemName); SetRamulatorState("WORD", true, new Dictionary <string, object>() { { "word", deliveredItemName } }); yield return(SkippableWait(deliveredItem.length)); SetRamulatorState("WORD", false, new Dictionary <string, object>() { { "word", deliveredItemName } }); scriptedEventReporter.ReportScriptedEvent("audio presentation finished", new Dictionary <string, object>()); playerMovement.Unfreeze(); } } messageImageDisplayer.please_find_the_blah_reminder.SetActive(false); SetRamulatorState("ENCODING", false, new Dictionary <string, object>()); }
private IEnumerator DoFinalRecall(Environment environment) { SetRamulatorState("RETRIEVAL", true, new Dictionary <string, object>()); DisplayTitle(LanguageSource.GetLanguageString("all stores recall")); highBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "high beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", RECALL_TEXT); yield return(SkippableWait(RECALL_TEXT_DISPLAY_LENGTH)); textDisplayer.ClearText(); string output_directory = UnityEPL.GetDataPath(); string output_file_name = "store recall"; string wavFilePath = System.IO.Path.Combine(output_directory, output_file_name) + ".wav"; string lstFilepath = System.IO.Path.Combine(output_directory, output_file_name) + ".lst"; foreach (StoreComponent store in environment.stores) { AppendWordToLst(lstFilepath, store.GetStoreName()); } scriptedEventReporter.ReportScriptedEvent("final store recall recording start", new Dictionary <string, object>()); soundRecorder.StartRecording(wavFilePath); yield return(SkippableWait(STORE_FINAL_RECALL_LENGTH)); scriptedEventReporter.ReportScriptedEvent("final store recall recording stop", new Dictionary <string, object>()); soundRecorder.StopRecording(); textDisplayer.ClearText(); lowBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "low beep" }, { "sound duration", lowBeep.clip.length.ToString() } }); ClearTitle(); yield return(SkippableWait(TIME_BETWEEN_DIFFERENT_RECALL_PHASES)); DisplayTitle(LanguageSource.GetLanguageString("all objects recall")); highBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "high beep" }, { "sound duration", highBeep.clip.length.ToString() } }); textDisplayer.DisplayText("display recall text", RECALL_TEXT); yield return(SkippableWait(RECALL_TEXT_DISPLAY_LENGTH)); textDisplayer.ClearText(); output_file_name = "final recall"; wavFilePath = System.IO.Path.Combine(output_directory, output_file_name) + ".wav"; lstFilepath = System.IO.Path.Combine(output_directory, output_file_name) + ".lst"; foreach (string deliveredObject in all_presented_objects) { AppendWordToLst(lstFilepath, deliveredObject); } scriptedEventReporter.ReportScriptedEvent("final object recall recording start", new Dictionary <string, object>()); soundRecorder.StartRecording(wavFilePath); yield return(SkippableWait(FINAL_RECALL_LENGTH)); scriptedEventReporter.ReportScriptedEvent("final object recall recording stop", new Dictionary <string, object>()); soundRecorder.StopRecording(); textDisplayer.ClearText(); lowBeep.Play(); scriptedEventReporter.ReportScriptedEvent("Sound played", new Dictionary <string, object>() { { "sound name", "low beep" }, { "sound duration", lowBeep.clip.length.ToString() } }); ClearTitle(); SetRamulatorState("RETRIEVAL", false, new Dictionary <string, object>()); }