]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Unrevert audio (#21330)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Mon, 27 Nov 2023 11:12:34 +0000 (22:12 +1100)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2023 11:12:34 +0000 (22:12 +1100)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
288 files changed:
Content.Client/Audio/AmbientSoundSystem.cs
Content.Client/Audio/BackgroundAudioSystem.cs
Content.Client/Audio/ClientGlobalSoundSystem.cs
Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Content.Client/Audio/ContentAudioSystem.cs
Content.Client/Changelog/ChangelogTab.xaml.cs
Content.Client/Credits/CreditsWindow.xaml.cs
Content.Client/Disposal/Systems/DisposalUnitSystem.cs
Content.Client/Doors/DoorSystem.cs
Content.Client/GameTicking/Managers/ClientGameTicker.cs
Content.Client/Gravity/GravitySystem.Shake.cs
Content.Client/Guidebook/GuidebookSystem.cs
Content.Client/Info/RulesAndInfoWindow.cs
Content.Client/IoC/StaticIoC.cs
Content.Client/Light/Components/ExpendableLightComponent.cs
Content.Client/Light/EntitySystems/ExpendableLightSystem.cs
Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs
Content.Client/Options/UI/Tabs/AudioTab.xaml.cs
Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs
Content.Client/Replay/ContentReplayPlaybackManager.cs
Content.Client/Traits/ParacusiaSystem.cs
Content.Client/Trigger/TimerTriggerVisualizerSystem.cs
Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs
Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
Content.Client/Voting/VoteManager.cs
Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs
Content.Client/Weather/WeatherSystem.cs
Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
Content.MapRenderer/Painters/DecalPainter.cs
Content.MapRenderer/Painters/EntityPainter.cs
Content.MapRenderer/Painters/TilePainter.cs
Content.Packaging/Content.Packaging.csproj
Content.Packaging/ServerPackaging.cs
Content.Server/Access/Systems/AccessOverriderSystem.cs
Content.Server/Administration/Systems/AdminSystem.cs
Content.Server/AlertLevel/AlertLevelSystem.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Server/Ame/EntitySystems/AmePartSystem.cs
Content.Server/Animals/Systems/EggLayerSystem.cs
Content.Server/Anomaly/AnomalySynchronizerSystem.cs
Content.Server/Anomaly/AnomalySystem.Generator.cs
Content.Server/Anomaly/AnomalySystem.cs
Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs
Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs
Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs
Content.Server/Antag/AntagSelectionSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs
Content.Server/Atmos/Components/GasTankComponent.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs
Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
Content.Server/Audio/ContentAudioSystem.cs
Content.Server/Beam/BeamSystem.cs
Content.Server/Bed/Sleep/SleepingSystem.cs
Content.Server/Bible/BibleSystem.cs
Content.Server/Body/Systems/BloodstreamSystem.cs
Content.Server/Body/Systems/BodySystem.cs
Content.Server/Botany/Systems/PlantHolderSystem.cs
Content.Server/CardboardBox/CardboardBoxSystem.cs
Content.Server/Cargo/Systems/CargoSystem.cs
Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs
Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs
Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs
Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs
Content.Server/Cloning/CloningSystem.cs
Content.Server/Cluwne/CluwneSystem.cs
Content.Server/Construction/Completions/PlaySound.cs
Content.Server/Construction/Components/PartExchangerComponent.cs
Content.Server/Construction/PartExchangerSystem.cs
Content.Server/Crayon/CrayonSystem.cs
Content.Server/Defusable/Systems/DefusableSystem.cs
Content.Server/Destructible/DestructibleSystem.cs
Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs
Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs
Content.Server/DeviceLinking/Systems/LogicGateSystem.cs
Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs
Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Content.Server/Dice/DiceSystem.cs
Content.Server/Disposal/Tube/DisposalTubeSystem.cs
Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs
Content.Server/Dragon/DragonRiftSystem.cs
Content.Server/Dragon/DragonSystem.cs
Content.Server/Electrocution/ElectrocutionSystem.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Content.Server/Extinguisher/FireExtinguisherSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Flash/FlashSystem.cs
Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs
Content.Server/Fluids/EntitySystems/DrainSystem.cs
Content.Server/Fluids/EntitySystems/PuddleSystem.cs
Content.Server/Fluids/EntitySystems/SpraySystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/GameTicking/GameTicker.Player.cs
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Server/GameTicking/GameTicker.cs
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Content.Server/GameTicking/Rules/PiratesRuleSystem.cs
Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Content.Server/Gateway/Systems/GatewaySystem.cs
Content.Server/Gatherable/GatherableSystem.cs
Content.Server/Glue/GlueSystem.cs
Content.Server/Guardian/GuardianSystem.cs
Content.Server/Holiday/Christmas/RandomGiftSystem.cs
Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs
Content.Server/ImmovableRod/ImmovableRodSystem.cs
Content.Server/Interaction/InteractionPopupSystem.cs
Content.Server/Item/ItemToggleSystem.cs
Content.Server/Kitchen/Components/MicrowaveComponent.cs
Content.Server/Kitchen/Components/ReagentGrinderComponent.cs
Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/Light/EntitySystems/ExpendableLightSystem.cs
Content.Server/Light/EntitySystems/HandheldLightSystem.cs
Content.Server/Light/EntitySystems/LightBulbSystem.cs
Content.Server/Light/EntitySystems/LightReplacerSystem.cs
Content.Server/Light/EntitySystems/MatchstickSystem.cs
Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs
Content.Server/Lube/LubeSystem.cs
Content.Server/Magic/MagicSystem.cs
Content.Server/MassMedia/Systems/NewsSystem.cs
Content.Server/Materials/MaterialStorageSystem.cs
Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs
Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs
Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs
Content.Server/Medical/DefibrillatorSystem.cs
Content.Server/Medical/HealingSystem.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Content.Server/Medical/VomitSystem.cs
Content.Server/Mind/MindSystem.cs
Content.Server/Morgue/CrematoriumSystem.cs
Content.Server/Morgue/MorgueSystem.cs
Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs
Content.Server/NPC/Systems/NPCCombatSystem.cs
Content.Server/Ninja/Systems/BatteryDrainerSystem.cs
Content.Server/Ninja/Systems/SpaceNinjaSystem.cs
Content.Server/Ninja/Systems/StunProviderSystem.cs
Content.Server/Nuke/NukeComponent.cs
Content.Server/Nuke/NukeSystem.cs
Content.Server/Nutrition/Components/FatExtractorComponent.cs
Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs
Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs
Content.Server/Nutrition/EntitySystems/DrinkSystem.cs
Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs
Content.Server/Nutrition/EntitySystems/FoodSystem.cs
Content.Server/Nutrition/EntitySystems/OpenableSystem.cs
Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs
Content.Server/Nutrition/EntitySystems/UtensilSystem.cs
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Paper/PaperSystem.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs
Content.Server/Pinpointer/ProximityBeeperSystem.cs
Content.Server/Plants/Systems/PottedPlantHideSystem.cs
Content.Server/Points/PointSystem.cs
Content.Server/Polymorph/Systems/PolymorphSystem.cs
Content.Server/Power/EntitySystems/ApcSystem.cs
Content.Server/Power/EntitySystems/PowerReceiverSystem.cs
Content.Server/Power/Generator/PortableGeneratorSystem.cs
Content.Server/Power/Generator/PowerSwitchableSystem.cs
Content.Server/PowerSink/PowerSinkSystem.cs
Content.Server/Radiation/Systems/GeigerSystem.cs
Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs
Content.Server/RoundEnd/RoundEndSystem.cs
Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs
Content.Server/Salvage/SalvageSystem.Expeditions.cs
Content.Server/Salvage/SalvageSystem.Runner.cs
Content.Server/Salvage/SalvageSystem.cs
Content.Server/Shuttles/Components/FTLComponent.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Server/Silicons/Laws/SiliconLawSystem.cs
Content.Server/Singularity/EntitySystems/SingularitySystem.cs
Content.Server/Speech/EntitySystems/VocalSystem.cs
Content.Server/Speech/SpeechNoiseSystem.cs
Content.Server/SprayPainter/SprayPainterSystem.cs
Content.Server/StationEvents/Events/StationEventSystem.cs
Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs
Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Server/Stunnable/Systems/StunbatonSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs
Content.Server/Teleportation/HandTeleporterSystem.cs
Content.Server/Toilet/ToiletSystem.cs
Content.Server/Tools/ToolSystem.cs
Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs
Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs
Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs
Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs
Content.Server/Zombies/ZombieSystem.Transform.cs
Content.Shared/Actions/SharedActionsSystem.cs
Content.Shared/Anomaly/SharedAnomalySystem.cs
Content.Shared/Audio/SharedAmbientSoundSystem.cs
Content.Shared/Audio/SharedContentAudioSystem.cs
Content.Shared/Blocking/BlockingSystem.User.cs
Content.Shared/Blocking/Components/BlockingComponent.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Content.Shared/Buckle/SharedBuckleSystem.cs
Content.Shared/CCVar/CCVars.cs
Content.Shared/Cabinet/SharedItemCabinetSystem.cs
Content.Shared/Chasm/ChasmSystem.cs
Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs
Content.Shared/Climbing/Systems/BonkSystem.cs
Content.Shared/Climbing/Systems/ClimbSystem.cs
Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
Content.Shared/Cuffs/SharedCuffableSystem.cs
Content.Shared/Damage/Systems/DamageOnHighSpeedImpactSystem.cs
Content.Shared/Damage/Systems/StaminaSystem.cs
Content.Shared/Devour/SharedDevourSystem.cs
Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs
Content.Shared/Doors/Systems/SharedDoorSystem.cs
Content.Shared/Inventory/InventorySystem.Equip.cs
Content.Shared/Light/SharedHandheldLightSystem.cs
Content.Shared/Lock/LockComponent.cs
Content.Shared/Lock/LockSystem.cs
Content.Shared/Materials/MaterialReclaimerComponent.cs
Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs
Content.Shared/Movement/Systems/SharedMoverController.cs
Content.Shared/Ninja/Systems/DashAbilitySystem.cs
Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs
Content.Shared/Projectiles/SharedProjectileSystem.cs
Content.Shared/Prying/Systems/PryingSystem.cs
Content.Shared/RCD/Systems/RCDSystem.cs
Content.Shared/Radiation/Components/GeigerComponent.cs
Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs
Content.Shared/RatKing/SharedRatKingSystem.cs
Content.Shared/Roles/SharedRoleSystem.cs
Content.Shared/Salvage/Fulton/SharedFultonSystem.cs
Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs
Content.Shared/Silicons/Bots/MedibotSystem.cs
Content.Shared/Singularity/Components/SingularityComponent.cs
Content.Shared/Slippery/SlipperySystem.cs
Content.Shared/Sound/SharedEmitSoundSystem.cs
Content.Shared/Standing/StandingStateSystem.cs
Content.Shared/Storage/EntitySystems/DumpableSystem.cs
Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/Stunnable/SharedStunSystem.cs
Content.Shared/Teleportation/Systems/SharedPortalSystem.cs
Content.Shared/Tiles/FloorTileComponent.cs
Content.Shared/Tiles/FloorTileSystem.cs
Content.Shared/Tools/Systems/SharedToolSystem.cs
Content.Shared/Traits/Assorted/ParacusiaComponent.cs
Content.Shared/Vehicle/Components/VehicleComponent.cs
Content.Shared/Vehicle/SharedVehicleSystem.cs
Content.Shared/VendingMachines/SharedVendingMachineSystem.cs
Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
Content.Shared/Weapons/Misc/BaseForceGunComponent.cs
Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs
Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs
Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs
Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Content.Shared/Weapons/Reflect/SharedReflectSystem.cs
Content.Shared/Weather/SharedWeatherSystem.cs
Content.Shared/Weather/WeatherComponent.cs
Content.Shared/Wieldable/WieldableSystem.cs
Resources/Maps/atlas.yml
Resources/Prototypes/Entities/Objects/Fun/toys.yml
Resources/Prototypes/Entities/Objects/Misc/paper.yml
Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml
Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml
Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
Resources/Prototypes/Voice/speech_emote_sounds.yml
Resources/engineCommandPerms.yml

index aebacb94f63be0e05b9dc1fa392e8b57e356ad59..10065b6583e2cc161ff78209321aa78f1f02306b 100644 (file)
@@ -1,16 +1,21 @@
-using System.Linq;
-using System.Numerics;
 using Content.Shared.Audio;
 using Content.Shared.CCVar;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Log;
 using Robust.Shared.Configuration;
+using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using System.Linq;
+using System.Numerics;
+using Robust.Client.GameObjects;
+using Robust.Shared.Audio.Effects;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 
 namespace Content.Client.Audio;
 //TODO: This is using a incomplete version of the whole "only play nearest sounds" algo, that breaks down a bit should the ambient sound cap get hit.
@@ -41,14 +46,18 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     private TimeSpan _targetTime = TimeSpan.Zero;
     private float _ambienceVolume = 0.0f;
 
-    private static AudioParams _params = AudioParams.Default.WithVariation(0.01f).WithLoop(true).WithAttenuation(Attenuation.LinearDistance);
+    private static AudioParams _params = AudioParams.Default
+        .WithVariation(0.01f)
+        .WithLoop(true)
+        .WithAttenuation(Attenuation.LinearDistance)
+        .WithMaxDistance(7f);
 
     /// <summary>
     /// How many times we can be playing 1 particular sound at once.
     /// </summary>
     private int MaxSingleSound => (int) (_maxAmbientCount / (16.0f / 6.0f));
 
-    private readonly Dictionary<Entity<AmbientSoundComponent>, (IPlayingAudioStream? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
+    private readonly Dictionary<AmbientSoundComponent, (EntityUid? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
     private readonly Dictionary<string, int> _playingCount = new();
 
     public bool OverlayEnabled
@@ -98,10 +107,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
     private void OnShutdown(EntityUid uid, AmbientSoundComponent component, ComponentShutdown args)
     {
-        if (!_playingSounds.Remove((uid, component), out var sound))
+        if (!_playingSounds.Remove(component, out var sound))
             return;
 
-        sound.Stream?.Stop();
+        _audio.Stop(sound.Stream);
         _playingCount[sound.Path] -= 1;
         if (_playingCount[sound.Path] == 0)
             _playingCount.Remove(sound.Path);
@@ -111,13 +120,13 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     {
         _ambienceVolume = value;
 
-        foreach (var ((_, comp), values) in _playingSounds)
+        foreach (var (comp, values) in _playingSounds)
         {
             if (values.Stream == null)
                 continue;
 
-            var stream = (AudioSystem.PlayingStream) values.Stream;
-            stream.Volume = _params.Volume + comp.Volume + _ambienceVolume;
+            var stream = values.Stream;
+            _audio.SetVolume(stream, _params.Volume + comp.Volume + _ambienceVolume);
         }
     }
     private void SetCooldown(float value) => _cooldown = value;
@@ -177,7 +186,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     {
         foreach (var (stream, _, _) in _playingSounds.Values)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
 
         _playingSounds.Clear();
@@ -186,7 +195,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
     private readonly struct QueryState
     {
-        public readonly Dictionary<string, List<(float Importance, Entity<AmbientSoundComponent>)>> SourceDict = new();
+        public readonly Dictionary<string, List<(float Importance, AmbientSoundComponent)>> SourceDict = new();
         public readonly Vector2 MapPos;
         public readonly TransformComponent Player;
         public readonly EntityQuery<TransformComponent> Query;
@@ -224,7 +233,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
         // Prioritize far away & loud sounds.
         var importance = range * (ambientComp.Volume + 32);
-        state.SourceDict.GetOrNew(key).Add((importance, (ambientComp.Owner, ambientComp)));
+        state.SourceDict.GetOrNew(key).Add((importance, ambientComp));
         return true;
     }
 
@@ -238,10 +247,9 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
         var mapPos = playerXform.MapPosition;
 
         // Remove out-of-range ambiences
-        foreach (var (ent, sound) in _playingSounds)
+        foreach (var (comp, sound) in _playingSounds)
         {
-            var entity = ent.Owner;
-            var comp = ent.Comp;
+            var entity = comp.Owner;
 
             if (comp.Enabled &&
                 // Don't keep playing sounds that have changed since.
@@ -258,8 +266,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
                     continue;
             }
 
-            sound.Stream?.Stop();
-            _playingSounds.Remove((entity, comp));
+            _audio.Stop(sound.Stream);
+            _playingSounds.Remove(comp);
             _playingCount[sound.Path] -= 1;
             if (_playingCount[sound.Path] == 0)
                 _playingCount.Remove(sound.Path);
@@ -284,12 +292,11 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
             sources.Sort(static (a, b) => b.Importance.CompareTo(a.Importance));
 
-            foreach (var (_, ent) in sources)
+            foreach (var (_, comp) in sources)
             {
-                var uid = ent.Owner;
-                var comp = ent.Comp;
+                var uid = comp.Owner;
 
-                if (_playingSounds.ContainsKey(ent) ||
+                if (_playingSounds.ContainsKey(comp) ||
                     metaQuery.GetComponent(uid).EntityPaused)
                     continue;
 
@@ -299,11 +306,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
                     .WithPlayOffset(_random.NextFloat(0.0f, 100.0f))
                     .WithMaxDistance(comp.Range);
 
-                var stream = _audio.PlayPvs(comp.Sound, uid, audioParams);
-                if (stream == null)
-                    continue;
-
-                _playingSounds[ent] = (stream, comp.Sound, key);
+                var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams);
+                _playingSounds[comp] = (stream.Value.Entity, comp.Sound, key);
                 playingCount++;
 
                 if (_playingSounds.Count >= _maxAmbientCount)
index 0b31db24639e1ddb69171a23de5dec44490b9eef..a26603bf7463ed9ecfcf5a59497bbfd0800542b5 100644 (file)
@@ -5,6 +5,7 @@ using JetBrains.Annotations;
 using Robust.Client;
 using Robust.Client.State;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 
@@ -21,7 +22,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
 
     private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
 
-    private IPlayingAudioStream? _lobbyStream;
+    private EntityUid? _lobbyStream;
 
     public override void Initialize()
     {
@@ -118,12 +119,11 @@ public sealed class BackgroundAudioSystem : EntitySystem
         }
 
         _lobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
-            _lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)));
+            _lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)))?.Entity;
     }
 
     private void EndLobbyMusic()
     {
-        _lobbyStream?.Stop();
-        _lobbyStream = null;
+        _lobbyStream = _audio.Stop(_lobbyStream);
     }
 }
index 792f149d1808734519c73b2168f0be271c491866..1d98564090a14f0ec9069624c1b0d955a912a61b 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.CCVar;
 using Content.Shared.GameTicking;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 
@@ -14,11 +15,11 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
 
     // Admin music
     private bool _adminAudioEnabled = true;
-    private List<IPlayingAudioStream?> _adminAudio = new(1);
+    private List<EntityUid?> _adminAudio = new(1);
 
     // Event sounds (e.g. nuke timer)
     private bool _eventAudioEnabled = true;
-    private Dictionary<StationEventMusicType, IPlayingAudioStream?> _eventAudio = new(1);
+    private Dictionary<StationEventMusicType, EntityUid?> _eventAudio = new(1);
 
     public override void Initialize()
     {
@@ -49,13 +50,13 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
     {
         foreach (var stream in _adminAudio)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
         _adminAudio.Clear();
 
-        foreach (var (_, stream) in _eventAudio)
+        foreach (var stream in _eventAudio.Values)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
 
         _eventAudio.Clear();
@@ -66,7 +67,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if(!_adminAudioEnabled) return;
 
         var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
-        _adminAudio.Add(stream);
+        _adminAudio.Add(stream.Value.Entity);
     }
 
     private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
@@ -75,7 +76,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;
 
         var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
-        _eventAudio.Add(soundEvent.Type, stream);
+        _eventAudio.Add(soundEvent.Type, stream.Value.Entity);
     }
 
     private void PlayGameSound(GameGlobalSoundEvent soundEvent)
@@ -85,8 +86,10 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
 
     private void StopStationEventMusic(StopStationEventMusic soundEvent)
     {
-        if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream)) return;
-        stream?.Stop();
+        if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream))
+            return;
+
+        _audio.Stop(stream);
         _eventAudio.Remove(soundEvent.Type);
     }
 
@@ -96,7 +99,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if (_adminAudioEnabled) return;
         foreach (var stream in _adminAudio)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
         _adminAudio.Clear();
     }
@@ -107,7 +110,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if (_eventAudioEnabled) return;
         foreach (var stream in _eventAudio)
         {
-            stream.Value?.Stop();
+            _audio.Stop(stream.Value);
         }
         _eventAudio.Clear();
     }
index 15fc53222e8dd9974738889be54e835475cb309c..cdf4c71e8280ffeb54c0f25e0e0a93b8a2b04acc 100644 (file)
@@ -9,6 +9,7 @@ using Robust.Client.Player;
 using Robust.Client.ResourceManagement;
 using Robust.Client.State;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -39,7 +40,7 @@ public sealed partial class ContentAudioSystem
     // Don't need to worry about this being serializable or pauseable as it doesn't affect the sim.
     private TimeSpan _nextAudio;
 
-    private AudioSystem.PlayingStream? _ambientMusicStream;
+    private EntityUid? _ambientMusicStream;
     private AmbientMusicPrototype? _musicProto;
 
     /// <summary>
@@ -83,7 +84,7 @@ public sealed partial class ContentAudioSystem
 
         if (_ambientMusicStream != null && _musicProto != null)
         {
-            _ambientMusicStream.Volume = _musicProto.Sound.Params.Volume + _volumeSlider;
+            _audio.SetVolume(_ambientMusicStream, _musicProto.Sound.Params.Volume + _volumeSlider);
         }
     }
 
@@ -92,7 +93,7 @@ public sealed partial class ContentAudioSystem
         _configManager.UnsubValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged);
         _proto.PrototypesReloaded -= OnProtoReload;
         _state.OnStateChanged -= OnStateChange;
-        _ambientMusicStream?.Stop();
+        _ambientMusicStream = _audio.Stop(_ambientMusicStream);
     }
 
     private void OnProtoReload(PrototypesReloadedEventArgs obj)
@@ -129,8 +130,7 @@ public sealed partial class ContentAudioSystem
     private void OnRoundEndMessage(RoundEndMessageEvent ev)
     {
         // If scoreboard shows then just stop the music
-        _ambientMusicStream?.Stop();
-        _ambientMusicStream = null;
+        _ambientMusicStream = _audio.Stop(_ambientMusicStream);
         _nextAudio = TimeSpan.FromMinutes(3);
     }
 
@@ -170,7 +170,7 @@ public sealed partial class ContentAudioSystem
             return;
         }
 
-        var isDone = _ambientMusicStream?.Done;
+        var isDone = !Exists(_ambientMusicStream);
 
         if (_interruptable)
         {
@@ -178,7 +178,7 @@ public sealed partial class ContentAudioSystem
 
             if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(_musicProto.Rules)))
             {
-                FadeOut(_ambientMusicStream, AmbientMusicFadeTime);
+                FadeOut(_ambientMusicStream, duration: AmbientMusicFadeTime);
                 _musicProto = null;
                 _interruptable = false;
                 isDone = true;
@@ -221,14 +221,11 @@ public sealed partial class ContentAudioSystem
             false,
             AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));
 
