public void PlayAudio(string filename, AudioType type, int channel, float volume, float fadeintime = 0)
        {
            float startvolume = volume;

            if (fadeintime > 0f)
            {
                fadeintime /= 1000f;
                startvolume = 0f;
            }
            AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(type, channel)];

            if (audioLayer.IsPlaying())
            {
                audioLayer.StopAudio();
            }
            bool loop = type == AudioType.BGM;

            if (type == AudioType.BGM)
            {
                if (currentAudio[AudioType.BGM].ContainsKey(channel))
                {
                    currentAudio[AudioType.BGM].Remove(channel);
                }
                currentAudio[AudioType.BGM].Add(channel, new AudioInfo(volume, filename));
            }
            audioLayer.PlayAudio(filename, type, startvolume, loop);
            if (fadeintime > 0.05f)
            {
                audioLayer.StartVolumeFade(volume, fadeintime);
            }
        }
        public void MODPlayVoiceLS(string filename, int channel, float volume, int character)
        {
            MODTextController.MODCurrentVoiceLayerDetect = channel;
            AudioLayer item = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];

            if (currentAudio[AudioType.Voice].ContainsKey(channel))
            {
                currentAudio[AudioType.Voice].Remove(channel);
            }
            currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
            if (item.IsPlaying())
            {
                item.StopAudio();
            }
            item.PlayAudio(filename, AudioType.Voice, volume);
            if (MODSystem.instance.modSceneController.MODLipSyncBoolCheck(character))
            {
                GameSystem.Instance.SceneController.MODLipSyncStart(character, channel, filename);
            }
            if (GameSystem.Instance.IsAuto)
            {
                item.OnLoadCallback(delegate
                {
                    GameSystem.Instance.AddWait(new Wait(item.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                });
            }
        }
 public void StopAllAudio()
 {
     for (int i = 0; i < 6; i++)
     {
         AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(AudioType.BGM, i)];
         if (audioLayer.IsPlaying())
         {
             audioLayer.StopAudio();
         }
     }
     for (int j = 0; j < 8; j++)
     {
         AudioLayer audioLayer2 = channelDictionary[GetChannelByTypeChannel(AudioType.SE, j)];
         if (audioLayer2.IsPlaying())
         {
             audioLayer2.StopAudio();
         }
     }
     for (int k = 0; k < 8; k++)
     {
         AudioLayer audioLayer3 = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, k)];
         if (audioLayer3.IsPlaying())
         {
             audioLayer3.StopAudio();
         }
     }
 }
        public void StopVoice(int channel)
        {
            AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];

            audioLayer.StopAudio();
            if (currentAudio[AudioType.Voice].ContainsKey(channel))
            {
                currentAudio[AudioType.Voice].Remove(channel);
            }
        }
        public void PlaySE(string filename, int channel, float volume, float pan)
        {
            AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(AudioType.SE, channel)];

            if (audioLayer.IsPlaying())
            {
                audioLayer.StopAudio();
            }
            audioLayer.PlayAudio(filename, AudioType.SE, volume);
        }
        public void StopBGM(int channel)
        {
            AudioLayer audioLayer = channelDictionary[channel];

            audioLayer.StopAudio();
            if (currentAudio[AudioType.BGM].ContainsKey(channel))
            {
                currentAudio[AudioType.BGM].Remove(channel);
            }
        }
 public void StopAllVoice()
 {
     for (int i = 0; i < 8; i++)
     {
         AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, i)];
         if (audioLayer.IsPlaying())
         {
             audioLayer.StopAudio();
         }
     }
 }
        public void PlayVoice(string filename, int channel, float volume)
        {
            MODTextController.MODCurrentVoiceLayerDetect = channel;
            AudioLayer audio = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];

            if (currentAudio[AudioType.Voice].ContainsKey(channel))
            {
                currentAudio[AudioType.Voice].Remove(channel);
            }
            currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
            if (audio.IsPlaying())
            {
                audio.StopAudio();
            }
            audio.PlayAudio(filename, AudioType.Voice, volume);
            if (GameSystem.Instance.IsAuto)
            {
                audio.OnLoadCallback(delegate
                {
                    GameSystem.Instance.AddWait(new Wait(audio.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                });
            }
        }
        public void PlayVoice(string filename, int channel, float volume)
        {
            string text = filename.Substring(0, 4);
            bool   flag = false;

            switch (text)
            {
            case "chie":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVChie").BoolValue();
                break;

            case "eiji":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVEiji").BoolValue();
                break;

            case "kana":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVKana").BoolValue();
                break;

            case "kira":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVKira").BoolValue();
                break;

            case "mast":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVMast").BoolValue();
                break;

            case "mura":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVMura").BoolValue();
                break;

            case "riho":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVRiho").BoolValue();
                break;

            case "rmn_":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVRmn_").BoolValue();
                break;

            case "sari":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVSari").BoolValue();
                break;

            case "tika":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVTika").BoolValue();
                break;

            case "yayo":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVYayo").BoolValue();
                break;

            default:
                flag = BurikoMemory.Instance.GetGlobalFlag("GVOther").BoolValue();
                break;
            }
            if (!flag)
            {
                AudioLayer audio = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];
                if (currentAudio[AudioType.Voice].ContainsKey(channel))
                {
                    currentAudio[AudioType.Voice].Remove(channel);
                }
                currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
                if (audio.IsPlaying())
                {
                    audio.StopAudio();
                }
                audio.PlayAudio(filename, AudioType.Voice, volume);
                if (GameSystem.Instance.IsAuto)
                {
                    audio.OnLoadCallback(delegate
                    {
                        GameSystem.Instance.AddWait(new Wait(audio.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                    });
                }
            }
        }
        public void StopSE(int channel)
        {
            AudioLayer audioLayer = channelDictionary[GetChannelByTypeChannel(AudioType.SE, channel)];

            audioLayer.StopAudio();
        }