Chatterer.chatterer.load_AAE_soundscape_audio C# (CSharp) Method

load_AAE_soundscape_audio() private method

private load_AAE_soundscape_audio ( ) : void
return void
        private void load_AAE_soundscape_audio()
        {
            string[] audio_file_ext = { "*.wav", "*.ogg", "*.aif", "*.aiff" };
            string sounds_path = AssemblyLoader.loadedAssemblies.GetPathByType(typeof(chatterer)) + "/../../../Sounds/AAE/soundscape/";

            if (Directory.Exists(sounds_path))
            {
                //AAE_exists = true;  //set flag to display and run AAE functions if any AAE is found

                string[] st_array;
                foreach (string ext in audio_file_ext)
                {
                    //if (debugging) Debug.Log("[CHATR] checking for " + ext + " files...");
                    st_array = Directory.GetFiles(sounds_path, ext);
                    foreach (string file in st_array)
                    {
                        //get the file name without extension
                        int start_pos = sounds_path.Length;
                        string file_name = file.Substring(start_pos);
                        int end_pos = file_name.LastIndexOf(".");
                        file_name = file_name.Substring(0, end_pos);

                        string gdb_path = "Chatterer/Sounds/AAE/soundscape/" + file_name;
                        if (GameDatabase.Instance.ExistsAudioClip(gdb_path))
                        {
                            aae_soundscapes_exist = true;
                            dict_soundscape_samples.Add(file_name, GameDatabase.Instance.GetAudioClip(gdb_path));
                            dict_soundscape_samples2.Add(GameDatabase.Instance.GetAudioClip(gdb_path), file_name);
                            //audio_soundscape.Add(GameDatabase.Instance.GetAudioClip(gdb_path));
                            //audio_list.Add(GameDatabase.Instance.GetAudioClip(gdb_path));
                            //if (debugging) Debug.Log("[muziker] " + gdb_path + " loaded OK");
                        }
                        else
                        {
                            //no ExistsAudioClip == false
                            Debug.LogWarning("[CHATR] Could not load audio " + gdb_path);
                        }
                    }
                }
            }
            else
            {
                Debug.LogWarning("Directory '" + sounds_path + "' could not be found");
            }
        }
chatterer