-        if (strim != null)
-        {
-            _ambientMusicStream = (AudioSystem.PlayingStream) strim;
+        _ambientMusicStream = strim.Value.Entity;
 
-            if (_musicProto.FadeIn)
-            {
-                FadeIn(_ambientMusicStream, AmbientMusicFadeTime);
-            }
+        if (_musicProto.FadeIn)
+        {
+            FadeIn(_ambientMusicStream, strim.Value.Component, AmbientMusicFadeTime);
         }
 
         // Refresh the list
index 696a5eb32dbbdb9624709b6cf8079d3fcdc718a6..726493fdab165756fc9af657baaa8aded7dad9ec 100644 (file)
@@ -1,17 +1,19 @@
 using Content.Shared.Audio;
 using Robust.Client.GameObjects;
+using Robust.Shared.Audio;
+using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
 
 namespace Content.Client.Audio;
 
 public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 {
     // Need how much volume to change per tick and just remove it when it drops below "0"
-    private readonly Dictionary<AudioSystem.PlayingStream, float> _fadingOut = new();
+    private readonly Dictionary<EntityUid, float> _fadingOut = new();
 
     // Need volume change per tick + target volume.
-    private readonly Dictionary<AudioSystem.PlayingStream, (float VolumeChange, float TargetVolume)> _fadingIn = new();
+    private readonly Dictionary<EntityUid, (float VolumeChange, float TargetVolume)> _fadingIn = new();
 
-    private readonly List<AudioSystem.PlayingStream> _fadeToRemove = new();
+    private readonly List<EntityUid> _fadeToRemove = new();
 
     private const float MinVolume = -32f;
     private const float DefaultDuration = 2f;
@@ -42,28 +44,28 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 
     #region Fades
 
-    public void FadeOut(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
+    public void FadeOut(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
     {
-        if (stream == null || duration <= 0f)
+        if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component))
             return;
 
         // Just in case
         // TODO: Maybe handle the removals by making it seamless?
-        _fadingIn.Remove(stream);
-        var diff = stream.Volume - MinVolume;
-        _fadingOut.Add(stream, diff / duration);
+        _fadingIn.Remove(stream.Value);
+        var diff = component.Volume - MinVolume;
+        _fadingOut.Add(stream.Value, diff / duration);
     }
 
-    public void FadeIn(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
+    public void FadeIn(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
     {
-        if (stream == null || duration <= 0f || stream.Volume < MinVolume)
+        if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component) || component.Volume < MinVolume)
             return;
 
-        _fadingOut.Remove(stream);
-        var curVolume = stream.Volume;
+        _fadingOut.Remove(stream.Value);
+        var curVolume = component.Volume;
         var change = (curVolume - MinVolume) / duration;
-        _fadingIn.Add(stream, (change, stream.Volume));
-        stream.Volume = MinVolume;
+        _fadingIn.Add(stream.Value, (change, component.Volume));
+        component.Volume = MinVolume;
     }
 
     private void UpdateFades(float frameTime)
@@ -72,19 +74,18 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 
         foreach (var (stream, change) in _fadingOut)
         {
-            // Cancelled elsewhere
-            if (stream.Done)
+            if (!TryComp(stream, out AudioComponent? component))
             {
                 _fadeToRemove.Add(stream);
                 continue;
             }
 
-            var volume = stream.Volume - change * frameTime;
-            stream.Volume = MathF.Max(MinVolume, volume);
+            var volume = component.Volume - change * frameTime;
+            component.Volume = MathF.Max(MinVolume, volume);
 
-            if (stream.Volume.Equals(MinVolume))
+            if (component.Volume.Equals(MinVolume))
             {
-                stream.Stop();
+                _audio.Stop(stream);
                 _fadeToRemove.Add(stream);
             }
         }
@@ -99,16 +100,16 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
         foreach (var (stream, (change, target)) in _fadingIn)
         {
             // Cancelled elsewhere
-            if (stream.Done)
+            if (!TryComp(stream, out AudioComponent? component))
             {
                 _fadeToRemove.Add(stream);
                 continue;
             }
 
-            var volume = stream.Volume + change * frameTime;
-            stream.Volume = MathF.Min(target, volume);
+            var volume = component.Volume + change * frameTime;
+            component.Volume = MathF.Min(target, volume);
 
-            if (stream.Volume.Equals(target))
+            if (component.Volume.Equals(target))
             {
                 _fadeToRemove.Add(stream);
             }
index d1e2bc7533edbc43859735f708ccb5f5645a5148..8fbeaab5f40d14b0efb80f5977ed8f0a9c4ab877 100644 (file)
@@ -7,6 +7,7 @@ using Robust.Client.ResourceManagement;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.XAML;
+using Robust.Shared.ContentPack;
 using Robust.Shared.Utility;
 using static Content.Client.Changelog.ChangelogManager;
 using static Robust.Client.UserInterface.Controls.BoxContainer;
index 666ff2aa48bb0bb153c6920554a291061ec3c74b..60ac57984546e3c94332ebd7585f4bfba1b6d1ef 100644 (file)
@@ -11,6 +11,7 @@ using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Client.UserInterface.XAML;
 using Robust.Shared.Configuration;
+using Robust.Shared.ContentPack;
 using Robust.Shared.IoC;
 using Robust.Shared.Localization;
 using Robust.Shared.Maths;
@@ -23,7 +24,7 @@ namespace Content.Client.Credits
     [GenerateTypedNameReferences]
     public sealed partial class CreditsWindow : DefaultWindow
     {
-        [Dependency] private readonly IResourceCache _resourceManager = default!;
+        [Dependency] private readonly IResourceManager _resourceManager = default!;
         [Dependency] private readonly IConfigurationManager _cfg = default!;
 
         private static readonly Dictionary<string, int> PatronTierPriority = new()
@@ -49,7 +50,7 @@ namespace Content.Client.Credits
 
         private void PopulateLicenses(BoxContainer licensesContainer)
         {
-            foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
+            foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name))
             {
                 licensesContainer.AddChild(new Label {StyleClasses = {StyleBase.StyleClassLabelHeading}, Text = entry.Name});
 
index d10101754cc783ce0eb18df31c7a4d2dc5ec83b9..344bd2ec979ab525c4f82c1e9b35d993478356c4 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Emag.Systems;
 using Robust.Client.GameObjects;
 using Robust.Client.Animations;
 using Robust.Client.Graphics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Physics.Events;
 using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent;
index 4b82d3506aedd143d8c56c4317fed063fc5f1062..80ce47e0c21a401e11c4d541dcbbf481eb557ef2 100644 (file)
@@ -138,6 +138,6 @@ public sealed class DoorSystem : SharedDoorSystem
     protected override void PlaySound(EntityUid uid, SoundSpecifier soundSpecifier, AudioParams audioParams, EntityUid? predictingPlayer, bool predicted)
     {
         if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted)
-            Audio.Play(soundSpecifier, Filter.Local(), uid, false, audioParams);
+            Audio.PlayEntity(soundSpecifier, Filter.Local(), uid, false, audioParams);
     }
 }
index e363ae764bf7dba46ff0a58c1370014e4e16112f..a25b592f574ad30f2fe1477af785ec1ef7928c87 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.GameWindow;
 using JetBrains.Annotations;
 using Robust.Client.Graphics;
 using Robust.Client.State;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
index fee072051ab3e4d53212cf63403149d7ca6ea2b0..55becdd3950fa61b292ff5e62156eef37dd95522 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Camera;
 using Content.Shared.Gravity;
 using Robust.Client.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
index 8ef6f13e31d5e4c08fad859b44b98220c9920299..dffc625cb8623c05b9ba28296b2429f26fd6d935 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Tag;
 using Content.Shared.Verbs;
 using Robust.Client.GameObjects;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 2905857b393e667472458aa00fb293d78600626a..7a763a1d6f4b2e4d2d1ec53a8419aefa315e245e 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Client.Info
 {
     public sealed class RulesAndInfoWindow : DefaultWindow
     {
-        [Dependency] private readonly IResourceCache _resourceManager = default!;
+        [Dependency] private readonly IResourceManager _resourceManager = default!;
         [Dependency] private readonly RulesManager _rules = default!;
 
         public RulesAndInfoWindow()
index 9cbe8053e3818f447271e420aaf6f5ae64d1c674..cc78ac4873c5b03ca791e28834c101f0f0ca226a 100644 (file)
@@ -1,4 +1,5 @@
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.IoC;
 
 namespace Content.Client.IoC
index 2ce0249fc1f088d0a3ad7286a046619c637916f9..f5dbcc297e7aef8d8d62b7d8e0703ba740b40220 100644 (file)
@@ -44,7 +44,7 @@ public sealed partial class ExpendableLightComponent : SharedExpendableLightComp
     /// The sound that plays when the expendable light is lit.
     /// </summary>
     [Access(typeof(ExpendableLightSystem))]
-    public IPlayingAudioStream? PlayingStream;
+    public EntityUid? PlayingStream;
 }
 
 public enum ExpendableLightVisualLayers : byte
index 6e9e546dfa3e66e69e3286aa440d700068e887ee..a2a7fb2531c96402a457470c13468816c9343efa 100644 (file)
@@ -2,6 +2,8 @@ using Content.Client.Light.Components;
 using Content.Shared.Light.Components;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Client.Light.EntitySystems;
 
@@ -19,7 +21,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
 
     private void OnLightShutdown(EntityUid uid, ExpendableLightComponent component, ComponentShutdown args)
     {
-        component.PlayingStream?.Stop();
+        component.PlayingStream = _audioSystem.Stop(component.PlayingStream);
     }
 
     protected override void OnAppearanceChange(EntityUid uid, ExpendableLightComponent comp, ref AppearanceChangeEvent args)
@@ -48,12 +50,10 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
         switch (state)
         {
             case ExpendableLightState.Lit:
-                comp.PlayingStream?.Stop();
+                _audioSystem.Stop(comp.PlayingStream);
                 comp.PlayingStream = _audioSystem.PlayPvs(
-                    comp.LoopedSound,
-                    uid,
-                    SharedExpendableLightComponent.LoopedSoundParams
-                );
+                    comp.LoopedSound, uid, SharedExpendableLightComponent.LoopedSoundParams)?.Entity;
+
                 if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
@@ -73,7 +73,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
 
                 break;
             case ExpendableLightState.Dead:
-                comp.PlayingStream?.Stop();
+                comp.PlayingStream = _audioSystem.Stop(comp.PlayingStream);
                 if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
index bf69053d9a213486ac03c0346cfdee907b60cceb..e7fcf7e219fc48ef3eefa7a08a206ad53b8e3dc1 100644 (file)
@@ -2,6 +2,8 @@ using Content.Shared.Light;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 using Robust.Shared.Animations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Client.Light.Visualizers;
index 5875c4a33a1f15aa025384e5d8c9a8bd500fbcd3..6a9928b8bdd8f244469b8e71052ac2976d5096e7 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Shared.CCVar;
+using Robust.Client.Audio;
 using Robust.Client.AutoGenerated;
+using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
@@ -14,13 +16,14 @@ namespace Content.Client.Options.UI.Tabs
     public sealed partial class AudioTab : Control
     {
         [Dependency] private readonly IConfigurationManager _cfg = default!;
-        [Dependency] private readonly IClydeAudio _clydeAudio = default!;
+        private readonly AudioSystem _audio;
 
         public AudioTab()
         {
             RobustXamlLoader.Load(this);
             IoCManager.InjectDependencies(this);
 
+            _audio = IoCManager.Resolve<IEntityManager>().System<AudioSystem>();
             LobbyMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.LobbyMusicEnabled);
             RestartSoundsCheckBox.Pressed = _cfg.GetCVar(CCVars.RestartSoundsEnabled);
             EventMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.EventMusicEnabled);
@@ -79,7 +82,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void OnMasterVolumeSliderChanged(Range range)
         {
-            _clydeAudio.SetMasterVolume(MasterVolumeSlider.Value / 100);
+            _audio.SetMasterVolume(MasterVolumeSlider.Value / 100);
             UpdateChanges();
         }
 
@@ -108,7 +111,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
         {
-            _cfg.SetCVar(CVars.AudioMasterVolume, MasterVolumeSlider.Value / 100);
+            _cfg.SetCVar(CVars.AudioMasterVolume, LV100ToDB(MasterVolumeSlider.Value, CCVars.MasterMultiplier));
             // Want the CVar updated values to have the multiplier applied
             // For the UI we just display 0-100 still elsewhere
             _cfg.SetCVar(CVars.MidiVolume, LV100ToDB(MidiVolumeSlider.Value, CCVars.MidiMultiplier));
@@ -132,7 +135,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void Reset()
         {
-            MasterVolumeSlider.Value = _cfg.GetCVar(CVars.AudioMasterVolume) * 100;
+            MasterVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier);
             MidiVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier);
             AmbienceVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CCVars.AmbienceVolume), CCVars.AmbienceMultiplier);
             AmbientMusicVolumeSlider.Value =
@@ -150,8 +153,8 @@ namespace Content.Client.Options.UI.Tabs
         // Do be sure to rename the setting though
         private float DBToLV100(float db, float multiplier = 1f)
         {
-            var weh = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
-            return weh;
+            var beri = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
+            return beri;
         }
 
         private float LV100ToDB(float lv100, float multiplier = 1f)
@@ -164,7 +167,7 @@ namespace Content.Client.Options.UI.Tabs
         private void UpdateChanges()
         {
             var isMasterVolumeSame =
-                Math.Abs(MasterVolumeSlider.Value - _cfg.GetCVar(CVars.AudioMasterVolume) * 100) < 0.01f;
+                Math.Abs(MasterVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier)) < 0.01f;
             var isMidiVolumeSame =
                 Math.Abs(MidiVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier)) < 0.01f;
             var isAmbientVolumeSame =
index 81f012d93c6927262b7944ca4ab66cf458ef42ba..2e69a5a5625d1f9c3b5f17f5b94db01f15782ad1 100644 (file)
@@ -57,16 +57,17 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
         }
 
         var debugParallax = IoCManager.Resolve<IConfigurationManager>().GetCVar(CCVars.ParallaxDebug);
+        var resManager = IoCManager.Resolve<IResourceManager>();
 
         if (debugParallax
-            || !StaticIoC.ResC.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
+            || !resManager.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
             || previousParallaxConfig != parallaxConfig)
         {
             var table = Toml.ReadString(parallaxConfig);
             await UpdateCachedTexture(table, debugParallax, cancel);
 
             //Update the previous config
-            using var writer = StaticIoC.ResC.UserData.OpenWriteText(PreviousParallaxConfigPath);
+            using var writer = resManager.UserData.OpenWriteText(PreviousParallaxConfigPath);
             writer.Write(parallaxConfig);
         }
 
@@ -81,7 +82,7 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
             try
             {
                 // Also try to at least sort of fix this if we've been fooled by a config backup
-                StaticIoC.ResC.UserData.Delete(PreviousParallaxConfigPath);
+                resManager.UserData.Delete(PreviousParallaxConfigPath);
             }
             catch (Exception)
             {
@@ -104,31 +105,34 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
         // And load it in the main thread for safety reasons.
         // But before spending time saving it, make sure to exit out early if it's not wanted.
         cancel.ThrowIfCancellationRequested();
+        var resManager = IoCManager.Resolve<IResourceManager>();
 
         // Store it and CRC so further game starts don't need to regenerate it.
-        using var imageStream = StaticIoC.ResC.UserData.OpenWrite(ParallaxCachedImagePath);
-        newParallexImage.SaveAsPng(imageStream);
+        await using var imageStream = resManager.UserData.OpenWrite(ParallaxCachedImagePath);
+        await newParallexImage.SaveAsPngAsync(imageStream, cancel);
 
         if (saveDebugLayers)
         {
             for (var i = 0; i < debugImages!.Count; i++)
             {
                 var debugImage = debugImages[i];
-                using var debugImageStream = StaticIoC.ResC.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
-                debugImage.SaveAsPng(debugImageStream);
+                await using var debugImageStream = resManager.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
+                await debugImage.SaveAsPngAsync(debugImageStream, cancel);
             }
         }
     }
 
     private Texture GetCachedTexture()
     {
-        using var imageStream = StaticIoC.ResC.UserData.OpenRead(ParallaxCachedImagePath);
+        var resManager = IoCManager.Resolve<IResourceManager>();
+        using var imageStream = resManager.UserData.OpenRead(ParallaxCachedImagePath);
         return Texture.LoadFromPNGStream(imageStream, "Parallax");
     }
 
     private string? GetParallaxConfig()
     {
-        if (!StaticIoC.ResC.TryContentFileRead(ParallaxConfigPath, out var configStream))
+        var resManager = IoCManager.Resolve<IResourceManager>();
+        if (!resManager.TryContentFileRead(ParallaxConfigPath, out var configStream))
         {
             return null;
         }
index 2b4e8ddc7dca8da51755b701461d625f236d03e8..37c066f5942729b182919884a63fa8a10cd53280 100644 (file)
@@ -139,7 +139,6 @@ public sealed class ContentReplayPlaybackManager
         {
             case RoundEndMessageEvent:
             case PopupEvent:
-            case AudioMessage:
             case PickupAnimationEvent:
             case MeleeLungeEvent:
             case SharedGunSystem.HitscanEvent:
index dad274bf9689196820ec8fd6ec6fcb87076f105f..c661254bc9505e2c55b221fc48d0333b05a81037 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.Traits.Assorted;
 using Robust.Shared.Random;
 using Robust.Client.Player;
 using Robust.Shared.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Client.Traits;
@@ -41,7 +43,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
 
     private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
     {
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
     }
 
     private void PlayParacusiaSounds(EntityUid uid)
@@ -67,7 +69,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
         var newCoords = Transform(uid).Coordinates.Offset(randomOffset);
 
         // Play the sound
-        paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords);
+        paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords).Value.Entity;
     }
 
 }
index 1c9156585874dcff87838b23ac63ffc49013d5be..44c92456a1f7d62b9aeff5f3b21bab13b95503d5 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Trigger;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 
 namespace Content.Client.Trigger;
index 87d4b8072fcc4fcde6748f0513c893152fcb77cd..659792f967486e15e89eb54431979fa51469e67c 100644 (file)
@@ -20,6 +20,7 @@ using Robust.Client.UserInterface.Controllers;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
@@ -34,6 +35,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly IClyde _clyde = default!;
     [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
+    [UISystemDependency] private readonly SharedAudioSystem _audio = default!;
 
     private BwoinkSystem? _bwoinkSystem;
     private MenuButton? GameAHelpButton => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>()?.AHelpButton;
@@ -128,7 +130,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
         }
         if (localPlayer.UserId != message.TrueSender)
         {
-            SoundSystem.Play("/Audio/Effects/adminhelp.ogg", Filter.Local());
+            _audio.PlayGlobal("/Audio/Effects/adminhelp.ogg", Filter.Local(), false);
             _clyde.RequestWindowAttention();
         }
 
index 56c0c2863482302ce6631501c1d43e4515f525f8..79d23a94beeb87cf363fff8b4c32fc16b52454ef 100644 (file)
@@ -1,7 +1,9 @@
 using Content.Client.UserInterface.Systems.Chat.Controls;
 using Content.Shared.Chat;
 using Content.Shared.Input;
+using Robust.Client.Audio;
 using Robust.Client.AutoGenerated;
+using Robust.Client.GameObjects;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.XAML;
@@ -19,6 +21,7 @@ public partial class ChatBox : UIWidget
 #pragma warning restore RA0003
 {
     private readonly ChatUIController _controller;
+    private readonly IEntityManager _entManager;
 
     public bool Main { get; set; }
 
@@ -27,6 +30,7 @@ public partial class ChatBox : UIWidget
     public ChatBox()
     {
         RobustXamlLoader.Load(this);
+        _entManager = IoCManager.Resolve<IEntityManager>();
 
         ChatInput.Input.OnTextEntered += OnTextEntered;
         ChatInput.Input.OnKeyBindDown += OnKeyBindDown;
@@ -52,8 +56,8 @@ public partial class ChatBox : UIWidget
             return;
         }
 
-        if (msg is { Read: false, AudioPath: not null })
-            SoundSystem.Play(msg.AudioPath, Filter.Local(), new AudioParams().WithVolume(msg.AudioVolume));
+        if (msg is { Read: false, AudioPath: { } })
+            _entManager.System<AudioSystem>().PlayGlobal(msg.AudioPath, Filter.Local(), false, AudioParams.Default.WithVolume(msg.AudioVolume));
 
         msg.Read = true;
 
index 3220f2bdb21f54b660ac3d3919c2fbae6e58e33e..63c706c86b3c5d295477adab9454086cfc71175f 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Content.Shared.Voting;
 using Robust.Client;
+using Robust.Client.Audio;
 using Robust.Client.Console;
 using Robust.Client.GameObjects;
 using Robust.Client.UserInterface;
index 4e4df4a156802bf1db982970b939afa67184a069..565672ad383d3768e4bbc8831fd3a5ab4dc7ce87 100644 (file)
@@ -2,6 +2,8 @@ using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 888942363a91223f98d8e3be6136f44838fe3478..df7ccce451dd5d19ce9199071a12e8cd16716d18 100644 (file)
@@ -1,8 +1,10 @@
 using System.Numerics;
 using Content.Shared.Weather;
+using Robust.Client.Audio;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -10,6 +12,7 @@ using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
+using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
 
 namespace Content.Client.Weather;
 
@@ -47,18 +50,18 @@ public sealed class WeatherSystem : SharedWeatherSystem
         {
             weather.LastOcclusion = 0f;
             weather.LastAlpha = 0f;
-            weather.Stream?.Stop();
-            weather.Stream = null;
+            weather.Stream = _audio.Stop(weather.Stream);
             return;
         }
 
         if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
             return;
 
-        weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
+        weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true).Value.Entity;
         var volumeMod = MathF.Pow(10, weatherProto.Sound.Params.Volume / 10f);
 
-        var stream = (AudioSystem.PlayingStream) weather.Stream!;
+        var stream = weather.Stream.Value;
+        var comp = Comp<AudioComponent>(stream);
         var alpha = weather.LastAlpha;
         alpha = MathF.Pow(alpha, 2f) * volumeMod;
         // TODO: Lerp this occlusion.
@@ -124,7 +127,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
                 {
                     occlusion = _physics.IntersectRayPenetration(entXform.MapID,
                         new CollisionRay(entPos, sourceRelative.Normalized(), _audio.OcclusionCollisionMask),
-                        sourceRelative.Length(), stream.TrackingEntity);
+                        sourceRelative.Length(), stream);
                 }
             }
         }
