# Set Sound Volume
Grammar — Set volume of s to volume percent
Flags —Native
|Action
Sets sound volume.
# Arguments
sound
— Soundfixed
— Volume
Returns — void
native void SoundSetVolume(sound s, fixed volume);
# Related
Category: Sound / Sounds
- Play Sound On Unit —
void
— SoundPlayOnUnitForPlayer - Play Sound At Point —
void
— SoundPlayAtPointForPlayer - Play Sound —
void
— SoundPlayForPlayer - Last Played Sound —
sound
— SoundLastPlayed - Pause Sound —
void
— SoundPause - Stop Sound —
void
— SoundStop - Skip To Sound Offset —
void
— SoundSetOffset - Move Sound —
void
— SoundSetPosition - Wait For Sound —
void
— SoundWait - Set Sound Volume —
void
— SoundSetVolume - Stop All Trigger Sounds —
void
— SoundStopAllTriggerSounds - Stop All Model Sounds —
void
— SoundStopAllModelSounds - Set Sound Listener Gender —
void
— SoundSetListenerGender
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:2928
gv_jukeboxes[lp_jukeboxID].lv_playback.lv_muted = false;
if ((gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music != null) && (gv_terranUpTheNightPlaying == false)) {
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:3743
lv_volume -= lv_volumeChange;
SoundSetVolume(lp_sound, lv_volume);
lv_elapsed += lv_timeInterval;
Wait(lv_timeInterval, c_timeReal);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:3786
// Implementation
DataTableSetBool(true, (SoundLinkId(lp_soundLink)), false);
SoundSetVolume(lp_sound, 100.0);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:3819
lv_volume -= lv_volumeChange;
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, lv_volume);
Wait(0.0625, c_timeGame);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:3822
Wait(0.0625, c_timeGame);
}
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, 0.0);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:17792
gv_terranUpTheNightPlaying = false;
if ((gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_muted == false) && (gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_music != null)) {
SoundSetVolume(gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:17796
if ((gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_muted == false) && (gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_music != null)) {
SoundSetVolume(gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:31753
TransmissionWait(TransmissionLastSent(), 0.0);
gf_ResetActorToLocation(ge_ActorID_ActorTychus, PointFromId(774));
SoundSetVolume(gv_briefingSoundPlayed, 10.0);
libNtve_gf_SendTransmissionSimple(TransmissionSourceFromUnit(gf_ActorUnit(ge_ActorID_ActorRaynor), false, false, "Talk"), c_invalidPortraitId, SoundLink("TTychus03BriefingRaynor00006", 0), 0.0, c_transmissionDurationAdd, true);
libNtve_gf_SendTransmissionSimple(TransmissionSourceFromUnit(gf_ActorUnit(ge_ActorID_ActorRaynor), false, false, "Talk"), c_invalidPortraitId, SoundLink("TTychus03BriefingRaynor00007", 0), 0.0, c_transmissionDurationAdd, false);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:2928
gv_jukeboxes[lp_jukeboxID].lv_playback.lv_muted = false;
if ((gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music != null) && (gv_terranUpTheNightPlaying == false)) {
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:3743
lv_volume -= lv_volumeChange;
SoundSetVolume(lp_sound, lv_volume);
lv_elapsed += lv_timeInterval;
Wait(lv_timeInterval, c_timeReal);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:3786
// Implementation
DataTableSetBool(true, (SoundLinkId(lp_soundLink)), false);
SoundSetVolume(lp_sound, 100.0);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:3819
lv_volume -= lv_volumeChange;
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, lv_volume);
Wait(0.0625, c_timeGame);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:3822
Wait(0.0625, c_timeGame);
}
SoundSetVolume(gv_jukeboxes[lp_jukeboxID].lv_playback.lv_music, 0.0);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:17792
gv_terranUpTheNightPlaying = false;
if ((gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_muted == false) && (gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_music != null)) {
SoundSetVolume(gv_jukeboxes[gv_marSaraJukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:17796
if ((gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_muted == false) && (gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_music != null)) {
SoundSetVolume(gv_jukeboxes[gv_cantinaJukeboxID].lv_playback.lv_music, 100.0);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:31753
TransmissionWait(TransmissionLastSent(), 0.0);
gf_ResetActorToLocation(ge_ActorID_ActorTychus, PointFromId(774));
SoundSetVolume(gv_briefingSoundPlayed, 10.0);
libNtve_gf_SendTransmissionSimple(TransmissionSourceFromUnit(gf_ActorUnit(ge_ActorID_ActorRaynor), false, false, "Talk"), c_invalidPortraitId, SoundLink("TTychus03BriefingRaynor00006", 0), 0.0, c_transmissionDurationAdd, true);
libNtve_gf_SendTransmissionSimple(TransmissionSourceFromUnit(gf_ActorUnit(ge_ActorID_ActorRaynor), false, false, "Talk"), c_invalidPortraitId, SoundLink("TTychus03BriefingRaynor00007", 0), 0.0, c_transmissionDurationAdd, false);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zzerus01.sc2map/MapScript.galaxy:7673
TriggerExecute(gt_VictoryCinematicCameraShakes, true, false);
SoundPlay(SoundLink("TVReports_ShipsFlyByRumble", -1), PlayerGroupAll(), 100.0, 0.0);
SoundSetVolume(SoundLastPlayed(), 75.0);
gv_cinematicStinger1 = SoundLastPlayed();
libNtve_gf_SendActorMessageToUnit(gv_cinematicTempUnits22, "Signal Emerge");
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zzerus01.sc2map — MapScript.galaxy:7673
TriggerExecute(gt_VictoryCinematicCameraShakes, true, false);
SoundPlay(SoundLink("TVReports_ShipsFlyByRumble", -1), PlayerGroupAll(), 100.0, 0.0);
SoundSetVolume(SoundLastPlayed(), 75.0);
gv_cinematicStinger1 = SoundLastPlayed();
libNtve_gf_SendActorMessageToUnit(gv_cinematicTempUnits22, "Signal Emerge");
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pshakuras02.sc2map/MapScript.galaxy:2860
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryAmbience, "Ambience_PShakuras02_HighIntensity_Quad", c_soundtrackCueAny, c_soundtrackIndexAny, true);
SoundSetVolume(SoundLastPlayed(), 60.0);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy_Fast", c_animNameDefault);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy_Fast", c_animNameDefault);
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pshakuras02.sc2map/MapScript.galaxy:2867
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
SoundSetVolume(SoundLastPlayed(), 100.0);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy_Fast", c_animNameDefault);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy_Fast", c_animNameDefault);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pshakuras02.sc2map — MapScript.galaxy:2860
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryAmbience, "Ambience_PShakuras02_HighIntensity_Quad", c_soundtrackCueAny, c_soundtrackIndexAny, true);
SoundSetVolume(SoundLastPlayed(), 60.0);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy_Fast", c_animNameDefault);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy_Fast", c_animNameDefault);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pshakuras02.sc2map — MapScript.galaxy:2867
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
libNtve_gf_PlayAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy", c_animNameDefault, "Death", c_animFlagPlayForever, c_animTimeDefault);
SoundSetVolume(SoundLastPlayed(), 100.0);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Windy_Fast", c_animNameDefault);
libNtve_gf_ClearAnimationOnDoodadsInRegion(RegionEntireMap(), "Fog_Shakuras_Thick_Windy_Fast", c_animNameDefault);