public void PlaySound(string soundId, int userId) { new Task(() => { var path = SoundDirectory.FullName; if (Environment.EnvironmentName == "Development") { path = SoundDirectoryDebugPlay; } var sound = this.Sounds[soundId]; //this.SshService.SendCmd($"omxplayer -o local --no-keys {Path.Combine(path, sound.FileName.Replace("!", "\\!").Replace(" ", "\\ "))} &"); this.SshService.SendCmd($"omxplayer -o local --no-keys {path}/{sound.FileName.Replace("!", "\\!").Replace(" ", "\\ ")} &"); //try //{ // IPHostEntry e = Dns.GetHostEntry(initiator); // if (e != null) // { // initiator = $"{e.HostName} ({initiator})"; // } //} //catch { } var usage = new SoundUsage() { PlayedByUserId = userId, Time = DateTime.UtcNow, SoundHash = sound.Hash }; this.Usages.Enqueue(usage); if (!UserLookup.ContainsKey(userId)) { InitUserLookup(); } User initiator = UserLookup[userId]; this.SoundHub.Clients.All.SendAsync("soundPlayed", new { Initiator = new { Name = initiator.FirstName + " " + initiator.LastName, Id = initiator.Id }, Time = DateTime.UtcNow, SoundHash = sound.Hash, FileName = sound.FileName }); }).Start(); }