@@ -140,8 +143,8 @@ public sealed class WeatherSystem : SharedWeatherSystem
             weather.LastAlpha += (alpha - weather.LastAlpha) * AlphaLerpRate * frameTime;
 
         // Full volume if not on grid
-        stream.Source.SetVolumeDirect(weather.LastAlpha);
-        stream.Source.SetOcclusion(weather.LastOcclusion);
+        comp.Gain = weather.LastAlpha;
+        comp.Occlusion = weather.LastOcclusion;
     }
 
     protected override void EndWeather(EntityUid uid, WeatherComponent component, string proto)
@@ -164,9 +167,8 @@ public sealed class WeatherSystem : SharedWeatherSystem
             return true;
 
         // TODO: Fades (properly)
-        weather.Stream?.Stop();
-        weather.Stream = null;
-        weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
+        weather.Stream = _audio.Stop(weather.Stream);
+        weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true)?.Entity;
         return true;
     }
 
index 34692aa082fad3427a679dfa107eb0ca22976a90..47c0d8497728238a8f6d954666d9711ddbfea535 100644 (file)
@@ -6,6 +6,8 @@ using Content.Server.Destructible.Thresholds.Triggers;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
 using Content.Shared.FixedPoint;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Prototypes;
 using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;
index 25171e1ea2ed19f05a0029689570c5ab10d6a493..f59952afecdc874090533021c395dec338fb7620 100644 (file)
@@ -619,6 +619,9 @@ public abstract partial class InteractionTest
         {
             foreach (var (proto, quantity) in expected.Entities)
             {
+                if (proto == "Audio")
+                    continue;
+
                 if (quantity < 0 && failOnExcess)
                     Assert.Fail($"Unexpected entity/stack: {proto}, quantity: {-quantity}");
 
index ffcd140a6eda3b7d9b7221519ad7a883e88495e7..f863595f9ac39f34cead7983b02928c17c1aa756 100644 (file)
@@ -4,6 +4,7 @@ using System.IO;
 using Content.Shared.Decals;
 using Robust.Client.ResourceManagement;
 using Robust.Client.Utility;
+using Robust.Shared.ContentPack;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -16,7 +17,7 @@ namespace Content.MapRenderer.Painters;
 
 public sealed class DecalPainter
 {
-    private readonly IResourceCache _cResourceCache;
+    private readonly IResourceManager _resManager;
 
     private readonly IPrototypeManager _sPrototypeManager;
 
@@ -24,7 +25,7 @@ public sealed class DecalPainter
 
     public DecalPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
     {
-        _cResourceCache = client.ResolveDependency<IResourceCache>();
+        _resManager = client.ResolveDependency<IResourceManager>();
         _sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
     }
 
@@ -63,7 +64,7 @@ public sealed class DecalPainter
         Stream stream;
         if (sprite is SpriteSpecifier.Texture texture)
         {
-            stream = _cResourceCache.ContentFileRead(texture.TexturePath);
+            stream = _resManager.ContentFileRead(texture.TexturePath);
         }
         else if (sprite is SpriteSpecifier.Rsi rsi)
         {
@@ -73,7 +74,7 @@ public sealed class DecalPainter
                 path = $"/Textures/{path}";
             }
 
-            stream = _cResourceCache.ContentFileRead(path);
+            stream = _resManager.ContentFileRead(path);
         }
         else
         {
index 79f2ed76796cb9fff0aa5a60e23aa712e10b7987..de6b98711f2e9d651c4d6cd47143243b92f73017 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Timing;
 using SixLabors.ImageSharp;
@@ -14,7 +15,7 @@ namespace Content.MapRenderer.Painters;
 
 public sealed class EntityPainter
 {
-    private readonly IResourceCache _cResourceCache;
+    private readonly IResourceManager _resManager;
 
     private readonly Dictionary<(string path, string state), Image> _images;
     private readonly Image _errorImage;
@@ -23,12 +24,12 @@ public sealed class EntityPainter
 
     public EntityPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
     {
-        _cResourceCache = client.ResolveDependency<IResourceCache>();
+        _resManager = client.ResolveDependency<IResourceManager>();
 
         _sEntityManager = server.ResolveDependency<IEntityManager>();
 
         _images = new Dictionary<(string path, string state), Image>();
-        _errorImage = Image.Load<Rgba32>(_cResourceCache.ContentFileRead("/Textures/error.rsi/error.png"));
+        _errorImage = Image.Load<Rgba32>(_resManager.ContentFileRead("/Textures/error.rsi/error.png"));
     }
 
     public void Run(Image canvas, List<EntityData> entities)
@@ -81,7 +82,7 @@ public sealed class EntityPainter
 
                 if (!_images.TryGetValue(key, out image!))
                 {
-                    var stream = _cResourceCache.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
+                    var stream = _resManager.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
                     image = Image.Load<Rgba32>(stream);
 
                     _images[key] = image;
index 461bad9f21fc4df310f13f11f8a2878d6a325cc1..cac0f960c460e0fa80ad4640ed4ce1a357273a87 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Robust.Client.Graphics;
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -19,12 +20,12 @@ namespace Content.MapRenderer.Painters
         public const int TileImageSize = EyeManager.PixelsPerMeter;
 
         private readonly ITileDefinitionManager _sTileDefinitionManager;
-        private readonly IResourceCache _cResourceCache;
+        private readonly IResourceManager _resManager;
 
         public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
         {
             _sTileDefinitionManager = server.ResolveDependency<ITileDefinitionManager>();
-            _cResourceCache = client.ResolveDependency<IResourceCache>();
+            _resManager = client.ResolveDependency<IResourceManager>();
         }
 
         public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid)
@@ -37,7 +38,7 @@ namespace Content.MapRenderer.Painters
             var yOffset = -bounds.Bottom;
             var tileSize = grid.TileSize * TileImageSize;
 
-            var images = GetTileImages(_sTileDefinitionManager, _cResourceCache, tileSize);
+            var images = GetTileImages(_sTileDefinitionManager, _resManager, tileSize);
             var i = 0;
 
             grid.GetAllTiles().AsParallel().ForAll(tile =>
@@ -61,7 +62,7 @@ namespace Content.MapRenderer.Painters
 
         private Dictionary<string, List<Image>> GetTileImages(
             ITileDefinitionManager tileDefinitionManager,
-            IResourceCache resourceCache,
+            IResourceManager resManager,
             int tileSize)
         {
             var stopwatch = new Stopwatch();
@@ -78,7 +79,7 @@ namespace Content.MapRenderer.Painters
 
                 images[path] = new List<Image>(definition.Variants);
 
-                using var stream = resourceCache.ContentFileRead(path);
+                using var stream = resManager.ContentFileRead(path);
                 Image tileSheet = Image.Load<Rgba32>(stream);
 
                 if (tileSheet.Width != tileSize * definition.Variants || tileSheet.Height != tileSize)
index 82edfb4addea4ad5b1e151d64d075f77aa80328d..dcbac5066db59abb8ecc1f20a13f53e6ce3dc585 100644 (file)
@@ -3,10 +3,11 @@
     <OutputType>Exe</OutputType>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
+    <ServerGarbageCollection>True</ServerGarbageCollection>
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="NVorbis" Version="0.10.1" PrivateAssets="compile" />
+    <PackageReference Include="NVorbis" Version="0.10.5" PrivateAssets="compile" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\RobustToolbox\Robust.Packaging\Robust.Packaging.csproj" />
index d75b425561a3bb72526af45aaf990f40b8ecc8fe..ba489629f798060e262865e0c9b48353f609a3b0 100644 (file)
@@ -1,15 +1,10 @@
 using System.Diagnostics;
-using System.Globalization;
 using System.IO.Compression;
 using Robust.Packaging;
 using Robust.Packaging.AssetProcessing;
 using Robust.Packaging.AssetProcessing.Passes;
 using Robust.Packaging.Utility;
-using Robust.Shared.Audio;
-using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
-using YamlDotNet.Core;
-using YamlDotNet.RepresentationModel;
 
 namespace Content.Packaging;
 
@@ -169,7 +164,7 @@ public static class ServerPackaging
         bool hybridAcz,
         CancellationToken cancel)
     {
-        var graph = new RobustClientAssetGraph();
+        var graph = new RobustServerAssetGraph();
         var passes = graph.AllPasses.ToList();
 
         pass.Dependencies.Add(new AssetPassDependency(graph.Output.Name));
@@ -177,7 +172,8 @@ public static class ServerPackaging
 
         AssetGraph.CalculateGraph(passes, logger);
 
-        var inputPass = graph.Input;
+        var inputPassCore = graph.InputCore;
+        var inputPassResources = graph.InputResources;
         var contentAssemblies = new List<string>(ServerContentAssemblies);
 
         // Additional assemblies that need to be copied such as EFCore.
@@ -200,26 +196,26 @@ public static class ServerPackaging
             Path.Combine("RobustToolbox", "bin", "Server",
             platform.Rid,
             "publish"),
-            inputPass,
+            inputPassCore,
             BinSkipFolders,
             cancel: cancel);
 
         await RobustSharedPackaging.WriteContentAssemblies(
-            inputPass,
+            inputPassResources,
             contentDir,
             "Content.Server",
             contentAssemblies,
-            Path.Combine("Resources", "Assemblies"),
-            cancel);
+            cancel: cancel);
 
-        await RobustServerPackaging.WriteServerResources(contentDir, inputPass, cancel);
+        await RobustServerPackaging.WriteServerResources(contentDir, inputPassResources, cancel);
 
         if (hybridAcz)
         {
-            inputPass.InjectFileFromDisk("Content.Client.zip", Path.Combine("release", "SS14.Client.zip"));
+            inputPassCore.InjectFileFromDisk("Content.Client.zip", Path.Combine("release", "SS14.Client.zip"));
         }
 
-        inputPass.InjectFinished();
+        inputPassCore.InjectFinished();
+        inputPassResources.InjectFinished();
     }
 
     private readonly record struct PlatformReg(string Rid, string TargetOs, bool BuildByDefault);
index 147ac70a6d589f0d52863c1d6e6ee0f5ba8dd083..41bb84ab6b22223470cda583869879d9710cc6ec 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using static Content.Shared.Access.Components.AccessOverriderComponent;
index feabaa2aad6e5da1e7421cb21d7944573563b244..cc31071fe8cb69de28c7845111cd6f8a17d82e92 100644 (file)
@@ -26,6 +26,7 @@ using Content.Shared.Throwing;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
@@ -39,7 +40,6 @@ namespace Content.Server.Administration.Systems
         [Dependency] private readonly IChatManager _chat = default!;
         [Dependency] private readonly IConfigurationManager _config = default!;
         [Dependency] private readonly IPlayerManager _playerManager = default!;
-        [Dependency] private readonly AudioSystem _audio = default!;
         [Dependency] private readonly HandsSystem _hands = default!;
         [Dependency] private readonly SharedJobSystem _jobs = default!;
         [Dependency] private readonly InventorySystem _inventory = default!;
@@ -49,6 +49,7 @@ namespace Content.Server.Administration.Systems
         [Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
         [Dependency] private readonly SharedRoleSystem _role = default!;
         [Dependency] private readonly GameTicker _gameTicker = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationRecordsSystem _stationRecords = default!;
         [Dependency] private readonly TransformSystem _transform = default!;
 
@@ -340,7 +341,7 @@ namespace Content.Server.Administration.Systems
                     _popup.PopupCoordinates(Loc.GetString("admin-erase-popup", ("user", name)), coordinates, PopupType.LargeCaution);
                     var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager);
                     var audioParams = new AudioParams().WithVolume(3);
-                    _audio.Play("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
+                    _audio.PlayStatic("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
                 }
 
                 foreach (var item in _inventory.GetHandOrInventoryEntities(entity.Value))
index 66e09d34e0f36c6af8df8fee3728ba8b7652873a..b2b63e618e61e9b6aae2799b6ddb0776c5cc44de 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Chat.Systems;
 using Content.Server.Station.Systems;
 using Content.Shared.CCVar;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Prototypes;
 
@@ -10,10 +11,11 @@ namespace Content.Server.AlertLevel;
 
 public sealed class AlertLevelSystem : EntitySystem
 {
+    [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
     [Dependency] private readonly ChatSystem _chatSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly StationSystem _stationSystem = default!;
-    [Dependency] private readonly IConfigurationManager _cfg = default!;
 
     // Until stations are a prototype, this is how it's going to have to be.
     public const string DefaultAlertLevelSet = "stationAlerts";
@@ -174,7 +176,7 @@ public sealed class AlertLevelSystem : EntitySystem
             if (detail.Sound != null)
             {
                 var filter = _stationSystem.GetInOwningStation(station);
-                SoundSystem.Play(detail.Sound.GetSound(), filter, detail.Sound.Params);
+                _audio.PlayGlobal(detail.Sound.GetSound(), filter, true, detail.Sound.Params);
             }
             else
             {
index 0dddff3637ded87f865fe065da21d9d4212555f7..2e461345041de401560e9cbf0a8575b99d474aae 100644 (file)
@@ -16,6 +16,7 @@ using Content.Shared.Popups;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 54a379f693bf4780a3c38cf8c0b54b948518f3de..a75c092e2ead5746ac40b3b2215b9c3921527570 100644 (file)
@@ -6,6 +6,8 @@ using Content.Server.Tools;
 using Content.Shared.Database;
 using Content.Shared.Hands.Components;
 using Content.Shared.Interaction;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 
 namespace Content.Server.Ame.EntitySystems;
index 5189adb031ddbdd945cafe841cae98a8ce17307f..35c3bab01dd8ab3aadcb866fbdd97121e2ccfb94 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Actions.Events;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 6e881aa3d1988110c9f41c47e91453aa5e05bac2..59c1aa85655fae214f5c5fafaff81daa1722e57f 100644 (file)
@@ -5,6 +5,7 @@ using Content.Server.Power.EntitySystems;
 using Content.Shared.Anomaly.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Anomaly;
 
index f1b147ac802727d0eac3dd5170052797321615fd..769558a7ad13f204bb7b47bdb9c3ae32044cd1de 100644 (file)
@@ -81,7 +81,7 @@ public sealed partial class AnomalySystem
 
         var generating = EnsureComp<GeneratingAnomalyGeneratorComponent>(uid);
         generating.EndTime = Timing.CurTime + component.GenerationLength;
-        generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true));
+        generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true))?.Entity;
         component.CooldownEndTime = Timing.CurTime + component.CooldownLength;
         UpdateGeneratorUi(uid, component);
     }
@@ -174,7 +174,8 @@ public sealed partial class AnomalySystem
         {
             if (Timing.CurTime < active.EndTime)
                 continue;
-            active.AudioStream?.Stop();
+
+            active.AudioStream = _audio.Stop(active.AudioStream);
             OnGeneratingFinished(ent, gen);
         }
     }
index 5f6220f386f4de10da980f59f8cd2726cd099e71..bb7a7304d9bb450b528cf40b0a48ba64fa5e9fbc 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Anomaly;
 using Content.Shared.Anomaly.Components;
 using Content.Shared.DoAfter;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Prototypes;
@@ -31,6 +33,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
     [Dependency] private readonly SharedPointLightSystem _pointLight = default!;
     [Dependency] private readonly StationSystem _station = default!;
     [Dependency] private readonly RadioSystem _radio = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly UserInterfaceSystem _ui = default!;
 
     public const float MinParticleVariation = 0.8f;
index d768f905cea67baf00d02fd1fc56212e1c84362d..4233bfd7e1e57e886a7cb9a0ee70b3b15b91e272 100644 (file)
@@ -13,5 +13,5 @@ public sealed partial class GeneratingAnomalyGeneratorComponent : Component
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
     public TimeSpan EndTime = TimeSpan.Zero;
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 }
index 964a42234d3a0dd0f1ba921b2ecbc64e302e13aa..603396e31ac54dc041c0b01cfba82fd5f27c5255 100644 (file)
@@ -4,6 +4,8 @@ using Content.Server.Anomaly.Components;
 using Content.Shared.Anomaly.Components;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Teleportation.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Anomaly.Effects;
index c87dcf4eaeb95083e565c5f2282dd465cb1a9687..487d20f43f01a91a1f211f31e14354a917f9e575 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Chemistry.EntitySystems;
 using Robust.Shared.Prototypes;
 using Content.Shared.Sprite;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Anomaly.Effects;
 
@@ -75,7 +76,7 @@ public sealed class ReagentProducerAnomalySystem : EntitySystem
             if (anomaly.Severity >= 0.97) reagentProducingAmount *= component.SupercriticalReagentProducingModifier;
 
             newSol.AddReagent(component.ProducingReagent, reagentProducingAmount);
-            _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled. 
+            _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled.
 
             component.AccumulatedFrametime = 0;
 
index 737b723d390abcfe8bf9321e39ebd2c1b748e9fa..b3b8a375088e5b5c35fa5635150f851e153a1e92 100644 (file)
@@ -21,6 +21,7 @@ using Content.Shared.Mobs.Components;
 using Content.Server.Station.Systems;
 using Content.Server.Shuttles.Systems;
 using Content.Shared.Mobs;
+using Robust.Server.Audio;
 using Robust.Server.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index 5e4d7d5ec6a5b70a3309a71bd5c9873639285327..eae9b94964770c4b9ca6f1048d5e9c90aee1f080 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.UserInterface;
 using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Arcade.SpaceVillain;
index 18dc32282b658021527f42fdbd8023b27ff2b1ea..ae4c15f2db3ac9d81b801c7cb0a066df78785f1c 100644 (file)
@@ -1,6 +1,7 @@
 using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Arcade.SpaceVillain;
index a649e57b45db4b48b06a7007a248e776f3c9f29e..2d6b073e9dfe90ef3c8a371ffbd7366ca3e496aa 100644 (file)
@@ -30,8 +30,8 @@ namespace Content.Server.Atmos.Components
 
         // Cancel toggles sounds if we re-toggle again.
 
-        public IPlayingAudioStream? ConnectStream;
-        public IPlayingAudioStream? DisconnectStream;
+        public EntityUid? ConnectStream;
+        public EntityUid? DisconnectStream;
 
         [DataField("air"), ViewVariables(VVAccess.ReadWrite)]
         public GasMixture Air { get; set; } = new();
index 020684aa3b9757a53da91383033b9548c5c4c1f8..989fed945f50d850810a0ab1cb1b5dd5506041ce 100644 (file)
@@ -101,8 +101,7 @@ namespace Content.Server.Atmos.EntitySystems
                 if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
                 {
                     var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
-                    SoundSystem.Play(SpaceWindSound, Filter.Pvs(coordinates),
-                        coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
+                    _audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
                 }
             }
 
index 1b44f6e81938cd0ae5323325b25baa584ed187a9..5b3d869229cdc787d1baa46d74fc35e7f16c09b5 100644 (file)
@@ -85,8 +85,7 @@ namespace Content.Server.Atmos.EntitySystems
                 // A few details on the audio parameters for fire.
                 // The greater the fire state, the lesser the pitch variation.
                 // The greater the fire state, the greater the volume.
-                SoundSystem.Play(HotspotSound, Filter.Pvs(coordinates),
-                    coordinates, AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
+                _audio.PlayPvs(HotspotSound, coordinates, AudioParams.Default.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
             }
 
             if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)
index d8364b652b83a3068843013aa39d0678dd1227f3..19855a71e56439fea29207fb64a4ff2aa91aa19c 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Atmos.EntitySystems;
 using Content.Shared.Maps;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Systems;
@@ -28,6 +30,7 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
     [Dependency] private readonly SharedContainerSystem _containers = default!;
     [Dependency] private readonly SharedPhysicsSystem _physics = default!;
     [Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly TransformSystem _transformSystem = default!;
     [Dependency] private readonly TileSystem _tile = default!;
 
index e045b552a2eff6c9eb0628e9566e1d9393771586..a0b85a26faa6f04a6e253d1fd028b30aa31613d7 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Throwing;
 using Content.Shared.Timing;
 using Content.Shared.Toggleable;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
index c91900fec24c39b86033d37e80e437994634f897..881d27c585247821b9f68afa4cddab6649e4349f 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
@@ -239,10 +240,8 @@ namespace Content.Server.Atmos.EntitySystems
             if (!component.IsConnected)
                 return;
 
-            component.ConnectStream?.Stop();
-
-            if (component.ConnectSound != null)
-                component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, owner);
+            component.ConnectStream = _audioSys.Stop(component.ConnectStream);
+            component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, component.Owner)?.Entity;
 
             UpdateUserInterface(ent);
         }
@@ -259,10 +258,8 @@ namespace Content.Server.Atmos.EntitySystems
             _actions.SetToggled(component.ToggleActionEntity, false);
 
             _internals.DisconnectTank(internals);
-            component.DisconnectStream?.Stop();
-
-            if (component.DisconnectSound != null)
-                component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, owner);
+            component.DisconnectStream = _audioSys.Stop(component.DisconnectStream);
+            component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, component.Owner)?.Entity;
 
             UpdateUserInterface(ent);
         }
@@ -322,7 +319,7 @@ namespace Content.Server.Atmos.EntitySystems
                     if(environment != null)
                         _atmosphereSystem.Merge(environment, component.Air);
 
-                    _audioSys.Play(component.RuptureSound, Filter.Pvs(owner), Transform(owner).Coordinates, true, AudioParams.Default.WithVariation(0.125f));
+                    _audioSys.PlayPvs(component.RuptureSound, Transform(component.Owner).Coordinates, AudioParams.Default.WithVariation(0.125f));
 
                     QueueDel(owner);
                     return;
index b674f864426574db2735bb1ea36a2f0fd58708c4..27e64a9956d8a156b31eff049f6872d574218cea 100644 (file)
@@ -7,6 +7,7 @@ using Content.Server.DeviceNetwork.Systems;
 using Content.Server.Power.Components;
 using Content.Shared.Atmos.Monitor;
 using Content.Shared.Tag;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Utility;
index 914e732991127f51cd2f8859477b87299cbca04e..934ce8a7a47d418187a460038e55905dee39e98d 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Atmos.Piping.Binary.EntitySystems
@@ -17,6 +18,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
     {
         [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
 
         public override void Initialize()
@@ -35,10 +37,11 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
                 return;
 
             if (Loc.TryGetString("gas-valve-system-examined", out var str,
-                        ("statusColor", valve.Open ? "green" : "orange"),
-                        ("open", valve.Open)
-            ))
+                    ("statusColor", valve.Open ? "green" : "orange"),
+                    ("open", valve.Open)))
+            {
                 args.PushMarkup(str);
+            }
         }
 
         private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStartup args)
