示例#1
0
        // Backup requests
        public static async void ReceiveBackupRequest(string CallSign, int departmentID, int playerNetworkID, int ResponseCode)
        {
            Common.DebugMessage("Received backup information");
            List <string> soundFiles = new List <string>();

            soundFiles.Add(@"EFFECTS/INTRO_01.ogg");
            List <string> SearchFiles = AudioLibrary.availableAudio.Where(x => x.StartsWith(@"ATTENTION_ALL_UNITS_GEN/ATTENTION_ALL_UNITS_GENERIC_")).ToList();

            soundFiles.Add(SearchFiles[random.Next(0, SearchFiles.Count)]);

            if (ResponseCode == 99)
            {
                Common.DebugMessage("Code 99!");
                SearchFiles = AudioLibrary.availableAudio.Where(x => x.StartsWith(@"OFFICER_REQUESTS_BACKUP/CODE99")).ToList();
                soundFiles.Add(SearchFiles[random.Next(0, SearchFiles.Count)]);
                soundFiles.Add(@"EFFECTS/OUTRO_01.ogg");

                await AudioHandler.PlayCode99(soundFiles.ToArray());
            }
            else
            {
                soundFiles.Add(@"OFFICER_REQUESTS_BACKUP/OFFICER_REQUESTING_BACKUP.ogg");
                if (ResponseCode > 1)
                {
                    soundFiles.Add(@"DISPATCH_RESPOND_CODE/RESPOND_CODE_" + ResponseCode.ToString() + ".ogg");
                }
                soundFiles.Add(@"EFFECTS/OUTRO_01.ogg");
                Common.DebugMessage("Finished creating playlist, adding it to dispatch queue");
                if (dispatchQueue.Count <= Settings.MaxDispatchQueue)
                {
                    dispatchQueue.Add(soundFiles.ToArray());
                }
            }
        }
示例#2
0
文件: Main.cs 项目: PBogi/FivePDAudio
 private static async Task OnTick()
 {
     await AudioHandler.Play();
 }