@@ -50,7 +53,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args)
         {
             Toggle(uid, component);
-            SoundSystem.Play(component.ValveSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
+            _audio.PlayPvs(component.ValveSound, uid, AudioParams.Default.WithVariation(0.25f));
         }
 
         public void Set(EntityUid uid, GasValveComponent component, bool value)
index 14a1e5e456baff2abaf6f610add0ea2e211d8f9e..1ec1bdb1c17733e1ab9404b2d306928db3cdf4b2 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Lock;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
index b1e7dcb1878d6a5c9adca344f2b7fa0b3fbea0c2..1c5625b0b832b79732300b5fe6184f860e19a1d0 100644 (file)
@@ -1,8 +1,41 @@
+using Content.Server.GameTicking.Events;
 using Content.Shared.Audio;
+using Robust.Server.Audio;
+using Robust.Shared.Audio;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Audio;
 
 public sealed class ContentAudioSystem : SharedContentAudioSystem
 {
+    [Dependency] private readonly AudioSystem _serverAudio = default!;
+    [Dependency] private readonly IPrototypeManager _protoManager = default!;
 
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
+        _protoManager.PrototypesReloaded += OnProtoReload;
+    }
+
+    private void OnProtoReload(PrototypesReloadedEventArgs obj)
+    {
+        if (!obj.ByType.ContainsKey(typeof(AudioPresetPrototype)))
+            return;
+
+        _serverAudio.ReloadPresets();
+    }
+
+    public override void Shutdown()
+    {
+        base.Shutdown();
+        _protoManager.PrototypesReloaded -= OnProtoReload;
+    }
+
+    private void OnRoundStart(RoundStartingEvent ev)
+    {
+        // On cleanup all entities get purged so need to ensure audio presets are still loaded
+        // yeah it's whacky af.
+        _serverAudio.ReloadPresets();
+    }
 }
index a9f994ed5609d1065006e89721f833a8a937a010..33f2f252d90dd31180c77772d763de1d722d8b93 100644 (file)
@@ -3,6 +3,8 @@ using Content.Server.Beam.Components;
 using Content.Shared.Beam;
 using Content.Shared.Beam.Components;
 using Content.Shared.Physics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Collision.Shapes;
index 17fe4d5effb4d51e7b84c02702aedf24577cb1f3..4a6874bcccdd9980bfdfa48d446cacca73908e4f 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Slippery;
 using Content.Shared.StatusEffect;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index b3b41e2f32eca0b99a78e0615dd9dccdb91de685..5c153bb46452485ee51452c68ee84382ac5c8ef2 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Popups;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -29,6 +30,7 @@ namespace Content.Server.Bible
         [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
         [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly UseDelaySystem _delay = default!;
 
         public override void Initialize()
@@ -80,8 +82,8 @@ namespace Content.Server.Bible
                     summonableComp.Summon = null;
                 }
                 summonableComp.AlreadySummoned = false;
-                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", uid)), uid, PopupType.Medium);
-                SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(-4f));
+                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium);
+                _audio.PlayPvs("/Audio/Effects/radpulse9.ogg", summonableComp.Owner, AudioParams.Default.WithVolume(-4f));
                 // Clean up the accumulator and respawn tracking component
                 summonableComp.Accumulator = 0;
                 _remQueue.Enqueue(uid);
@@ -107,7 +109,7 @@ namespace Content.Server.Bible
             {
                 _popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, args.User);
 
-                SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User);
+                _audio.PlayPvs(component.SizzleSoundPath, args.User);
                 _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid);
                 _delay.BeginDelay(uid, delay);
 
@@ -125,7 +127,7 @@ namespace Content.Server.Bible
                     var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
                     _popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution);
 
-                    SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User);
+                    _audio.PlayPvs("/Audio/Effects/hit_kick.ogg", args.User);
                     _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid);
                     _delay.BeginDelay(uid, delay);
                     return;
@@ -149,7 +151,7 @@ namespace Content.Server.Bible
 
                 var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
                 _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large);
-                SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
+                _audio.PlayPvs(component.HealSoundPath, args.User);
                 _delay.BeginDelay(uid, delay);
             }
         }
index ddc32ab01526e32ed1bad62e981925fbfeea8cab..f1ab5702e5bfdf733678dfb40576756fbc8b3976 100644 (file)
@@ -20,6 +20,8 @@ using Content.Shared.Speech.EntitySystems;
 using Robust.Server.GameObjects;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using Content.Shared.Speech.EntitySystems;
+using Robust.Server.Audio;
 
 namespace Content.Server.Body.Systems;
 
index 242b02d78c1059239db5ab611ea6db4d643dc5dc..763e53de00b49a57f5040b93f8a95253b0b5db62 100644 (file)
@@ -15,6 +15,7 @@ using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using System.Numerics;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Body.Systems;
 
@@ -129,7 +130,7 @@ public sealed class BodySystem : SharedBodySystem
         var filter = Filter.Pvs(bodyId, entityManager: EntityManager);
         var audio = AudioParams.Default.WithVariation(0.025f);
 
-        _audio.Play(body.GibSound, filter, coordinates, true, audio);
+        _audio.PlayStatic(body.GibSound, filter, coordinates, true, audio);
 
         foreach (var entity in gibs)
         {
index 817064c6519ccfd3d413ca182ed1786d5b328016..027ca9b03845337804e76343e26a4061552cfcf5 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Random;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index df9743a21a62edfaddf655d913068c3a505ff6ad..83445d2ae4e21ca05879c220cbe736f93818d437 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Stealth;
 using Content.Shared.Stealth.Components;
 using Content.Shared.Storage.Components;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 32b63f7105b328189d35dc8a4f5ab7b292dd904d..51cfc9791cb2a6d257d7478f14b4f059f1ae6a62 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Mobs.Components;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index b115e658bb2e77bdf978ae84956d50dd7dd7accf..f01be1fc715fac17ba908f9aeb627db36d0ca4d8 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.CartridgeLoader;
 using Content.Shared.CartridgeLoader.Cartridges;
 using Content.Shared.Popups;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
index 578444a4648084bb3ad3ab1a9e06e573d9715ca5..5fcbf6a051148e08fbd136864fd432f405cd3053 100644 (file)
@@ -21,6 +21,7 @@ using Content.Shared.Players;
 using Content.Shared.Radio;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Network;
@@ -322,7 +323,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         _chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride);
         if (playSound)
         {
-            SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f));
+            _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), true, AudioParams.Default.WithVolume(-2f));
         }
         _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
     }
@@ -360,7 +361,7 @@ public sealed partial class ChatSystem : SharedChatSystem
 
         if (playDefaultSound)
         {
-            SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f));
+            _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, true, AudioParams.Default.WithVolume(-2f));
         }
 
         _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}");
index 5e4ba355cf1bb5443e092be61f5079809b216b2d..5b91d9456bd1a767696f968df815de0a4e2aeb54 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Database;
 using Content.Shared.FixedPoint;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
index fc4ea0a0b2a13ed726827e2978031599fc831e0e..759d403acee0ed3b54efbfedddfe4711400b5147 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Chemistry;
 using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.DoAfter;
 using Content.Shared.Mobs.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Chemistry.EntitySystems;
 
index daa2ac80b7de14cca7fbfb7e1109d665d622c098..3768ee1051b9e767e3df2fd1936c73ac583ae9eb 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Database;
 using Content.Shared.Emag.Components;
 using Content.Shared.Emag.Systems;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
index 291a654422ebfe0e1d1f667856e505643c3b57aa..fc807069f78ebbf3792e672b5f08cfd3b802bf63 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Maps;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -72,7 +73,8 @@ namespace Content.Server.Chemistry.ReactionEffects
             var smoke = args.EntityManager.System<SmokeSystem>();
             smoke.StartSmoke(ent, splitSolution, _duration, spreadAmount);
 
-            args.EntityManager.System<SharedAudioSystem>().PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
+            var audio = args.EntityManager.System<SharedAudioSystem>();
+            audio.PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
         }
     }
 }
index 6d34e0e6f73e68d5b063cae1507f0877271edf3d..8bfd6250efce3798c01760e625ac7eb9d5d0db13 100644 (file)
@@ -29,6 +29,8 @@ using Content.Shared.Roles.Jobs;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Components;
index 9ce50137bf6882587039ca136c56326c8b2efde0..c170886a803a0425e7bd2e801f41f25fe8688381 100644 (file)
@@ -14,6 +14,8 @@ using Content.Server.Emoting.Systems;
 using Content.Server.Speech.EntitySystems;
 using Content.Shared.Cluwne;
 using Content.Shared.Interaction.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Cluwne;
 
index 9fa3c43ae47b8081e3afb1d44421809494b4af9d..50b705ddfeb1c63866bcbc39590009e4d51e6f11 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Shared.Construction;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Construction.Completions
index 6cf32a5e4607b57e8eb87fdf03eaaf161686cc7a..a2579c92e803b618c767c69a2ebf601758cba04e 100644 (file)
@@ -25,5 +25,5 @@ public sealed partial class PartExchangerComponent : Component
     [DataField("exchangeSound")]
     public SoundSpecifier ExchangeSound = new SoundPathSpecifier("/Audio/Items/rped.ogg");
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 }
index 4b543a0247a738c223e3975d4aa11c2b2e7c278f..75629146a4cdab23ba3111596f8421fbc46f2df2 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Storage;
 using Robust.Shared.Containers;
 using Robust.Shared.Utility;
 using Content.Shared.Wires;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 
 namespace Content.Server.Construction;
@@ -34,7 +36,7 @@ public sealed class PartExchangerSystem : EntitySystem
     {
         if (args.Cancelled)
         {
-            component.AudioStream?.Stop();
+            component.AudioStream = _audio.Stop(component.AudioStream);
             return;
         }
 
@@ -168,7 +170,7 @@ public sealed class PartExchangerSystem : EntitySystem
             return;
         }
 
-        component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid);
+        component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid).Value.Entity;
 
         _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid)
         {
index 16385d4d7ef8368a327c2e0cc1b95a63955d64cf..32bb96e9e2879f18d2c56cef6229d5fcd9dcb884 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index ca5c6f5a09759e97cef99b52c607d30f288641d8..e9b074268f103d01c36e3f2d461b97118eb42694 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Popups;
 using Content.Shared.Verbs;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Defusable.Systems;
 
index 74e88292df35e8980e38942d48f5bb94aff4844f..7e43e72007821e317bdba4ce20ca45d3002c85b7 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Database;
 using Content.Shared.Destructible;
 using Content.Shared.FixedPoint;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
 using Robust.Shared.Prototypes;
index 74a4cdfb1b6060bb2e3db585b630ce38de49b44a..26ba01c359f9079bc9a1c24329aa831bfc9bfe05 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Audio;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Destructible.Thresholds.Behaviors
index 8f4bade83a80cebf5821eb46ef48159b71cddee7..8ca6fd75c2ee1a88542c94034ae7c5a2b4b41894 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceLinking.Components.Overload;
 using Content.Server.DeviceLinking.Events;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 
index 5641b0b4aee8240b318b92a4c0f8707bd0306490..60d13b78fc214d3d62c82f64c48664d3213a87f9 100644 (file)
@@ -5,7 +5,9 @@ using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using Content.Shared.Tools;
 using Content.Shared.Popups;
-using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
+using Content.Shared.Tools.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using SignalReceivedEvent = Content.Server.DeviceLinking.Events.SignalReceivedEvent;
 
 namespace Content.Server.DeviceLinking.Systems;
index 7bcc438b92af02808282a5547f35c34f705381d5..f6469d68b932d845fafd025709a8b7b2d2e938c9 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceNetwork;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.DeviceLinking.Systems;
 
index 3a7fd6bec996ce830a50c76d2c87e09c01dd7a6f..63bf5854d9cf3afecb80199f609e4cf7f4937d1e 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Access.Systems;
 using Content.Shared.MachineLinking;
 using Content.Shared.TextScreen;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.DeviceLinking.Systems;
index a977a44287a1c19de3f23872882759186c7be9db..4deb08ec3dba1d51ef69c3312f28204db4a9f66d 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
index beb2a284897a55484faaca0708f8eef0447f5415..2d13679bd099f31d00d77fe7876324d131b4053c 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Dice;
 using Content.Shared.Popups;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Dice;
index 33b260aa9498b566518c27b4c5888f5079f3cbb3..2bf00c5008c5473380e158c48ac32552f239019d 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Movement.Events;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
index 7c4827f8c8b84f28c028b5e15f96c8e9eaaaacba..0811be059be05f189ee122a24257bff601b2fd82 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Damage;
 using Content.Shared.Item;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
index 52137f2ee6effd7a79077d4f0cc4879e9c4ebab1..f7d5cd783d45a616d4727675aa5ad1812716b309 100644 (file)
@@ -11,6 +11,8 @@ using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Serialization.Manager;
 using System.Numerics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Dragon;
 
index ed17ba8bdc2e1d29f062e78c52643f14c5af23e7..93d6bc8db0b3a97c376f4837129b2e7c0d5a7e07 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
 using Content.Shared.Mobs;
 using Content.Shared.Movement.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -203,7 +205,7 @@ public sealed partial class DragonSystem : EntitySystem
     private void Roar(EntityUid uid, DragonComponent comp)
     {
         if (comp.SoundRoar != null)
-            _audio.Play(comp.SoundRoar, Filter.Pvs(uid, 4f, EntityManager), uid, true);
+            _audio.PlayPvs(comp.SoundRoar, uid);
     }
 
     /// <summary>
index 8ddc8540c04a0b0fd0a3de16a76ddcb809f44f11..4dc4f198a5aa9b45a5c1cca32b970aa6cab2ec56 100644 (file)
@@ -26,6 +26,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
index 08374d739245af6e3eb8eecb4576d57a019737e9..ef8e1ffd987f304e1af954354f8f84f5162472e8 100644 (file)
@@ -50,11 +50,11 @@ public sealed partial class ExplosionSystem : EntitySystem
         comp.Intensity = iterationIntensity;
         comp.SpaceMatrix = spaceMatrix;
         comp.SpaceTileSize = spaceData?.TileSize ?? DefaultTileSize;
-        Dirty(comp);
+        Dirty(explosionEntity, comp);
 
         // Light, sound & visuals may extend well beyond normal PVS range. In principle, this should probably still be
         // restricted to something like the same map, but whatever.
-        _pvsSys.AddGlobalOverride(explosionEntity);
+        _pvsSys.AddGlobalOverride(GetNetEntity(explosionEntity));
 
         var appearance = AddComp<AppearanceComponent>(explosionEntity);
         _appearance.SetData(explosionEntity, ExplosionAppearanceData.Progress, 1, appearance);
index be62aeb5ed6648847a08ec7ef039770808424263..a246b940859aebc0be688564749503652b295ec5 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Throwing;
 using Robust.Server.GameStates;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
@@ -48,6 +49,7 @@ public sealed partial class ExplosionSystem : EntitySystem
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] private readonly ThrowingSystem _throwingSystem = default!;
     [Dependency] private readonly PvsOverrideSystem _pvsSys = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
     [Dependency] private readonly SharedMapSystem _map = default!;
 
@@ -333,7 +335,7 @@ public sealed partial class ExplosionSystem : EntitySystem
         // play sound.
         var audioRange = iterationIntensity.Count * 5;
         var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange);
-        SoundSystem.Play(type.Sound.GetSound(), filter, mapEntityCoords, _audioParams);
+        _audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams);
 
         return new Explosion(this,
             type,
index b57e9bd29872050d74b97432fa1b34da5b9c451e..854fa7f661e099fef8aec581bdc4b52c59951903 100644 (file)
@@ -24,6 +24,7 @@ using Robust.Shared.Physics.Systems;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Weapons.Ranged.Events;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Explosion.EntitySystems
 {
index 7b96b8b921787cae2ea55294df6a9819f2b44438..30895deb4c3c2df2cb2e648213897122fcae2acd 100644 (file)
@@ -9,6 +9,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Extinguisher;
@@ -18,6 +19,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
     [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -86,7 +88,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
             var drained = _solutionContainerSystem.Drain(target, targetSolution, transfer);
             _solutionContainerSystem.TryAddSolution(uid, container, drained);
 
-            SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid);
+            _audio.PlayPvs(component.RefillSound, uid);
             _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", uid)),
                 uid, args.Target.Value);
         }
@@ -135,8 +137,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
             return;
 
         extinguisher.Safety = !extinguisher.Safety;
-        SoundSystem.Play(extinguisher.SafetySound.GetSound(), Filter.Pvs(uid),
-            uid, AudioHelpers.WithVariation(0.125f).WithVolume(-4f));
+        _audio.PlayPvs(extinguisher.SafetySound, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-4f));
         UpdateAppearance(uid, extinguisher);
     }
 }
index ec95d71dcf40454940c95f11c4356f0e45aa138b..647f73bad35c24e54dc59628e96beadf4da7341d 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Paper;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
index bc2c4ddabafd8b29da31f261b9d10a417e441aad..29d603bfc6b0fc3ad7bf2fa8b732e10b8e6a4bd5 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Physics;
 using Content.Shared.Tag;
 using Content.Shared.Traits.Assorted;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
@@ -172,7 +173,7 @@ namespace Content.Server.Flash
             }
             if (sound != null)
             {
-                SoundSystem.Play(sound.GetSound(), Filter.Pvs(transform), source);
+                _audio.PlayPvs(sound, source);
             }
         }
 
index 7483199bc62871e3dbf67bc6fd1559b7132a130c..55f56ab9d1976e765baea7e122dca760a0c0b688 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Fluids.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Timing;
 using Content.Shared.Weapons.Melee;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index ea3df2f8c4685f041f5bda40fb503f683050eadc..505ce71261fb00fb1e5ad025b9ee1740ce70c470 100644 (file)
@@ -13,6 +13,9 @@ using Content.Shared.Fluids.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Tag;
 using Content.Shared.Verbs;
+using Content.Shared.Fluids.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index b56e1f93081b60c1b2cce8d593b78552c1ed174d..05d0809bb2b153045d94b438f3f275e622e3bea4 100644 (file)
@@ -30,6 +30,11 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
+using Content.Shared.Movement.Components;
+using Content.Shared.Movement.Systems;
+using Content.Shared.Maps;
+using Content.Shared.Effects;
+using Robust.Server.Audio;
 
 namespace Content.Server.Fluids.EntitySystems;
 
@@ -446,8 +451,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
             return true;
         }
 
-        SoundSystem.Play(puddleComponent.SpillSound.GetSound(),
-            Filter.Pvs(puddleUid), puddleUid);
+        _audio.PlayPvs(puddleComponent.SpillSound, puddleUid);
         return true;
     }
 
index f0afd43dd2fb4d10e5751b62a5b2ddddb6a85c85..1b87b3ef246d692c5063294b4878939ba7b4563b 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Interaction;
 using Content.Shared.Vapor;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
index acf7cbd80dcc4a38e731566bef0a22c70a228a56..a073574e1d14173e967fb1f61cc0f2b5eecb4ba2 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Forensics;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio.Systems;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
index d994faec66245b33e165ca67406d8781f21fa253..a333e68d054ca4cd155f926f3918ac7b6f522dfa 100644 (file)
@@ -32,7 +32,7 @@ namespace Content.Server.GameTicking
                 if (args.NewStatus != SessionStatus.Disconnected)
                 {
                     mind.Session = session;
-                    _pvsOverride.AddSessionOverride(mindId.Value, session);
+                    _pvsOverride.AddSessionOverride(GetNetEntity(mindId.Value), session);
                 }
 
                 DebugTools.Assert(mind.Session == session);
@@ -120,7 +120,7 @@ namespace Content.Server.GameTicking
                     _chatManager.SendAdminAnnouncement(Loc.GetString("player-leave-message", ("name", args.Session.Name)));
                     if (mind != null)
                     {
-                        _pvsOverride.ClearOverride(mindId!.Value);
+                        _pvsOverride.ClearOverride(GetNetEntity(mindId!.Value));
                         mind.Session = null;
                     }
 
index 1d354136623a3f4d32712c6393ee736b0b4a94dd..7efcf796adc0b664e107c93c53861135cfd7e651 100644 (file)
@@ -362,7 +362,7 @@ namespace Content.Server.GameTicking
                     playerIcName = icName;
 
                 if (TryGetEntity(mind.OriginalOwnedEntity, out var entity))
-                    _pvsOverride.AddGlobalOverride(entity.Value, recursive: true);
+                    _pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true);
 
                 var roles = _roles.MindGetAllRoles(mindId);
 
@@ -611,7 +611,7 @@ namespace Content.Server.GameTicking
                 _chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
 
             if (proto.Sound != null)
-                SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
+                _audio.PlayGlobal(proto.Sound, Filter.Broadcast(), true);
         }
 
         private async void SendRoundStartedDiscordMessage()
index 14819fb0acaa6b672c9414517d4c88e1df494fdc..8da271e1a8d8093871fc1047b97f6aeffde825dd 100644 (file)
@@ -19,6 +19,8 @@ using Content.Shared.Roles;
 using Robust.Server;
 using Robust.Server.GameObjects;
 using Robust.Server.GameStates;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
@@ -61,6 +63,7 @@ namespace Content.Server.GameTicking
         [Dependency] private readonly PlayTimeTrackingSystem _playTimeTrackings = default!;
         [Dependency] private readonly PvsOverrideSystem _pvsOverride = default!;
         [Dependency] private readonly ServerUpdateManager _serverUpdates = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationJobsSystem _stationJobs = default!;
         [Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
         [Dependency] private readonly SharedTransformSystem _transform = default!;
index 2c3136d5777844f83e3a45a5157f1c4ed8143afd..c1773b3140c610aa5fcc0c8362418d7e15d45238 100644 (file)
@@ -45,6 +45,7 @@ using Robust.Server.GameObjects;
 using Robust.Server.Maps;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index f94fbace9ce9cfff4efc538d9dc1335bdb07820e..1c04835c55e2458369e50fef9f074dc6d215ba62 100644 (file)
@@ -16,6 +16,9 @@ using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
index e58fe2275d6657a0eccd4d16335a45c03385bc93..13369ff8d0857db3c15d6361c2df0ce1ce8d1052 100644 (file)
@@ -24,6 +24,7 @@ using Content.Shared.Revolutionary.Components;
 using Content.Shared.Roles;
 using Content.Shared.Stunnable;
 using Content.Shared.Zombies;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Timing;
 
index 52a588108371e513382b2740aacec17907951ad3..60a35d704b034cb80997047847b970159a1e1b86 100644 (file)
@@ -17,6 +17,9 @@ using Content.Shared.PDA;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index a4febc385c1dae8e73c17f1446fbd5ce290e0668..f4319815a7adc3755547bf59b54239104dd68a00 100644 (file)
@@ -22,6 +22,8 @@ using Content.Shared.Roles;
 using Content.Shared.Zombies;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 34ca80eaf566fa9d0ae111c612508a5ffdfd0127..d05cca3af6c33b74359ae2dfe09998798eb8a97d 100644 (file)
@@ -8,6 +8,9 @@ using Content.Shared.Teleportation.Components;
 using Content.Shared.Teleportation.Systems;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.GameObjects;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
index 4f7d19b0a8b0c620e7b75243169cbe5b8e86eecd..7fbbf7f4f649a6d1d727d32b42c722707f12f3c3 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
index eaf95a1f1dcab2e9632b80fd9913f43330dd2a99..58eed00c492bfef408523fc66cf4fd0ef9950f7f 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Database;
 using Content.Shared.Hands;
 using Robust.Shared.Timing;
 using Content.Shared.Interaction.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Glue;
 
index 2847b45ba17bd887825ced17866e1a5665ebd6d6..1b3cbd1fc3ad23bb8f461ede7ff227da64dd49d9 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Mobs;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
@@ -217,8 +219,7 @@ namespace Content.Server.Guardian
             if (TryComp<GuardianComponent>(guardian, out var guardianComp))
             {
                 guardianComp.Host = args.Args.Target.Value;
-                // TODO this should be a data field, not a hardcoded path
-                _audio.Play("/Audio/Effects/guardian_inject.ogg", Filter.Pvs(args.Args.Target.Value), args.Args.Target.Value, true);
+                _audio.PlayPvs("/Audio/Effects/guardian_inject.ogg", args.Args.Target.Value);
                 _popupSystem.PopupEntity(Loc.GetString("guardian-created"), args.Args.Target.Value, args.Args.Target.Value);
                 // Exhaust the activator
                 component.Used = true;
@@ -243,13 +244,12 @@ namespace Content.Server.Guardian
             if (args.NewMobState == MobState.Critical)
             {
                 _popupSystem.PopupEntity(Loc.GetString("guardian-host-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value);
-                // TODO this should be a data field, not a hardcoded path
-                _audio.Play("/Audio/Effects/guardian_warn.ogg", Filter.Pvs(component.HostedGuardian.Value), component.HostedGuardian.Value, true);
+                _audio.PlayPvs("/Audio/Effects/guardian_warn.ogg", component.HostedGuardian.Value);
             }
             else if (args.NewMobState == MobState.Dead)
             {
                 //TODO: Replace WithVariation with datafield
-                _audio.Play("/Audio/Voice/Human/malescream_guardian.ogg", Filter.Pvs(uid), uid, true, AudioHelpers.WithVariation(0.20f));
+                _audio.PlayPvs("/Audio/Voice/Human/malescream_guardian.ogg", uid, AudioParams.Default.WithVariation(0.20f));
                 RemComp<GuardianHostComponent>(uid);
             }
         }
index 4581d378f69c08b41ae151e02b4c6df7bf93e3ac..40b365105d14e47fccd83d449d618c5e9eb00746 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Database;
 using Content.Shared.Examine;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
index 256a8578642ad4f7f554549714a7254e32a5e6f1..d80d7ecbfcfbb8e21581410351403ecc5c376a0a 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.Explosion.EntitySystems;
 using Content.Shared.Timing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.IgnitionSource;
index d688941abff37a48c920acf9b81a058ec9aea14d..0fa8f7d292f2cd6b52f562d7a28e8ce3b6953d64 100644 (file)
@@ -3,6 +3,8 @@ using Content.Server.Popups;
 using Content.Shared.Body.Components;
 using Content.Shared.Examine;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
index 86158fb7a89f5a67a0803423295172197d719c48..474284cf8066712731e8699e331a02177d644c23 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -18,6 +19,7 @@ public sealed class InteractionPopupSystem : EntitySystem
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -41,15 +43,17 @@ public sealed class InteractionPopupSystem : EntitySystem
         if (curTime < component.LastInteractTime + component.InteractDelay)
             return;
 
-        if (TryComp<MobStateComponent>(uid, out var state) // if it has a MobStateComponent,
-            && !_mobStateSystem.IsAlive(uid, state))                           // AND if that state is not Alive (e.g. dead/incapacitated/critical)
+        if (TryComp<MobStateComponent>(uid, out var state)
+            && !_mobStateSystem.IsAlive(uid, state))
+        {
             return;
+        }
 
         // TODO: Should be an attempt event
         // TODO: Need to handle pausing with an accumulator.
 
         string msg = ""; // Stores the text to be shown in the popup message
-        string? sfx = null; // Stores the filepath of the sound to be played
+        SoundSpecifier? sfx = null; // Stores the filepath of the sound to be played
 
         if (_random.Prob(component.SuccessChance))
         {
@@ -57,7 +61,7 @@ public sealed class InteractionPopupSystem : EntitySystem
                 msg = Loc.GetString(component.InteractSuccessString, ("target", Identity.Entity(uid, EntityManager))); // Success message (localized).
 
             if (component.InteractSuccessSound != null)
-                sfx = component.InteractSuccessSound.GetSound();
+                sfx = component.InteractSuccessSound;
 
             if (component.InteractSuccessSpawn != null)
                 Spawn(component.InteractSuccessSpawn, Transform(uid).MapPosition);
@@ -68,7 +72,7 @@ public sealed class InteractionPopupSystem : EntitySystem
                 msg = Loc.GetString(component.InteractFailureString, ("target", Identity.Entity(uid, EntityManager))); // Failure message (localized).
 
             if (component.InteractFailureSound != null)
-                sfx = component.InteractFailureSound.GetSound();
+                sfx = component.InteractFailureSound;
 
             if (component.InteractFailureSpawn != null)
                 Spawn(component.InteractFailureSpawn, Transform(uid).MapPosition);
@@ -76,7 +80,7 @@ public sealed class InteractionPopupSystem : EntitySystem
 
         if (component.MessagePerceivedByOthers != null)
         {
-            string msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
+            var msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
                 ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager)));
             _popupSystem.PopupEntity(msg, uid, args.User);
             _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true);
@@ -87,9 +91,9 @@ public sealed class InteractionPopupSystem : EntitySystem
         if (sfx is not null) //not all cases will have sound.
         {
             if (component.SoundPerceivedByOthers)
-                SoundSystem.Play(sfx, Filter.Pvs(args.Target), args.Target); //play for everyone in range
+                _audio.PlayPvs(sfx, args.Target); //play for everyone in range
             else
-                SoundSystem.Play(sfx, Filter.Entities(args.User, args.Target), args.Target); //play only for the initiating entity and its target.
+                _audio.PlayEntity(sfx, Filter.Entities(args.User, args.Target), args.Target, true); //play only for the initiating entity and its target.
         }
 
         component.LastInteractTime = curTime;
index 5610582007d68a9b71505d472abc562916c86246..fb72148b88b1e261d85abe907c8012a9cbfd7be2 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
 using Content.Shared.Toggleable;
 using Content.Shared.Tools.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Weapons.Melee.ItemToggle;
@@ -53,7 +55,7 @@ public sealed class ItemToggleSystem : EntitySystem
         if (TryComp<DisarmMalusComponent>(uid, out var malus))
             malus.Malus -= comp.ActivatedDisarmMalus;
 
-        _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
+        _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
 
         comp.Activated = false;
     }
@@ -66,7 +68,7 @@ public sealed class ItemToggleSystem : EntitySystem
         if (TryComp<DisarmMalusComponent>(uid, out var malus))
             malus.Malus += comp.ActivatedDisarmMalus;
 
-        _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
+        _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
 
         comp.Activated = true;
     }
index 56ea23e27e6a3e633803906bc8fc970b36f3d625..45f927389ef0cad28de6564cc1587ae383367fd2 100644 (file)
@@ -30,7 +30,8 @@ namespace Content.Server.Kitchen.Components
         [DataField("ItemBreakSound")]
         public SoundSpecifier ItemBreakSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
 
-        public IPlayingAudioStream? PlayingStream { get; set; }
+        public EntityUid? PlayingStream;
+
         [DataField("loopingSound")]
         public SoundSpecifier LoopingSound = new SoundPathSpecifier("/Audio/Machines/microwave_loop.ogg");
         #endregion
index 4b53049086de8fd6bf2d82634349d6633b72521e..2a028a85805b7db70323b2479610b45a4c6628eb 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Server.Kitchen.Components
         [DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)]
         public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
 
-        public IPlayingAudioStream? AudioStream;
+        public EntityUid? AudioStream;
     }
 
     [Access(typeof(ReagentGrinderSystem)), RegisterComponent]
index 6e563ff45fd5c29d55deffcfabfbf517b3e0609d..0419e13d230cac0251bc1361d74d52306709307f 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Storage;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using static Content.Shared.Kitchen.Components.KitchenSpikeComponent;
@@ -154,7 +156,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 QueueDel(gib);
             }
 
-            _audio.Play(component.SpikeSound, Filter.Pvs(uid), uid, true);
+            _audio.PlayEntity(component.SpikeSound, Filter.Pvs(uid), uid, true);
         }
 
         private bool TryGetPiece(EntityUid uid, EntityUid user, EntityUid used,
index 5cee960df884b5daf467a13d4505b520a60d81b6..436f040acf7ffc9532c2f91f0600b813feb76a69 100644 (file)
@@ -28,6 +28,7 @@ using Content.Shared.Tag;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
@@ -82,7 +83,7 @@ namespace Content.Server.Kitchen.EntitySystems
             SetAppearance(uid, MicrowaveVisualState.Cooking, microwaveComponent);
 
             microwaveComponent.PlayingStream =
-                _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5));
+                _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)).Value.Entity;
         }
 
         private void OnCookStop(EntityUid uid, ActiveMicrowaveComponent component, ComponentShutdown args)
@@ -91,7 +92,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 return;
             SetAppearance(uid, MicrowaveVisualState.Idle, microwaveComponent);
 
-            microwaveComponent.PlayingStream?.Stop();
+            microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
         }
 
         /// <summary>
index 6ce53dc53021c8bedde529e1df6120ecc881d8d6..3a6d5e4134c225c0fd10578151a48be6208e5fdc 100644 (file)
@@ -16,6 +16,7 @@ using Content.Shared.Stacks;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Timing;
 
@@ -64,7 +65,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 if (active.EndTime > _timing.CurTime)
                     continue;
 
-                reagentGrinder.AudioStream?.Stop();
+                reagentGrinder.AudioStream = _audioSystem.Stop(reagentGrinder.AudioStream);
                 RemCompDeferred<ActiveReagentGrinderComponent>(uid);
 
                 var inputContainer = _containerSystem.EnsureContainer<Container>(uid, SharedReagentGrinder.InputContainerId);
@@ -284,7 +285,7 @@ namespace Content.Server.Kitchen.EntitySystems
             active.Program = program;
 
             reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid,
-                AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)); //slightly higher pitched
+                AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)).Value.Entity; //slightly higher pitched
             _userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key,
                 new ReagentGrinderWorkStartedMessage(program));
         }
index 309ee583162a2478900d008e163d51f0be61c296..c6614fcd4f98c0ae098d985a12c571239b8d57e8 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Research.Components;
 using Content.Shared.Research.Prototypes;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 
index f4db4216cfe1f6000b3de4a7e3c6f8781ecc1707..40d212c6ad90769d39783ccefd3a89b3bac9ccca 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Temperature;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Light.EntitySystems
index f3e7eaca0eab6ba1563f7086e586e09aa18dea5e..70ce3c748809e55d9713ae93a5bbabc67587e0d1 100644 (file)
@@ -9,6 +9,10 @@ using Content.Shared.Light.Components;
 using Content.Shared.Rounding;
 using Content.Shared.Toggleable;
 using Content.Shared.Verbs;
+using JetBrains.Annotations;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Utility;
index 43b0b4662c84250c56f94475dd239bd4aed02a61..5714bde3e5f0c4289b7e609c3c2768a77e80eb92 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Light.Components;
 using Content.Shared.Throwing;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Light.EntitySystems
@@ -11,6 +12,7 @@ namespace Content.Server.Light.EntitySystems
     public sealed class LightBulbSystem : EntitySystem
     {
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -68,7 +70,7 @@ namespace Content.Server.Light.EntitySystems
             if (!Resolve(uid, ref bulb))
                 return;
 
-            SoundSystem.Play(bulb.BreakSound.GetSound(), Filter.Pvs(uid), uid);
+            _audio.PlayPvs(bulb.BreakSound, uid);
         }
 
         private void UpdateAppearance(EntityUid uid, LightBulbComponent? bulb = null,
index d37080a1e10e0db1b418061a0e5dcfb5da4baf55..8347f14ea46e77547f95d0ba2f997e9023cbe9a8 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Light.Components;
 using Content.Shared.Popups;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 
 namespace Content.Server.Light.EntitySystems;
index 88f416ce9d46e577f34c057ab1ff92a79576347f..2195c69b184b1a704e96549bec1bf4f7150eaefd 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Smoking;
 using Content.Shared.Temperature;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Light.EntitySystems
@@ -15,6 +16,7 @@ namespace Content.Server.Light.EntitySystems
     {
         [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedItemSystem _item = default!;
         [Dependency] private readonly SharedPointLightSystem _lights = default!;
         [Dependency] private readonly TransformSystem _transformSystem = default!;
@@ -79,8 +81,7 @@ namespace Content.Server.Light.EntitySystems
             var component = matchstick.Comp;
 
             // Play Sound
-            SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(matchstick),
-                matchstick, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
+            _audio.PlayPvs(component.IgniteSound, matchstick, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f));
 
             // Change state
             SetState(matchstick, component, SmokableState.Lit);
index cd4322aa26720cf06ebd60f3b5c63bba8bde5835..b92fc247d0613b710eb51a35dc6dbc8a19fe5636 100644 (file)
@@ -23,6 +23,12 @@ using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
+using Content.Shared.DoAfter;
+using Content.Server.Emp;
+using Content.Server.DeviceLinking.Events;
+using Content.Server.DeviceLinking.Systems;
+using Content.Shared.Inventory;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Light.EntitySystems
 {
@@ -130,7 +136,7 @@ namespace Content.Server.Light.EntitySystems
                     if (damage != null)
                         _adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage");
 
-                    _audio.Play(light.BurnHandSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true);
 
                     args.Handled = true;
                     return;
@@ -281,7 +287,7 @@ namespace Content.Server.Light.EntitySystems
                         if (time > light.LastThunk + ThunkDelay)
                         {
                             light.LastThunk = time;
-                            _audio.Play(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
+                            _audio.PlayEntity(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
                         }
                     }
                     else
@@ -343,7 +349,9 @@ namespace Content.Server.Light.EntitySystems
         private void OnPowerChanged(EntityUid uid, PoweredLightComponent component, ref PowerChangedEvent args)
         {
             // TODO: Power moment
-            if (MetaData(uid).EntityPaused)
+            var metadata = MetaData(uid);
+
+            if (metadata.EntityPaused || TerminatingOrDeleted(uid, metadata))
                 return;
 
             UpdateLight(uid, component);
index c24966aba82387025fbada939420d4eb52907ee4..a1ed71ee4cdb48aece8a605de4e00df9bde07e6e 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Light.Components;
 using Content.Shared.Mind.Components;
 using Content.Shared.Toggleable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index 10a30dc25cbdcac5e03868641c5caa647e4e3671..86921d222ce50aab42926ad9bf5e4c41f4ef3d73 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Item;
 using Content.Shared.Lube;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Lube;
index 4fbd9e3ec78de57802d49cf032e13f1fbc81737a..42bae2ba6fce8bfa827dbbf7fb85478b011a0acb 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Physics;
 using Content.Shared.Storage;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
 using Robust.Shared.Serialization.Manager;
index a36d8b0afd9574ef3017b8149814ed319bf34378..30de1d21d9182a66da81d9f71ea2291690bedf85 100644 (file)
@@ -17,6 +17,19 @@ using Content.Shared.MassMedia.Components;
 using Content.Shared.MassMedia.Systems;
 using Content.Shared.PDA;
 using Robust.Server.GameObjects;
+using System.Linq;
+using Content.Server.Administration.Logs;
+using Content.Server.CartridgeLoader.Cartridges;
+using Content.Shared.CartridgeLoader;
+using Content.Shared.CartridgeLoader.Cartridges;
+using Content.Server.CartridgeLoader;
+using Content.Server.GameTicking;
+using Robust.Shared.Timing;
+using Content.Server.Popups;
+using Content.Server.StationRecords.Systems;
+using Content.Shared.Database;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index f485c4af3caff68da8f6aa983e88ac8e1f05c308..5d581220e2aa561ad0bf519aa901eef7a0fa71f5 100644 (file)
@@ -8,6 +8,8 @@ using Content.Server.Stack;
 using Content.Shared.Construction;
 using Content.Shared.Database;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
 
index 1424f880f360c01ccf4e7a369ef522e23802c9dd..df94bc94eefa8967ab69317b0d6fccafb9d2c953 100644 (file)
@@ -43,7 +43,7 @@ public sealed partial class MechGrabberComponent : Component
     [DataField("grabSound")]
     public SoundSpecifier GrabSound = new SoundPathSpecifier("/Audio/Mecha/sound_mecha_hydraulic.ogg");
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 
     [ViewVariables(VVAccess.ReadWrite)]
     public Container ItemContainer = default!;
index 499f833ac83eded7059b384934b5ec8bccfdbfd0..8b7a4c62040f35fc65b04ee09fb576b1712517f6 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Mech.Equipment.Components;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Wall;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
@@ -149,7 +151,7 @@ public sealed class MechGrabberSystem : EntitySystem
             return;
 
         args.Handled = true;
-        component.AudioStream = _audio.PlayPvs(component.GrabSound, uid);
+        component.AudioStream = _audio.PlayPvs(component.GrabSound, uid).Value.Entity;
         _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.GrabDelay, new GrabberDoAfterEvent(), uid, target: target, used: uid)
         {
             BreakOnTargetMove = true,
@@ -161,7 +163,7 @@ public sealed class MechGrabberSystem : EntitySystem
     {
         if (args.Cancelled)
         {
-            component.AudioStream?.Stop();
+            component.AudioStream = _audio.Stop(component.AudioStream);
             return;
         }
 
index f16d13c23cbac80ec30ac77181b5097491c4de34..20ac9420aab60271fde1ad3f214d30c6a546190a 100644 (file)
@@ -24,6 +24,8 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Throwing;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Random;
index a1e2d53d17f5b4e947a628ec8d8e3f018a0624c1..e2bd1926d445284d2efb2b83fc4b267f3388d238 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.PowerCell;
 using Content.Shared.Timing;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
index 2e04e1b03cbfaad0727df235ff8785ebcef4f991..57f66f2378ab49029c9820615df542d39051174f 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Stacks;
 using Content.Server.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Medical;
index cde361ec74c1324a99aeb14e08bf9a57866514e5..fe3944b21ee35b2a95220b404ffbb8e850129b14 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Mobs.Components;
 using Robust.Server.GameObjects;
 using Content.Server.Temperature.Components;
 using Content.Server.Body.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Medical
index d754bfd05ef80fe4f156e6f6a0ba9e61edab5e37..974c1981b569678db43ffa54b14139916dd7be0c 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.StatusEffect;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
index 46ddb072cdb82d4c49f885e7047afe17b6edfcc1..3039cad25a11a152769950c80e0f5292c199458a 100644 (file)
@@ -320,7 +320,8 @@ public sealed class MindSystem : SharedMindSystem
             return;
 
         Dirty(mindId, mind);
-        _pvsOverride.ClearOverride(mindId);
+        var netMind = GetNetEntity(mindId);
+        _pvsOverride.ClearOverride(netMind);
         if (userId != null && !_players.TryGetPlayerData(userId.Value, out _))
         {
             Log.Error($"Attempted to set mind user to invalid value {userId}");
@@ -362,7 +363,7 @@ public sealed class MindSystem : SharedMindSystem
         if (_players.TryGetSessionById(userId.Value, out var ret))
         {
             mind.Session = ret;
-            _pvsOverride.AddSessionOverride(mindId, ret);
+            _pvsOverride.AddSessionOverride(netMind, ret);
             _players.SetAttachedEntity(ret, mind.CurrentEntity);
         }
 
index 8d05d0abd14657d5eee850c3b6d7a03abdb3543f..7f3c7aa1e90e2de9f0fd8e1ea2c08ccf7aa62552 100644 (file)
@@ -14,6 +14,8 @@ using Content.Shared.Storage;
 using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Morgue;
index 91fb0ab9f1f127f609d3f6f9b5b19145a30a572a..b05c4414bcc060cce6575186f661bd8ddafd1e93 100644 (file)
@@ -3,6 +3,9 @@ using Content.Shared.Body.Components;
 using Content.Shared.Examine;
 using Content.Shared.Morgue;
 using Content.Shared.Morgue.Components;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Morgue;
index 311fd234684dbd34c1b392785cea62db042ad1a8..052262cac51c3a1e40dfda9416aa538f58935d39 100644 (file)
@@ -5,6 +5,9 @@ using Content.Shared.Damage;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Silicons.Bots;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 
 namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific;
 
index fe01b2fcbe85e694344dbbb90f9e3c8533755dea..7b012300da29e25859ea048bdc60965fcbbc717b 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Server.Interaction;
 using Content.Server.Weapons.Ranged.Systems;
 using Content.Shared.Weapons.Melee;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Random;
index 37bf0eade1887390e708bb2590ef409102ce49af..bae999faffe5793e85852acb67a182b76ee61de3 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Ninja.Components;
 using Content.Shared.Ninja.Systems;
 using Content.Shared.Popups;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Ninja.Systems;
 
index a5b78570db46ea8757591da33d2d8ffe919286f4..a1b10321051b35e115381345b427facd00fc1575 100644 (file)
@@ -24,7 +24,9 @@ using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using System.Diagnostics.CodeAnalysis;
+using System.Linq;
 using Content.Server.Objectives.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Ninja.Systems;
 
index 097058f4d35c8f74d23875fb908677bc8eeccb6b..636037060a94785d2a51a54dbbd4cddb176af8f1 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Whitelist;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Ninja.Systems;
index 2b9c9fe01e4094752d1d2e6d512adcd088c60523..16377d5f758f68af5398a1a5dc6a313ac8a5ffd2 100644 (file)
@@ -174,7 +174,7 @@ namespace Content.Server.Nuke
         /// </summary>
         public bool PlayedAlertSound = false;
 
-        public IPlayingAudioStream? AlertAudioStream = default;
+        public EntityUid? AlertAudioStream = default;
 
         /// <summary>
         ///     The radius from the nuke for which there must be floor tiles for it to be anchorable.
index ca0b0e01137c3d55af7baf3019e79118b6ec6b4d..77689c4e2b1082a7a0fa273d98044f258fae0614 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Nuke;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -216,7 +217,7 @@ public sealed class NukeSystem : EntitySystem
 
     private void OnClearButtonPressed(EntityUid uid, NukeComponent component, NukeKeypadClearMessage args)
     {
-        _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
+        _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
 
         if (component.Status != NukeStatus.AWAIT_CODE)
             return;
@@ -334,12 +335,12 @@ public sealed class NukeSystem : EntitySystem
                 {
                     component.Status = NukeStatus.AWAIT_ARM;
                     component.RemainingTime = component.Timer;
-                    _audio.Play(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
                 }
                 else
                 {
                     component.EnteredCode = "";
-                    _audio.Play(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
                 }
 
                 break;
@@ -409,7 +410,7 @@ public sealed class NukeSystem : EntitySystem
         // Don't double-dip on the octave shifting
         component.LastPlayedKeypadSemitones = number == 0 ? component.LastPlayedKeypadSemitones : semitoneShift;
 
-        _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
+        _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
     }
 
     public string GenerateRandomNumberString(int length)
@@ -500,7 +501,7 @@ public sealed class NukeSystem : EntitySystem
 
         // disable sound and reset it
         component.PlayedAlertSound = false;
-        component.AlertAudioStream?.Stop();
+        component.AlertAudioStream = _audio.Stop(component.AlertAudioStream);
 
         // turn off the spinny light
         _pointLight.SetEnabled(uid, false);
index 61bb85f9ec12947c2f8c1fa1304cff303abd30fd..7bd9b85c7913941cac567217bb2b4aeb7266fb88 100644 (file)
@@ -83,7 +83,7 @@ public sealed partial class FatExtractorComponent : Component
     [DataField("processSound")]
     public SoundSpecifier? ProcessSound;
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// A minium hunger threshold for extracting nutrition.
index e8e456c0eafbef88e559979300fcb436424561fd..1271c57a23cd07702a1a33bd68a37eb217f1159e 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Nutrition.AnimalHusbandry;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -32,6 +35,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
     [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     private readonly HashSet<EntityUid> _failedAttempts = new();
+    private readonly HashSet<EntityUid> _birthQueue = new();
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -222,7 +226,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
     {
         base.Update(frameTime);
 
-        HashSet<EntityUid> birthQueue = new();
+        _birthQueue.Clear();
         _failedAttempts.Clear();
 
         var query = EntityQueryEnumerator<ReproductiveComponent>();
@@ -230,7 +234,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
         {
             if (reproductive.GestationEndTime != null && _timing.CurTime >= reproductive.GestationEndTime)
             {
-                birthQueue.Add(uid);
+                _birthQueue.Add(uid);
             }
 
             if (_timing.CurTime < reproductive.NextBreedAttempt)
@@ -244,7 +248,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
             TryReproduceNearby(uid, reproductive);
         }
 
-        foreach (var queued in birthQueue)
+        foreach (var queued in _birthQueue)
         {
             Birth(queued);
         }
index 586f965096c7b516c9297dc9dea970db158e2784..eebe7f98d868714b57238f450f7b8d45ad977da4 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Nutrition.EntitySystems
@@ -37,7 +38,7 @@ namespace Content.Server.Nutrition.EntitySystems
 
         protected override void SplattedCreamPie(EntityUid uid, CreamPieComponent creamPie)
         {
-            _audio.Play(_audio.GetSound(creamPie.Sound), Filter.Pvs(uid), uid, false, new AudioParams().WithVariation(0.125f));
+            _audio.PlayPvs(_audio.GetSound(creamPie.Sound), uid, AudioParams.Default.WithVariation(0.125f));
 
             if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp))
             {
index e493a18ae70aaf154e56c0b4fded73fd5b7799f0..1829dc32c8f204ae411ae5c3b5b62408171fbe6a 100644 (file)
@@ -27,6 +27,7 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Throwing;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 6ab432d490224cc13945db1b085cc0ab6a99136d..63ca590f5d60f0fd4b2b750b76cc9ae904ef9e81 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Nutrition.EntitySystems;
@@ -90,7 +92,7 @@ public sealed class FatExtractorSystem : EntitySystem
 
         component.Processing = true;
         _appearance.SetData(uid, FatExtractorVisuals.Processing, true);
-        component.Stream = _audio.PlayPvs(component.ProcessSound, uid);
+        component.Stream = _audio.PlayPvs(component.ProcessSound, uid)?.Entity;
         component.NextUpdate = _timing.CurTime + component.UpdateTime;
     }
 
@@ -104,7 +106,7 @@ public sealed class FatExtractorSystem : EntitySystem
 
         component.Processing = false;
         _appearance.SetData(uid, FatExtractorVisuals.Processing, false);
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
     }
 
     public bool TryGetValidOccupant(EntityUid uid, [NotNullWhen(true)] out EntityUid? occupant, FatExtractorComponent? component = null, EntityStorageComponent? storage = null)
index 51f75a2e198cddf6e057c92506dcf6903320b52c..b18c77fffb72a757f297e85807da3636ee62ea69 100644 (file)
@@ -29,6 +29,9 @@ using Content.Shared.Verbs;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
+using Content.Shared.Tag;
+using Content.Shared.Storage;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Nutrition.EntitySystems;
 
@@ -279,7 +282,7 @@ public sealed class FoodSystem : EntitySystem
             _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(uid):food}");
         }
 
-        _audio.Play(component.UseSound, Filter.Pvs(args.Target.Value), args.Target.Value, true, AudioParams.Default.WithVolume(-1f));
+        _audio.PlayPvs(component.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-1f));
 
         // Try to break all used utensils
         foreach (var utensil in utensils)
index dd6474bc74e7a116c71d7a4514fea490b34f6df2..fbe617eff49c9bd1d33ca6fd0b4fb5039332dff5 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 
 namespace Content.Server.Nutrition.EntitySystems;
index 88916e4cf2c31ab1cc3da182447728d72a3accdf..9d255e013cd59e34d36a221ef012e5c04f762f04 100644 (file)
@@ -7,16 +7,18 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
 namespace Content.Server.Nutrition.EntitySystems
 {
-    internal sealed class SliceableFoodSystem : EntitySystem
+    public sealed class SliceableFoodSystem : EntitySystem
     {
         [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
-        [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+        [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
 
         public override void Initialize()
         {
@@ -75,8 +77,7 @@ namespace Content.Server.Nutrition.EntitySystems
                 xform.LocalRotation = 0;
             }
 
-            SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid),
-                transform.Coordinates, AudioParams.Default.WithVolume(-2));
+            _audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2));
 
             // Decrease size of item based on count - Could implement in the future
             // Bug with this currently is the size in a container is not updated
index 0f1576658bd314681eb467dce5c9de0bab310c4d..f5f34080cbb0aa0edea96da4cf4403ca07baedad 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Nutrition.Components;
 using Content.Server.Popups;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -15,6 +16,7 @@ namespace Content.Server.Nutrition.EntitySystems
         [Dependency] private readonly IRobustRandom _robustRandom = default!;
         [Dependency] private readonly FoodSystem _foodSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
 
         public override void Initialize()
@@ -66,8 +68,8 @@ namespace Content.Server.Nutrition.EntitySystems
 
             if (_robustRandom.Prob(component.BreakChance))
             {
-                SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f));
-                EntityManager.DeleteEntity(component.Owner);
+                _audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f));
+                EntityManager.DeleteEntity(uid);
             }
         }
     }
index 7494d5e12ceffbf6e3fb4e41fa5076ee347e93eb..f8aadac461de965b200b9153cbc95e7d3663a70d 100644 (file)
@@ -13,6 +13,8 @@ using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using System.Linq;
+using Robust.Server.Audio;
 
 namespace Content.Server.PDA.Ringer
 {
@@ -203,7 +205,7 @@ namespace Content.Server.PDA.Ringer
                 ringer.TimeElapsed -= NoteDelay;
                 var ringerXform = Transform(uid);
 
-                _audio.Play(
+                _audio.PlayEntity(
                     GetSound(ringer.Ringtone[ringer.NoteCount]),
                     Filter.Empty().AddInRange(ringerXform.MapPosition, ringer.Range),
                     uid,
index 0b19daa8a135840e2bc2a3358042a1c765261cc3..5e1a076af3cefac0c7702c0cc3c0e96ddc781f2a 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Paper;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
+using Robust.Shared.Utility;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using static Content.Shared.Paper.SharedPaperComponent;
 
 namespace Content.Server.Paper
index 5900dc55b3eff13c30889440a306cc3a3f390483..5d373652a97e3703a6e7da03fda2a8ac5b3daa6c 100644 (file)
@@ -7,6 +7,7 @@ using System.Diagnostics;
 using Content.Server.Administration.Managers;
 using Content.Shared.CCVar;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 using Robust.Shared.Player;
 
@@ -17,6 +18,7 @@ public sealed partial class ParticleAcceleratorSystem
     [Dependency] private readonly IAdminManager _adminManager = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
+
     private void InitializeControlBoxSystem()
     {
         SubscribeLocalEvent<ParticleAcceleratorControlBoxComponent, ComponentStartup>(OnComponentStartup);
index d52223e2b4ec8247699848ca8a15093a1c537942..d4175a1af554e0289010ff06fefa64b2c6f0e0ff 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.Interaction.Events;
 using Content.Shared.Pinpointer;
 using Content.Shared.PowerCell;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Timing;
 
index 91e544b7960e94c2341b897dcafc198056e4058d..09571c60a1309699458a1439864feeff996f30bb 100644 (file)
@@ -5,14 +5,16 @@ using Content.Server.Storage.EntitySystems;
 using Content.Shared.Audio;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Plants.Systems
 {
     public sealed class PottedPlantHideSystem : EntitySystem
     {
-        [Dependency] private readonly SecretStashSystem _stashSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
+        [Dependency] private readonly SecretStashSystem _stashSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -58,7 +60,7 @@ namespace Content.Server.Plants.Systems
             if (!Resolve(uid, ref component))
                 return;
 
-            SoundSystem.Play(component.RustleSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
+            _audio.PlayPvs(component.RustleSound, uid, AudioParams.Default.WithVariation(0.25f));
         }
     }
 }
index a71294db9d23aaf339fc3d1213d2a3adc0904afe..b5f94d097ed6a335afbb76689c73970c37490da7 100644 (file)
@@ -25,7 +25,7 @@ public sealed class PointSystem : SharedPointSystem
 
     private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args)
     {
-        _pvsOverride.AddGlobalOverride(uid);
+        _pvsOverride.AddGlobalOverride(GetNetEntity(uid));
     }
 
     /// <summary>
index fbf4961f4fd760c8226666dd13d95d200812c90c..5531f65409c3817d9837a7905ad30e8a9bf06239 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Polymorph;
 using Content.Shared.Popups;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map;
index 8d9a62cd73d822532d6ff6120dd5c6d4d944c15b..95b5d74a94575382fe8f58cfd55107573f5b2b6b 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Power.EntitySystems;
index f1f8bf06168db4929ebf95d6e1b74e8dc19972da..5ed39d51787ebd5d6e906507140f37793be6e48f 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Examine;
 using Content.Shared.Hands.Components;
 using Content.Shared.Power;
 using Content.Shared.Verbs;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Utility;
index 1180665ad12e212313e4c749330aeaa4ce14f6f8..031e19b65dc8a2da24a36ff9ac89591b77cbe947 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Popups;
 using Content.Shared.DoAfter;
 using Content.Shared.Power.Generator;
 using Content.Shared.Verbs;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
@@ -97,7 +98,7 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
         var clogged = _generator.GetIsClogged(uid);
 
         var sound = empty ? component.StartSoundEmpty : component.StartSound;
-        _audio.Play(sound, Filter.Pvs(uid), uid, true);
+        _audio.PlayEntity(sound, Filter.Pvs(uid), uid, true);
 
         if (!clogged && !empty && _random.Prob(component.StartChance))
         {
index ae7960cf8f01093022d728092d34948797055d39..7c377ef66ed4fc44abdbbc2b6b00c6c2b1a49045 100644 (file)
@@ -6,8 +6,7 @@ using Content.Server.Power.Nodes;
 using Content.Shared.Power.Generator;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
-using Robust.Server.GameObjects;
-using Robust.Shared.Player;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Power.Generator;
@@ -20,9 +19,9 @@ namespace Content.Server.Power.Generator;
 /// <seealso cref="GeneratorSystem"/>
 public sealed class PowerSwitchableSystem : SharedPowerSwitchableSystem
 {
-    [Dependency] private readonly AudioSystem _audio = default!;
     [Dependency] private readonly NodeGroupSystem _nodeGroup = default!;
     [Dependency] private readonly PopupSystem _popup = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly UseDelaySystem _useDelay = default!;
 
     public override void Initialize()
index e5a118b07e4efa2ffc60d8bd5ba98d88839a5e60..deb669350006725e6543e11a9500e7f2ba9a7d87 100644 (file)
@@ -6,6 +6,7 @@ using Content.Server.Chat.Systems;
 using Content.Server.Station.Systems;
 using Robust.Shared.Timing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.PowerSink
 {
index 3a2fe1254927f02bb367b4cf578d10acd0b28aa8..f889336a0681e04fdb538775c5b74374af1082a4 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Radiation.Components;
 using Content.Shared.Radiation.Systems;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 
@@ -149,7 +150,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
         if (!Resolve(uid, ref component, false))
             return;
 
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
 
         if (!component.Sounds.TryGetValue(component.DangerLevel, out var sounds))
             return;
@@ -163,7 +164,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
         var sound = _audio.GetSound(sounds);
         var param = sounds.Params.WithLoop(true).WithVolume(-4f);
 
-        component.Stream = _audio.PlayGlobal(sound, session, param);
+        component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
     }
 
     public static GeigerDangerLevel RadsToLevel(float rads)
index 0d60f0af4fee59fdef9e0555d29b8d4381b8cf99..8a65e0a8bc770caa07cdb9fada1c1126b7e268ab 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Research.TechnologyDisk.Components;
 using Content.Server.UserInterface;
 using Content.Shared.Research;
 using Content.Shared.Research.Components;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Timing;
 
index 6043f3fbf92ff2f3d135972ae096217b4f4386aa..5068a1a232f5372ca8d8b5f9ceb790e80ca4b638 100644 (file)
@@ -11,6 +11,7 @@ using Content.Server.Station.Systems;
 using Content.Shared.Database;
 using Content.Shared.GameTicking;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -33,6 +34,7 @@ namespace Content.Server.RoundEnd
         [Dependency] private readonly ChatSystem _chatSystem = default!;
         [Dependency] private readonly GameTicker _gameTicker = default!;
         [Dependency] private readonly EmergencyShuttleSystem _shuttle = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationSystem _stationSystem = default!;
 
         public TimeSpan DefaultCooldownDuration { get; set; } = TimeSpan.FromSeconds(30);
@@ -154,7 +156,7 @@ namespace Content.Server.RoundEnd
                 null,
                 Color.Gold);
 
-            SoundSystem.Play("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast());
+            _audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true);
 
             LastCountdownStart = _gameTiming.CurTime;
             ExpectedCountdownEnd = _gameTiming.CurTime + countdownTime;
@@ -185,7 +187,7 @@ namespace Content.Server.RoundEnd
             _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"),
                 Loc.GetString("Station"), false, colorOverride: Color.Gold);
 
-            SoundSystem.Play("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast());
+            _audio.PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast(), true);
 
             LastCountdownStart = null;
             ExpectedCountdownEnd = null;
index 2bc00397bc9bf80edd6c95fac35feaa658d208f4..6d3d831a2dab2cd6cdd34c78c5e02b377bc0be7a 100644 (file)
@@ -39,7 +39,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
     /// <summary>
     /// Countdown audio stream.
     /// </summary>
-    public IPlayingAudioStream? Stream = null;
+    public EntityUid? Stream = null;
 
     /// <summary>
     /// Sound that plays when the mission end is imminent.
index f2be8cd5008ce3538fcd7f02b65c8fac2c8bb47e..f0d4661a070966a091fd5dd878e58a7a26c6771f 100644 (file)
@@ -73,7 +73,7 @@ public sealed partial class SalvageSystem
 
     private void OnExpeditionShutdown(EntityUid uid, SalvageExpeditionComponent component, ComponentShutdown args)
     {
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
 
         foreach (var (job, cancelToken) in _salvageJobs.ToArray())
         {
index 0863362131cc510ccb845f07a921f25e5e2ae129..3b89135c58e55c7a32885d3a849e3d7bad902f2c 100644 (file)
@@ -153,7 +153,7 @@ public sealed partial class SalvageSystem
             else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
             {
                 // TODO: Some way to play audio attached to a map for players.
-                comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
+                comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true).Value.Entity;
                 comp.Stage = ExpeditionStage.MusicCountdown;
                 Dirty(uid, comp);
                 Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
index 0da6207289846136b45399eddcd36a8ca11dafea..eb98e1f2e1fc34bbf3ac6b66e3b920f48a0bbda4 100644 (file)
@@ -27,6 +27,8 @@ using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Tools.Components;
 using Robust.Server.Maps;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Timing;
 
index 43b702cd39bd15f99a44d1961aa7bc191dadddc4..105b9eae6d727b738c8e47fe3ed5b12c3e27084c 100644 (file)
@@ -51,5 +51,5 @@ public sealed partial class FTLComponent : Component
         Params = AudioParams.Default.WithVolume(-3f).WithLoop(true)
     };
 
-    public IPlayingAudioStream? TravelStream;
+    public EntityUid? TravelStream;
 }
index 3ef3d97a21aa6e350b43c8399936add84b1459cf..0f2b8b847c7b85eb4835de3fde5b92e110554556 100644 (file)
@@ -20,6 +20,9 @@ using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index 7ccadd949511bd964b6787f9976c76e9b3eb30b5..f505ce596043db7dc8afe758ccadeabd9bae472e 100644 (file)
@@ -230,8 +230,7 @@ public sealed partial class ShuttleSystem
 
         component = AddComp<FTLComponent>(uid);
         component.State = FTLState.Starting;
-        // TODO: Need BroadcastGrid to not be bad.
-        SoundSystem.Play(_startupSound.GetSound(), Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), _startupSound.Params);
+        _audio.PlayPvs(_startupSound, uid);
         // Make sure the map is setup before we leave to avoid pop-in (e.g. parallax).
         SetupHyperspace();
         return true;
@@ -287,11 +286,8 @@ public sealed partial class ShuttleSystem
                     var ev = new FTLStartedEvent(uid, target, fromMapUid, fromMatrix, fromRotation);
                     RaiseLocalEvent(uid, ref ev, true);
 
-                    if (comp.TravelSound != null)
-                    {
-                        comp.TravelStream = SoundSystem.Play(comp.TravelSound.GetSound(),
-                            Filter.Pvs(uid, 4f, entityManager: EntityManager), comp.TravelSound.Params);
-                    }
+                    comp.TravelStream = _audio.PlayPvs(comp.TravelSound, uid)?.Entity;
+
                     break;
                 // Arriving, play effects
                 case FTLState.Travelling:
@@ -377,13 +373,8 @@ public sealed partial class ShuttleSystem
                         _thruster.DisableLinearThrusters(shuttle);
                     }
 
-                    if (comp.TravelStream != null)
-                    {
-                        comp.TravelStream?.Stop();
-                        comp.TravelStream = null;
-                    }
-
-                    _audio.PlayGlobal(_arrivalSound, Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), true);
+                    comp.TravelStream = _audio.Stop(comp.TravelStream);
+                    _audio.PlayPvs(_arrivalSound, uid);
 
                     if (TryComp<FTLDestinationComponent>(uid, out var dest))
                     {
index 73dc4b208c2fb1d613ca19283ebe86df96b58647..f346398cdaaab3c3efacef785a71908194fcb526 100644 (file)
@@ -54,6 +54,6 @@ public sealed partial class ShuttleSystem
         var volume = MathF.Min(10f, 1f * MathF.Pow(jungleDiff, 0.5f) - 5f);
         var audioParams = AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation).WithVolume(volume);
 
-        _audio.Play(_shuttleImpactSound, Filter.Pvs(coordinates, rangeMultiplier: 4f, entityMan: EntityManager), coordinates, true, audioParams);
+        _audio.PlayPvs(_shuttleImpactSound, coordinates, audioParams);
     }
 }
index 2252d71d676ac4588c4903101e22b16705e372fe..97bfdc17565f1f42041ac2581075d037f756822d 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Shuttles.Systems;
 using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index 182ab6c94718ddbaf5779c6b01c11593bc4c1731..e1366fb1eb1de389a970b66bb105239f51a675fa 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Silicons.Laws.Components;
 using Content.Shared.Stunnable;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Toolshed;
index ddc63156bf0525dcf1eb38b8fc0b0089bd8da3e7..6b4347740ae9ab73124babd8ed85c764390c80ab 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Singularity.Components;
 using Content.Shared.Singularity.EntitySystems;
 using Content.Shared.Singularity.Events;
 using Robust.Server.GameStates;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
@@ -204,9 +206,9 @@ public sealed class SingularitySystem : SharedSingularitySystem
 
         MetaDataComponent? metaData = null;
         if (Resolve(uid, ref metaData) && metaData.EntityLifeStage <= EntityLifeStage.Initializing)
-            _audio.Play(comp.FormationSound, Filter.Pvs(uid), uid, true);
+            _audio.PlayPvs(comp.FormationSound, uid);
 
-        comp.AmbientSoundStream = _audio.Play(comp.AmbientSound, Filter.Pvs(uid), uid, true);
+        comp.AmbientSoundStream = _audio.PlayPvs(comp.AmbientSound, uid)?.Entity;
         UpdateSingularityLevel(uid, comp);
     }
 
@@ -219,7 +221,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
     /// <param name="args">The event arguments.</param>
     public void OnDistortionStartup(EntityUid uid, SingularityDistortionComponent comp, ComponentStartup args)
     {
-        _pvs.AddGlobalOverride(uid);
+        _pvs.AddGlobalOverride(GetNetEntity(uid));
     }
 
     /// <summary>
@@ -232,11 +234,18 @@ public sealed class SingularitySystem : SharedSingularitySystem
     /// <param name="args">The event arguments.</param>
     public void OnSingularityShutdown(EntityUid uid, SingularityComponent comp, ComponentShutdown args)
     {
-        comp.AmbientSoundStream?.Stop();
+        comp.AmbientSoundStream = _audio.Stop(comp.AmbientSoundStream);
 
         MetaDataComponent? metaData = null;
         if (Resolve(uid, ref metaData) && metaData.EntityLifeStage >= EntityLifeStage.Terminating)
-            _audio.Play(comp.DissipationSound, Filter.Pvs(uid), uid, true);
+        {
+            var xform = Transform(uid);
+            var coordinates = xform.Coordinates;
+
+            // I feel like IsValid should be checking this or something idk.
+            if (!TerminatingOrDeleted(coordinates.EntityId))
+                _audio.PlayPvs(comp.DissipationSound, coordinates);
+        }
     }
 
     /// <summary>
index 5dccb8bf9cc417840e9d85e67a281fb39b854043..aedcbbd09960b4dc53a2d4bfd564443e649a5fbd 100644 (file)
@@ -4,6 +4,8 @@ using Content.Server.Speech.Components;
 using Content.Shared.Chat.Prototypes;
 using Content.Shared.Humanoid;
 using Content.Shared.Speech;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
index c81d17caf2dcc7ddff95980f6c98ac1e2a5eb0f1..4f66a0828bd412af5c5f02164b784bb33e489e76 100644 (file)
@@ -2,6 +2,7 @@ using Robust.Shared.Audio;
 using Content.Server.Chat;
 using Content.Server.Chat.Systems;
 using Content.Shared.Speech;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
@@ -14,6 +15,7 @@ namespace Content.Server.Speech
         [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly IPrototypeManager _protoManager = default!;
         [Dependency] private readonly IRobustRandom _random = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -66,7 +68,7 @@ namespace Content.Server.Speech
             var pitchedAudioParams = component.AudioParams.WithPitchScale(scale);
 
             component.LastTimeSoundPlayed = currentTime;
-            SoundSystem.Play(contextSound, Filter.Pvs(uid, entityManager: EntityManager), uid, pitchedAudioParams);
+            _audio.PlayPvs(contextSound, uid, pitchedAudioParams);
         }
     }
 }
index 763b7697d3443e09c8437edb9b3b51c76653bc98..fd8ff9ea280412c3e492a4603e44a3480476f07a 100644 (file)
@@ -11,6 +11,8 @@ using Content.Shared.SprayPainter;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.SprayPainter;
index 41a7b153f58c0c21eb122c539cd8fb781eaf759f..537a7e7c2216094be2fe48aec915d02141be0492 100644 (file)
@@ -8,6 +8,8 @@ using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.StationEvents.Components;
 using Content.Shared.Database;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index f51c215c6e43a344c8854aa04d8c04a5dce0b337..a8144311bbf2953fc96565a1df87759eb680b5a9 100644 (file)
@@ -5,6 +5,9 @@ using Content.Shared.Storage.Components;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
+using System.Linq;
+using Content.Shared.Storage.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Storage.EntitySystems;
 
@@ -12,6 +15,7 @@ public sealed class CursedEntityStorageSystem : EntitySystem
 {
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly EntityStorageSystem _entityStorage = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -47,6 +51,7 @@ public sealed class CursedEntityStorageSystem : EntitySystem
             storage.Contents.Remove(entity);
             _entityStorage.AddToContents(entity, lockerEnt);
         }
-        SoundSystem.Play(component.CursedSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.125f, _random));
+
+        _audio.PlayPvs(component.CursedSound, uid, AudioHelpers.WithVariation(0.125f, _random));
     }
 }
index 25c31e48ca65bb9ab40449c606a412d2a5f565b0..c49bfdec9317459e24edbd46fcea487e223307c4 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Database;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
@@ -18,6 +19,7 @@ namespace Content.Server.Storage.EntitySystems
         [Dependency] private readonly IAdminLogManager _adminLogger = default!;
         [Dependency] private readonly SharedHandsSystem _hands = default!;
         [Dependency] private readonly PricingSystem _pricing = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -79,7 +81,9 @@ namespace Content.Server.Storage.EntitySystems
             }
 
             if (component.Sound != null)
-                SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid), uid);
+            {
+                _audio.PlayPvs(component.Sound, uid);
+            }
 
             component.Uses--;
 
index a38577edfa5844023d7930bf3262d95c9c164c1d..2afd57ca1f664e52d0cbd012f497539739b0de4b 100644 (file)
@@ -95,7 +95,7 @@ public sealed partial class StorageSystem : SharedStorageSystem
             UpdateAppearance((uid, storageComp, null));
 
             if (storageComp.StorageCloseSound is not null)
-                Audio.Play(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params);
+                Audio.PlayEntity(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params);
         }
     }
 
index 0435a6bea60886a6c64c996bdba7fb2ccd178af5..32c9a050435bedbadf8805a2e8b4bc82685b401d 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Store;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Store.Systems;
index f4a7448fa24fb00baab66d80d3d288996332a813..da2391a86baadef7585e4ea1a829e69763aee8e3 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Toggleable;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Stunnable.Systems
@@ -24,7 +25,7 @@ namespace Content.Server.Stunnable.Systems
         [Dependency] private readonly RiggableSystem _riggableSystem = default!;
         [Dependency] private readonly SharedPopupSystem _popup = default!;
         [Dependency] private readonly BatterySystem _battery = default!;
-        [Dependency] private readonly AudioSystem _audio = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -97,7 +98,6 @@ namespace Content.Server.Stunnable.Systems
 
         private void TurnOn(EntityUid uid, StunbatonComponent comp, EntityUid user)
         {
-
             if (comp.Activated)
                 return;
 
index d40303ab31f4e4d67d1aba37e718edfd8cdb810a..ce3d8568ab3b77aa5f0df11c7d0d7c110ba4f186 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Speech;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index 4bfe03ba4221c71c9aa73cb1589e5282b56a8e1a..29cde5d741d66da80189abde970666b2e2eb0181 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Database;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Teleportation.Components;
 using Content.Shared.Teleportation.Systems;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 
 namespace Content.Server.Teleportation;
index b10feae4533e04249c039cc5a04d8cf36c8a93d8..8bf8457e075b3e39b199fc03a0eb2800e6dee8a4 100644 (file)
@@ -17,6 +17,7 @@ using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
index 88a96dc1e8daaf9af95b741287313ed64769d274..de6a7fefc1265763ebdb3cfc6a56196f509f7cf6 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.Maps;
 using Content.Shared.Tools;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
 
index d7864ba16c8e66fdd1d83fe4371b865b82a5daf0..45c6a3d9d5572a4ce008702d8c0eb6c43bff2a11 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Weapons.Melee.Balloon;
 
index c943aeb7f0cedc8f96695d8f790d4b27ac608c0e..a08ff17ec8c0317eb6b56007613745d8f223bba1 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Weapons.Melee;
 using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Wieldable;
 using Content.Shared.Wieldable.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -116,7 +118,7 @@ public sealed class EnergySwordSystem : EntitySystem
         if (comp.IsSharp)
             RemComp<SharpComponent>(uid);
 
-        _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
+        _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
 
         comp.Activated = false;
     }
@@ -143,7 +145,7 @@ public sealed class EnergySwordSystem : EntitySystem
             malus.Malus += comp.LitDisarmMalus;
         }
 
-        _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
+        _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
 
         comp.Activated = true;
     }
index 6236040a839ae3b47ddb7cf77485592d27fcc778..8cb22ca8bdb2958d4734daf0b7b9e992e4ad8fc5 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Random;
 using Content.Shared.Cluwne;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Weapons.Melee.WeaponRandom;
 
index b6452efa8a6f03714d72eb6663a051e96ad7176d..cb019e3d64a69faffdbe721290fd61dfa53b6fc1 100644 (file)
@@ -16,6 +16,9 @@ using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 9200928d662459b66e09483b73c01cde93ca1564..63095c7827013bef8425dd2ebd0d3c1c3e1410c6 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Xenoarchaeology.XenoArtifacts;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
index 0791924caaf351d156a1f2d6c4a7e66cd771a0ac..b8b2fba9d3330fcc1414eff77415e7563265ba1d 100644 (file)
@@ -9,6 +9,8 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
 using Content.Shared.CCVar;
 using Content.Shared.Xenoarchaeology.XenoArtifacts;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index ba2786f32d33d28187e9699189d378593fb91ab4..662abfee62889b7e15fa407374821ab97dd5c7aa 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
 using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
 using Content.Shared.Humanoid;
 using Content.Shared.Mobs.Systems;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
 
index 9c51b052feb3fb088bcfe8545f055baa3c1f60e6..8b351a59011ac36d2f98ab589125622002e4b936 100644 (file)
@@ -33,6 +33,7 @@ using Content.Shared.Weapons.Melee;
 using Content.Shared.Zombies;
 using Robust.Shared.Audio;
 using Content.Shared.Prying.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Zombies
 {
index e66fe017913a25454e4fbf8aeeaa17908c9d1d11..471e00a57263d9330bbb4d3037bae3db4ce7f80c 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Hands;
 using Content.Shared.Interaction;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Mind;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
index 48413ac0018931693ae7fe69142aca4636b4959e..cf937b761e3f36a78b09c541167aff741e8b552f 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Database;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index 30fdc946edd56252a945f8f13e9fb6d60fc28fc0..6318ba2557316deeea8f68f961d35acb4fc96a0c 100644 (file)
@@ -19,7 +19,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Enabled = value;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     public virtual void SetRange(EntityUid uid, float value, AmbientSoundComponent? ambience = null)
@@ -29,7 +29,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Range = value;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     protected virtual void QueueUpdate(EntityUid uid, AmbientSoundComponent ambience)
@@ -43,7 +43,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
             return;
 
         ambience.Volume = value;
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     public virtual void SetSound(EntityUid uid, SoundSpecifier sound, AmbientSoundComponent? ambience = null)
@@ -53,7 +53,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Sound = sound;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     private void HandleCompState(EntityUid uid, AmbientSoundComponent component, ref ComponentHandleState args)
index 7151ef2c174ecf380daaeee329e5e918710b75e3..3563f2f8462bebadfefedd36cd26fdce409c4c67 100644 (file)
@@ -1,10 +1,12 @@
 using Content.Shared.Physics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Audio;
 
 public abstract class SharedContentAudioSystem : EntitySystem
 {
-    [Dependency] private readonly SharedAudioSystem _audio = default!;
+    [Dependency] protected readonly SharedAudioSystem Audio = default!;
 
     /// <summary>
     /// Standard variation to use for sounds.
@@ -14,6 +16,6 @@ public abstract class SharedContentAudioSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        _audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable;
+        Audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable;
     }
 }
index bfefaf2b92d6f6124f6c4d7ee1b06e48a34cec66..2d721390e67c0f16d36bba0c3fcdd1aa42bf144b 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 
 namespace Content.Shared.Blocking;
@@ -51,7 +52,7 @@ public sealed partial class BlockingSystem
 
             if (blocking.IsBlocking)
             {
-                _audio.PlayPvs(blocking.BlockSound, uid, AudioParams.Default.WithVariation(0.2f));
+                _audio.PlayPvs(blocking.BlockSound, uid);
             }
         }
     }
index 9a379a29e976787c90e5b08b40b58444644a3bfb..f869c20679d2efdd37191635c674481a388e3ad1 100644 (file)
@@ -57,8 +57,11 @@ public sealed partial class BlockingComponent : Component
     /// <summary>
     /// The sound to be played when you get hit while actively blocking
     /// </summary>
-    [DataField("blockSound")]
-    public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg");
+    [DataField("blockSound")] public SoundSpecifier BlockSound =
+        new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg")
+        {
+            Params = AudioParams.Default.WithVariation(0.25f)
+        };
 
     /// <summary>
     /// Fraction of original damage shield will take instead of user
index 9795a6f3dcd781f0bc488e39b1cf6899b60a4509..9b31d0899cc100138c18f0dbb495b4399a56fecb 100644 (file)
@@ -496,8 +496,10 @@ public abstract partial class SharedBuckleSystem
 
         _joints.RefreshRelay(buckleUid);
         Appearance.SetData(strapUid, StrapVisuals.State, strapComp.BuckledEntities.Count != 0);
-        var audioSourceUid = userUid != buckleUid ? userUid : strapUid;
-        _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, audioSourceUid);
+
+        // TODO: Buckle listening to moveevents is sussy anyway.
+        if (!TerminatingOrDeleted(strapUid))
+            _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, userUid);
 
         var ev = new BuckleChangeEvent(strapUid, buckleUid, false);
         RaiseLocalEvent(buckleUid, ref ev);
index 1441745b5dac4dc0711d353d6da6281723cfc148..8f6833566374dad3a993d9fbf8fc2c63dbfbd0cf 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Pulling;
 using Content.Shared.Standing;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
index a6f3f5df726ead75aeecbb0c9d48d3e8e46e7f5c..7d7a3e6872dc00aee6019c095687f038ed14730f 100644 (file)
@@ -69,6 +69,8 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<float> AmbienceVolume =
             CVarDef.Create("ambience.volume", 0.0f, CVar.ARCHIVE | CVar.CLIENTONLY);
 
+        public const float MasterMultiplier = 2f;
+
         // Midi is on engine so deal
         public const float MidiMultiplier = 3f;
 
index f2f03c13349c31ae993a48643c31a3343ff1902d..92af6a4f8a3f8ed09fb0dbeb8c3f18142925802c 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Lock;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -117,7 +118,7 @@ public abstract class SharedItemCabinetSystem : EntitySystem
             return;
 
         cabinet.Opened = !cabinet.Opened;
-        Dirty(cabinet);
+        Dirty(uid, cabinet);
         _itemSlots.SetLock(uid, cabinet.CabinetSlot, !cabinet.Opened);
 
         if (_timing.IsFirstTimePredicted)
index 7353bd0e9c74c6a6aa36ef9f53dcd4339f349759..4045a270780555f31761dae6b78e2da780859187 100644 (file)
@@ -2,6 +2,8 @@
 using Content.Shared.Buckle.Components;
 using Content.Shared.Movement.Events;
 using Content.Shared.StepTrigger.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Timing;
index ed53b78466eba00cace489e891dbe849d1acd3ac..1a55408916a165c4ac376fbe2b1cd704f45e7685 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Database;
 using Content.Shared.FixedPoint;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Chemistry.Reaction
index 6ded524b19d90d84cb7f9238529ff638b0508b8a..b18d54cf788f338f4b6d1a8ed70c5e8c2fd6e96f 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Components;
 using Content.Shared.Popups;
 using Content.Shared.Stunnable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Serialization;
index f065d19dd30df4db26bad61452eda27d14366006..c960b8e619437219a2b2c44475b9d89e721cb87d 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Physics;
 using Content.Shared.Popups;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Collision.Shapes;
 using Robust.Shared.Physics.Components;
index 9194a8208e315d3dd94527214636905bef3a6616..ad27101cc145141d2af8ef3a5c76ccbea86b07ee 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Popups;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Network;
index 5dbe62aa6ae92357bf853a275b76d9f21e0984c0..93ef4e421345c7e022aee974a5131b824820f981 100644 (file)
@@ -29,6 +29,8 @@ using Content.Shared.Rejuvenate;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
index 4371ac83a8322a7c04cdd4805ea9ee6a6d2f5a8b..12bca5227471c2043e32a9d4aadc23738c82e5f9 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Damage.Components;
 using Content.Shared.Effects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 40c4f7eb8f276d0a426329d4b4c009301921c95c..33f1b0375bc7d807e9fdcc5f1d840db0a92e127c 100644 (file)
@@ -16,6 +16,7 @@ using Content.Shared.Throwing;
 using Content.Shared.Weapons.Melee.Events;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 192fd200789689ac43095e7c2e7fb8a2f96e7c6f..3d406843f5feda17903fc3c0f509cd78775b46e3 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Serialization;
 
index a9a52010fd6c9b6792e92dcc45675b0338a2bd23..7c5ef45275150f3e07c4b5abb96c720a45001a39 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Doors.Components;
 using Content.Shared.Popups;
 using Content.Shared.Prying.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Doors.Systems;
 
index 084c3b4ea2cb7009e172aeb7f7e0bcd837fc5522..85bb399b4805f8872ff7f363f1e6d53279f75d7b 100644 (file)
@@ -14,6 +14,8 @@ using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Timing;
+using Content.Shared.Prying.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Doors.Systems;
 
index 7b6ccaf0d485deed6f1f3bb1096fa428bf907205..44d9c5de3ed8e92a8612d216ce0f58a9580b3625 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Strip.Components;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
@@ -25,6 +26,7 @@ public abstract partial class InventorySystem
     [Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
     [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
     [Dependency] private readonly SharedItemSystem _item = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
     [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
     [Dependency] private readonly IGameTiming _gameTiming = default!;
@@ -211,10 +213,10 @@ public abstract partial class InventorySystem
                     filter.RemoveWhereAttachedEntity(entity => entity == actor);
             }
 
-            SoundSystem.Play(clothing.EquipSound.GetSound(), filter, target, clothing.EquipSound.Params.WithVolume(-2f));
+            _audio.PlayPredicted(clothing.EquipSound, target, actor);
         }
 
-        inventory.Dirty();
+        Dirty(target, inventory);
 
         _movementSpeed.RefreshMovementSpeedModifiers(target);
 
@@ -400,10 +402,11 @@ public abstract partial class InventorySystem
                     filter.RemoveWhereAttachedEntity(entity => entity == actor);
             }
 
-            SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f));
+            _audio.PlayPredicted(clothing.UnequipSound, target, actor);
         }
 
         Dirty(target, inventory);
+
         _movementSpeed.RefreshMovementSpeedModifiers(target);
 
         return true;
index d530b07b18636bb12c8216849a9bbf770aa0ed91..2fa15800a312ee4a510aed8e8f4f7514bc81d68c 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.Clothing.EntitySystems;
 using Content.Shared.Item;
 using Content.Shared.Light.Components;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Light;
index 31187a96cb9a5e6871de6230b08fe6f10cc4eebd..174818c4e81de808a55727965bf614380b577fd2 100644 (file)
@@ -30,13 +30,19 @@ public sealed partial class LockComponent : Component
     /// The sound played when unlocked.
     /// </summary>
     [DataField("unlockingSound"), ViewVariables(VVAccess.ReadWrite)]
-    public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
+    public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg")
+    {
+        Params = AudioParams.Default.WithVolume(-5f),
+    };
 
     /// <summary>
     /// The sound played when locked.
     /// </summary>
     [DataField("lockingSound"), ViewVariables(VVAccess.ReadWrite)]
-    public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg");
+    public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg")
+    {
+        Params = AudioParams.Default.WithVolume(-5f)
+    };
 
     /// <summary>
     /// Whether or not an emag disables it.
index 97baa28bf90d7c8c755f8255d60da425fb48c105..7babc6a9c0cb590545051c00b3fe73818445edbb 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Lock;
@@ -102,11 +103,11 @@ public sealed class LockSystem : EntitySystem
 
         _sharedPopupSystem.PopupClient(Loc.GetString("lock-comp-do-lock-success",
                 ("entityName", Identity.Name(uid, EntityManager))), uid, user);
-        _audio.PlayPredicted(lockComp.LockSound, uid, user, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(lockComp.LockSound, uid, user);
 
         lockComp.Locked = true;
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, true);
-        Dirty(lockComp);
+        Dirty(uid, lockComp);
 
         var ev = new LockToggledEvent(true);
         RaiseLocalEvent(uid, ref ev, true);
@@ -130,11 +131,11 @@ public sealed class LockSystem : EntitySystem
                 ("entityName", Identity.Name(uid, EntityManager))), uid, user.Value);
         }
 
-        _audio.PlayPredicted(lockComp.UnlockSound, uid, user, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(lockComp.UnlockSound, uid, user);
 
         lockComp.Locked = false;
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
-        Dirty(lockComp);
+        Dirty(uid, lockComp);
 
         var ev = new LockToggledEvent(false);
         RaiseLocalEvent(uid, ref ev, true);
@@ -213,7 +214,7 @@ public sealed class LockSystem : EntitySystem
     {
         if (!component.Locked || !component.BreakOnEmag)
             return;
-        _audio.PlayPredicted(component.UnlockSound, uid, null, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(component.UnlockSound, uid, null);
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
         RemComp<LockComponent>(uid); //Literally destroys the lock as a tell it was emagged
         args.Handled = true;
index 761469f99aafb10f85e292a65035d7cd10e4cf5c..eda5cc4058eb2074ac501d17900e72033f5c58b5 100644 (file)
@@ -126,7 +126,7 @@ public sealed partial class MaterialReclaimerComponent : Component
     [DataField]
     public TimeSpan SoundCooldown = TimeSpan.FromSeconds(0.8f);
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// A counter of how many items have been processed
index c3c712b617b31add390a12e66b78503703b3362c..31df11fa8b4e0ecedb23e2b0bf9cb4c4e5ba549c 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Examine;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Stacks;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Timing;
@@ -48,7 +50,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
     private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args)
     {
-        component.Stream?.Stop();
+        _audio.Stop(component.Stream);
     }
 
     private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
@@ -116,8 +118,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
         if (Timing.CurTime > component.NextSound)
         {
-            component.Stream = _audio.PlayPredicted(component.Sound, uid, user);
-
+            component.Stream = _audio.PlayPredicted(component.Sound, uid, user)?.Entity;
             component.NextSound = Timing.CurTime + component.SoundCooldown;
         }
 
@@ -167,9 +168,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
         component.ItemsProcessed++;
         if (component.CutOffSound)
-            component.Stream?.Stop();
+        {
+            _audio.Stop(component.Stream);
+        }
 
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     /// <summary>
@@ -181,7 +184,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
             return;
         component.Enabled = enabled;
         AmbientSound.SetAmbience(uid, enabled && component.Powered);
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     /// <summary>
index b4254fe0798d2c1b6dc56b1358cc229df790d860..1440a6ef1f2c3d4c4c5bb193846a1802688139c5 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Mech.Equipment.Systems;
 using Content.Shared.Timing;
 using Robust.Shared.Audio;
 using System.Linq;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Mech.Equipment.Systems;
 
index af065d0dec80719836982ac63e2cfb646b2bcde8..6e8d47fd3e6282f3cf3f61da093b5a2b19bf8b11 100644 (file)
@@ -12,6 +12,7 @@ using Content.Shared.Movement.Events;
 using Content.Shared.Pulling.Components;
 using Content.Shared.Tag;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
index d376d05724b14f4a35f1314ccf973a8cf0d7ee0c..f9e5d4a1f63d2691445b05e085701fa29571918d 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Physics;
 using Content.Shared.Popups;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Shared.Ninja.Systems;
index 473e29cc943df87449cdfc67b20cd922fbbce78a..224152a402befd5f9552a117c20479d17edcfda9 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Clothing.EntitySystems;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Timing;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Ninja.Systems;
 
index 63b4cb13aa634e7ff79cb36a93ce7fd89c35180a..3b9eded288deaf79b65b36dbc71d645226be4816 100644 (file)
@@ -4,6 +4,9 @@ using Content.Shared.DoAfter;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Throwing;
+using Content.Shared.Weapons.Ranged.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
index 5fd94c343855c4b77750a39bc7edfcc3ae739985..bc37ab035af2c851ededb7e4353e56799ed18681 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Doors.Components;
 using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using PryUnpoweredComponent = Content.Shared.Prying.Components.PryUnpoweredComponent;
 
 namespace Content.Shared.Prying.Systems;
index ccc47a2fdeb8905f66913191b3efec836c0989e0..d7126716ed1268f01545d9f92a26ca28ee06e7dc 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.RCD.Components;
 using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
index 585c1a51dcb0f5e4e301467ef69528f6b39ae77c..71edb70b37c38635317e276cfed147aec3050d8d 100644 (file)
@@ -82,7 +82,7 @@ public sealed partial class GeigerComponent : Component
     ///     Current stream of geiger counter audio.
     ///     Played only for current user.
     /// </summary>
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
 
 [Serializable, NetSerializable]
index eb97fe41133b5bb3bbd3e2e8c7b348b73efd8652..31856eefac77d37d00d832a0c9fa6cbf2d366466 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Radio.Components;
 using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
index 93293d09be2e37d6efaa4c6ffdb215f37278669e..5ae01ebb987ce3bc3862be7d286ec04164e533c2 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index ae49289eb8e5f9d13193611940810bda5d5ea035..05d6ab9f37f3d2dabae95af28cddd8c0c50cbd95 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Database;
 using Content.Shared.Mind;
 using Content.Shared.Roles.Jobs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Roles;
index cbc54c91e37a7fc431b5060e5668a1aa3ab2f8a3..d678b14b92f8268ae02be5f1eca8724bc4be22fc 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Stacks;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index 47fb9407860dd0b3bc6efff31e255748091f591e..a75d6113c95659dc8f7b2cd3ff893e0baca2a95f 100644 (file)
@@ -33,6 +33,8 @@ public sealed partial class EmaggableMedibotComponent : Component
     /// <summary>
     /// Sound to play when the bot has been emagged
     /// </summary>
-    [DataField("sparkSound")]
-    public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks");
+    [DataField("sparkSound")] public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks")
+    {
+        Params = AudioParams.Default.WithVolume(8f),
+    };
 }
index fe88cbae5cc29532228c6ccf94f7417ea2ff911a..464e95b77fe5128f4531509b841debdc6ac40b1d 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Emag.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Silicons.Bots;
 
@@ -22,7 +23,7 @@ public sealed class MedibotSystem : EntitySystem
         if (!TryComp<MedibotComponent>(uid, out var medibot))
             return;
 
-        _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid, AudioParams.Default.WithVolume(8));
+        _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid);
 
         medibot.StandardMed = comp.StandardMed;
         medibot.StandardMedAmount = comp.StandardMedAmount;
index fe5cd0377f4104aee7b41ec878d249f6e8cd2e3e..3bab8d80b0956c47449ea7b8dfea12c5c12242fd 100644 (file)
@@ -61,7 +61,7 @@ public sealed partial class SingularityComponent : Component
     /// The audio stream that plays the sound specified by <see cref="AmbientSound"/> on loop.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite)]
-    public IPlayingAudioStream? AmbientSoundStream = null;
+    public EntityUid? AmbientSoundStream = null;
 
     /// <summary>
     ///     The sound that the singularity produces when it forms.
index 00f023f9a3a67c9aae80d36fb283201f4828a3ad..60d53eb16f483ccd9857236834beaf04cbe0376f 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.StatusEffect;
 using Content.Shared.StepTrigger.Systems;
 using Content.Shared.Stunnable;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
index ea42b4bff93f8d7efc235bada70b1945f5741a08..c7fcfc64698158fc166ee129a866dd2fe196fcfa 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Sound.Components;
 using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
@@ -33,7 +34,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<EmitSoundOnSpawnComponent, ComponentInit>(OnEmitSpawnOnInit);
+        SubscribeLocalEvent<EmitSoundOnSpawnComponent, MapInitEvent>(OnEmitSpawnOnInit);
         SubscribeLocalEvent<EmitSoundOnLandComponent, LandEvent>(OnEmitSoundOnLand);
         SubscribeLocalEvent<EmitSoundOnUseComponent, UseInHandEvent>(OnEmitSoundOnUseInHand);
         SubscribeLocalEvent<EmitSoundOnThrowComponent, ThrownEvent>(OnEmitSoundOnThrown);
@@ -45,7 +46,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
         SubscribeLocalEvent<EmitSoundOnCollideComponent, StartCollideEvent>(OnEmitSoundOnCollide);
     }
 
-    private void OnEmitSpawnOnInit(EntityUid uid, EmitSoundOnSpawnComponent component, ComponentInit args)
+    private void OnEmitSpawnOnInit(EntityUid uid, EmitSoundOnSpawnComponent component, MapInitEvent args)
     {
         TryEmitSound(uid, component, predict: false);
     }
@@ -142,8 +143,11 @@ public abstract class SharedEmitSoundSystem : EntitySystem
         var fraction = MathF.Min(1f, (physics.LinearVelocity.Length() - component.MinimumVelocity) / MaxVolumeVelocity);
         var volume = MinVolume + (MaxVolume - MinVolume) * fraction;
         component.NextSound = _timing.CurTime + EmitSoundOnCollideComponent.CollideCooldown;
+        var sound = component.Sound;
 
-        if (_netMan.IsServer)
-            _audioSystem.PlayPvs(component.Sound, uid, AudioParams.Default.WithVolume(volume));
+        if (_netMan.IsServer && sound != null)
+        {
+            _audioSystem.PlayPvs(_audioSystem.GetSound(sound), uid, AudioParams.Default.WithVolume(volume));
+        }
     }
 }
index bb74a088b3e895d1e240e75611603a27445e950c..517831b8a1b3a5d425cb597028b321d6218d8d01 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Physics;
 using Content.Shared.Rotation;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
 
@@ -81,7 +82,7 @@ namespace Content.Shared.Standing
 
             if (playSound)
             {
-                _audio.PlayPredicted(standingState.DownSound, uid, uid, AudioParams.Default.WithVariation(0.25f));
+                _audio.PlayPredicted(standingState.DownSound, uid, uid);
             }
 
             return true;
index ad86a52665d93d0d5c084ad3fa2237aacfaf67aa..1672e27214b244ef114bd998efefa289cd096aeb 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Placeable;
 using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index f84a65398dca36210ce158c5700086c6b8b6daea..1e3320e7dbe1a051185b9d2d255e526200e7bc88 100644 (file)
@@ -15,6 +15,8 @@ using Content.Shared.Storage.Components;
 using Content.Shared.Tools.Systems;
 using Content.Shared.Verbs;
 using Content.Shared.Wall;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
index ef7930fe2b6463c5d8b64f98da9c641e397469b1..31f6ae5c7bedb4a5636c71ccb76f87951a3c7fe5 100644 (file)
@@ -17,6 +17,8 @@ using Content.Shared.Stacks;
 using Content.Shared.Storage.Components;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index 4875f2f68f8d9a04b578437ac1ed529a81513b85..c447f8c8bc79e33b4c483d91e1906f098e18f5df 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Standing;
 using Content.Shared.StatusEffect;
 using Content.Shared.Throwing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 
index 13deb869bc70f0aa6478f508e12741db2d73222b..ebd83624114a0d3b5802f1118544808acd395708 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Pulling;
 using Content.Shared.Pulling.Components;
 using Content.Shared.Teleportation.Components;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Dynamics;
index 6d497c003d7a353571651066bde7efe05aa8b965..92208a76d4083763d8d06f8b3f4dc930116ff5cf 100644 (file)
@@ -15,7 +15,10 @@ namespace Content.Shared.Tiles
         [DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
         public List<string>? OutputTiles;
 
-        [DataField("placeTileSound")]
-        public SoundSpecifier PlaceTileSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
+        [DataField("placeTileSound")] public SoundSpecifier PlaceTileSound =
+            new SoundPathSpecifier("/Audio/Items/genhit.ogg")
+            {
+                Params = AudioParams.Default.WithVariation(0.125f),
+            };
     }
 }
index dcf914ccf86af3e71fed231e2d2da3a4e3fef17e..21e21fa9e9bc4cd530c39225293be5ca6fb4b591 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Physics;
 using Content.Shared.Popups;
 using Content.Shared.Stacks;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
@@ -178,7 +179,7 @@ public sealed class FloorTileSystem : EntitySystem
         var variant = (byte) (_timing.CurTick.Value % ((ContentTileDefinition) _tileDefinitionManager[tileId]).Variants);
         mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId, 0, variant));
 
-        _audio.PlayPredicted(placeSound, location, user, AudioHelpers.WithVariation(0.125f, _random));
+        _audio.PlayPredicted(placeSound, location, user);
     }
 
     public bool CanPlaceTile(EntityUid gridUid, MapGridComponent component, [NotNullWhen(false)] out string? reason)
index c1a2bdc2ddae35cac6bcaf90c1a7bd5f2d2f5f2a..91984d29e340f41358bc99b4dc6f937f252cccf4 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using Content.Shared.Maps;
 using Content.Shared.Tools.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
@@ -52,7 +54,7 @@ public abstract partial class SharedToolSystem : EntitySystem
         if (tool.UseSound == null)
             return;
 
-        _audioSystem.PlayPredicted(tool.UseSound, uid, user, tool.UseSound.Params.WithVariation(0.175f).AddVolume(-5f));
+        _audioSystem.PlayPredicted(tool.UseSound, uid, user);
     }
 
     /// <summary>
index 51a7471f1e1c7c298550fcf9d56c39750fe995e2..1db698359bdcff3eebc301b16d9534a8fc6792e3 100644 (file)
@@ -43,5 +43,5 @@ public sealed partial class ParacusiaComponent : Component
     [DataField("timeBetweenIncidents", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     public TimeSpan NextIncidentTime;
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index 509581cc32aed1e5cf4199cfb19b9274214662f9..a4a4d89a253f4d07d1562ddc7fe305d509593b91 100644 (file)
@@ -45,7 +45,7 @@ public sealed partial class VehicleComponent : Component
     };
 
     [ViewVariables]
-    public IPlayingAudioStream? HonkPlayingStream;
+    public EntityUid? HonkPlayingStream;
 
     /// Use ambient sound component for the idle sound.
 
index c211ec57f0232bed5931d7fa0b42454b6bfba8f5..475675f22e3fa4c53acd4447dd4491ca0d0e9182 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Vehicle.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Systems;
@@ -174,8 +176,7 @@ public abstract partial class SharedVehicleSystem : EntitySystem
 
         // TODO: Need audio refactor maybe, just some way to null it when the stream is over.
         // For now better to just not loop to keep the code much cleaner.
-        vehicle.HonkPlayingStream?.Stop();
-        vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid);
+        vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid)?.Entity;
         args.Handled = true;
     }
 
index 522138eb8b51b22e0b992e6147558eeea2bd0ff7..50803e8ee267f612c3ae750f350beb5be2ce0168 100644 (file)
@@ -4,6 +4,8 @@ using System.Linq;
 using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 
 namespace Content.Shared.VendingMachines;
index 119b10218d8a75c9b564a082749eb53867bb54ba..3a6afce363837f5c12529fd4d50f64d4da86f3fd 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Damage;
 using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Timing;
index 62af6067d05444c0f5681beaa6bb908e193dc13f..5eac283ef19e5a97229b0f2bfa568b326ab9a11b 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
 using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
index 61c84f7d3d08a1a5d60358e5adbf0a2cb5cabb08..9ee705061a42465da74f6301fbc21344f9a45508 100644 (file)
@@ -52,5 +52,5 @@ public abstract partial class BaseForceGunComponent : Component
         Params = AudioParams.Default.WithLoop(true).WithVolume(-8f),
     };
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index 7713c98955e7010ef35032159161999ffec38d73..3aa82c411ced53ff746bada94f248b57b94eb3a0 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Projectiles;
 using Content.Shared.Timing;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
@@ -61,13 +63,13 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
 
             // At least show the visuals.
             component.Projectile = shotUid.Value;
-            Dirty(component);
+            Dirty(uid, component);
             var visuals = EnsureComp<JointVisualsComponent>(shotUid.Value);
             visuals.Sprite =
                 new SpriteSpecifier.Rsi(new ResPath("Objects/Weapons/Guns/Launchers/grappling_gun.rsi"), "rope");
             visuals.OffsetA = new Vector2(0f, 0.5f);
             visuals.Target = uid;
-            Dirty(visuals);
+            Dirty(shotUid.Value, visuals);
         }
 
         TryComp<AppearanceComponent>(uid, out var appearance);
@@ -133,7 +135,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
             }
 
             component.Projectile = null;
-            Dirty(component);
+            Dirty(uid, component);
         }
     }
 
@@ -145,19 +147,18 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
         if (value)
         {
             if (Timing.IsFirstTimePredicted)
-                component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user);
+                component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user)?.Entity;
         }
         else
         {
             if (Timing.IsFirstTimePredicted)
             {
-                component.Stream?.Stop();
-                component.Stream = null;
+                component.Stream = _audio.Stop(component.Stream);
             }
         }
 
         component.Reeling = value;
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     public override void Update(float frameTime)
@@ -173,8 +174,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
                 if (Timing.IsFirstTimePredicted)
                 {
                     // Just in case.
-                    grappling.Stream?.Stop();
-                    grappling.Stream = null;
+                    grappling.Stream = _audio.Stop(grappling.Stream);
                 }
 
                 continue;
@@ -200,7 +200,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
                 _physics.WakeBody(jointComp.Relay.Value);
             }
 
-            Dirty(jointComp);
+            Dirty(uid, jointComp);
 
             if (distance.MaxLength.Equals(distance.MinLength))
             {
@@ -221,7 +221,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
         joint.MinLength = 0.35f;
         // Setting velocity directly for mob movement fucks this so need to make them aware of it.
         // joint.Breakpoint = 4000f;
-        Dirty(jointComp);
+        Dirty(uid, jointComp);
     }
 
     [Serializable, NetSerializable]
index 984ae832fb8029e4a239582422ed46287ce386f2..177cb310d18a5bfd896ac8f68fac9105973b38ac 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Movement.Events;
 using Content.Shared.Throwing;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
@@ -232,10 +234,10 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
 
         // Sad...
         if (_netManager.IsServer && component.Stream == null)
-            component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null);
+            component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null)?.Entity;
 
-        Dirty(tethered);
-        Dirty(component);
+        Dirty(target, tethered);
+        Dirty(gunUid, component);
     }
 
     protected virtual void StopTether(EntityUid gunUid, BaseForceGunComponent component, bool land = true, bool transfer = false)
@@ -269,7 +271,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
 
         if (!transfer)
         {
-            component.Stream?.Stop();
+            _audio.Stop(component.Stream);
             component.Stream = null;
         }
 
index 51f3e835b7ba0ac67516cb1b31b20dd7ef5b88d0..3ca52b28786c8364570dc49c138fb6c778e81e29 100644 (file)
@@ -24,5 +24,5 @@ public sealed partial class GrapplingGunComponent : Component
     [ViewVariables(VVAccess.ReadWrite), DataField("cycleSound"), AutoNetworkedField]
     public SoundSpecifier? CycleSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/kinetic_reload.ogg");
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index ded4ce34a231ab681bc86d087ae0dedb5dbf93f6..536f3da8112e50a822d66b4019a6b4cf7b25b33d 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Shared.Examine;
 using Content.Shared.Weapons.Ranged.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 6f764bb9f4e49b4ea237ad3efb42cde696e95199..06667857b35b52e9756d512e9169dbdf7727208a 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
index ffa8180e1a728ad0d82e2f6293fe1fe0f6c190d3..4986f9a3414b8fad6e918738290b8758d60fa609 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Popups;
 using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
index c7040515c8e05dc4f837e742901981f3d6aaeecc..d34893f8aa4fb894502f3a56c2ebbf1c0ad8f24f 100644 (file)
@@ -1,4 +1,6 @@
 using Content.Shared.Maps;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
@@ -15,13 +17,11 @@ public abstract class SharedWeatherSystem : EntitySystem
     [Dependency] protected readonly IPrototypeManager ProtoMan = default!;
     [Dependency] private   readonly ITileDefinitionManager _tileDefManager = default!;
     [Dependency] private   readonly MetaDataSystem _metadata = default!;
-
-    protected ISawmill Sawmill = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
         base.Initialize();
-        Sawmill = Logger.GetSawmill("weather");
         SubscribeLocalEvent<WeatherComponent, EntityUnpausedEvent>(OnWeatherUnpaused);
     }
 
@@ -123,7 +123,7 @@ public abstract class SharedWeatherSystem : EntitySystem
                 // Admin messed up or the likes.
                 if (!ProtoMan.TryIndex<WeatherPrototype>(proto, out var weatherProto))
                 {
-                    Sawmill.Error($"Unable to find weather prototype for {comp.Weather}, ending!");
+                    Log.Error($"Unable to find weather prototype for {comp.Weather}, ending!");
                     EndWeather(uid, comp, proto);
                     continue;
                 }
@@ -156,7 +156,8 @@ public abstract class SharedWeatherSystem : EntitySystem
     /// </summary>
     public void SetWeather(MapId mapId, WeatherPrototype? proto, TimeSpan? endTime)
     {
-        var weatherComp = EnsureComp<WeatherComponent>(MapManager.GetMapEntityId(mapId));
+        var mapUid = MapManager.GetMapEntityId(mapId);
+        var weatherComp = EnsureComp<WeatherComponent>(mapUid);
 
         foreach (var (eProto, weather) in weatherComp.Weather)
         {
@@ -168,7 +169,7 @@ public abstract class SharedWeatherSystem : EntitySystem
                 if (weather.State == WeatherState.Ending)
                     weather.State = WeatherState.Running;
 
-                Dirty(weatherComp);
+                Dirty(mapUid, weatherComp);
                 continue;
             }
 
@@ -178,7 +179,7 @@ public abstract class SharedWeatherSystem : EntitySystem
             if (weather.EndTime == null || weather.EndTime > end)
             {
                 weather.EndTime = end;
-                Dirty(weatherComp);
+                Dirty(mapUid, weatherComp);
             }
         }
 
@@ -211,10 +212,10 @@ public abstract class SharedWeatherSystem : EntitySystem
         if (!component.Weather.TryGetValue(proto, out var data))
             return;
 
-        data.Stream?.Stop();
+        _audio.Stop(data.Stream);
         data.Stream = null;
         component.Weather.Remove(proto);
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     protected virtual bool SetState(WeatherState state, WeatherComponent component, WeatherData weather, WeatherPrototype weatherProto)
index 6166ea0c64e095d86e75883a38e53156c626a305..bdc7bfdbf9128084abe1cb3f91beee2ef1c201c4 100644 (file)
@@ -24,7 +24,7 @@ public sealed partial class WeatherData
 {
     // Client audio stream.
     [NonSerialized]
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// When the weather started if relevant.
index ba87d54aa2ac97cba7bc2bb0e960c804970e0612..399d9b516807aff2237cfef7f47dcf3ab7e0805c 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Weapons.Melee.Components;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
 using Content.Shared.Wieldable.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Content.Shared.Timing;
 
index 999d79e8c0d61d375fc57101f6966ee4ba9b70ca..d21b4ec5d517be737d5cb1e7ca862b3c7544fa7d 100644 (file)
@@ -44589,46 +44589,6 @@ entities:
     - pos: -11.5,-13.5
       parent: 30
       type: Transform
-    - thresholds:
-      - trigger: !type:DamageTrigger
-          damage: 100
-        triggersOnce: False
-        triggered: True
-        behaviors:
-        - !type:DoActsBehavior
-          acts: Breakage
-        - !type:EjectVendorItems
-          max: 3
-          percent: 0.25
-      - trigger: !type:DamageTrigger
-          damage: 200
-        triggersOnce: False
-        triggered: False
-        behaviors:
-        - !type:SpawnEntitiesBehavior
-          offset: 0.5
-          spawn:
-            SheetSteel1:
-              max: 1
-              min: 1
-          transferForensics: False
-        - !type:DoActsBehavior
-          acts: Destruction
-        - !type:PlaySoundBehavior
-          sound: !type:SoundPathSpecifier
-            params:
-              variation: null
-              playoffset: 0
-              loop: False
-              referenceDistance: 1
-              rolloffFactor: 1
-              maxdistance: 25
-              busname: Master
-              pitchscale: 1
-              volume: 0
-              attenuation: Default
-            path: /Audio/Effects/metalbreak.ogg
-      type: Destructible
 - proto: VendingMachineVendomat
   entities:
   - uid: 5434
index 139792b16e6b2fc53780e09324e8797fc5e208da..71c5444dc30ffb32982e139e24a0d89d27d00d71 100644 (file)
       path: /Audio/Machines/Nuke/nuke_alarm.ogg
       params:
         volume: -5
-        maxdistance: 10
+        maxDistance: 10
   - type: EmitSoundOnActivate
     sound:
       path: /Audio/Machines/Nuke/nuke_alarm.ogg
       params:
         volume: -5
-        maxdistance: 10
+        maxDistance: 10
 
 - type: entity
   parent: BasePlushie
index 99dc9c07c669c7e907aa4aedd234bcfbb310a39d..34de8d7e3065b7507f16c81dcafa8fd424a34779 100644 (file)
       path: /Audio/Items/Stamp/thick_stamp_sub.ogg
       params:
         volume: -2
-        maxdistance: 5
+        maxDistance: 5
   - type: Sprite
     sprite: Objects/Misc/bureaucracy.rsi
     state: stamp-mime
       path: /Audio/Items/Stamp/automatic_stamp.ogg
       params:
         volume: -2
-        maxdistance: 5
+        maxDistance: 5
 
 - type: entity
   name: captain's rubber stamp
index e78d8dd1504f0deeb71dc5f7f1ef0ddf592195d1..69a81f9f46acb0f0f65e0771affbab4e678be28b 100644 (file)
@@ -50,7 +50,7 @@
     beepSound:
       path: "/Audio/Items/locator_beep.ogg"
       params:
-        maxdistance: 1
+        maxDistance: 1
         volume: -8
 
 - type: entity
   - type: ItemSlots
     slots:
       cell_slot:
-        name: power-cell-slot-component-slot-name-default
\ No newline at end of file
+        name: power-cell-slot-component-slot-name-default
index d574b286c4582eb7ca0e38df0ac1988774a5dc7a..33186f0a1dda8038647aac29c0b6f491f801fa3e 100644 (file)
@@ -9,7 +9,7 @@
       path: /Audio/Machines/microwave_loop.ogg
       params:
         loop: true
-        maxdistance: 5
+        maxDistance: 5
   - type: Sprite
     sprite: Structures/Machines/fat_sucker.rsi
     snapCardinals: true
index b7886b7ca59bc44b153d5902582f9e8148d4108e..699c3491f1c6d104e46014d4ea846a02cc849eb1 100644 (file)
@@ -81,7 +81,7 @@
       path: /Audio/Ambience/Objects/crushing.ogg
       params:
         volume: 5
-        maxdistance: 5
+        maxDistance: 5
         loop: true
   - type: MaterialStorage
     insertOnInteract: false
index 3cbb0665b88c7ee9964bcf4cd2ca6faaa136690d..e37f9c24c941b63a2e2841453a01f0cd078beaa7 100644 (file)
       collection: Whistles
   params:
     variation: 0.125
-    pitchscale: 0.75
+    pitch: 0.75
 
 - type: emoteSounds
   id: FemaleDwarf
       collection: Whistles
   params:
     variation: 0.125
-    pitchscale: 0.75
+    pitch: 0.75
 
 - type: emoteSounds
   id: UnisexMoth
index f8db432c3d1588e3fd39c55dd483a08c959dac34..423da9cdc8f93f7f81f882de94729c10c15b1248 100644 (file)
@@ -39,6 +39,7 @@
   - addview
   - removeview
   - hwid
+  - showaudio
   - showpos
   - showray
   - showchunkbb