Module Sound.UserSound
Sound - Manage user sound.
Features:
- Play sounds wihtin running missions.
Management of DCS User Sound.
Author: FlightControl
Global(s)
Global USERSOUND |
Management of DCS User Sound. |
Management of DCS User Sound.
USERSOUND constructor
- USERSOUND.New(): Creates a new USERSOUND object.
Type(s)
Fields and Methods inherited from USERSOUND | Description |
---|---|
USERSOUND Constructor. |
|
Set usersound filename. |
|
Play the usersound to all players. |
|
Play the usersound to the given Wrapper.Client. |
|
Play the usersound to the given coalition. |
|
Play the usersound to the given country. |
|
Play the usersound to the given Wrapper.Group. |
|
Play the usersound to the given Wrapper.Unit. |
|
Field(s)
Function(s)
USERSOUND Constructor.
Defined in:
USERSOUND
Parameter:
#string UserSoundFileName
The filename of the usersound.
Return value:
Set usersound filename.
Defined in:
USERSOUND
Parameter:
#string UserSoundFileName
The filename of the usersound.
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
BlueVictory:SetFileName( "BlueVictoryLoud.ogg" ) -- Set the BlueVictory to change the file name to play a louder sound.
Play the usersound to all players.
Defined in:
USERSOUND
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
BlueVictory:ToAll() -- Play the sound that Blue has won.
Play the usersound to the given Wrapper.Client.
Defined in:
USERSOUND
Parameters:
Wrapper.Client to play the usersound to.
#number Delay
(Optional) Delay in seconds, before the sound is played. Default 0.
Client
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
local PlayerUnit = CLIENT:FindByPlayerName("Karl Heinz")-- Search for the active client with playername "Karl Heinz", a human player.
BlueVictory:ToClient( PlayerUnit ) -- Play the victory sound to the player unit.
Play the usersound to the given coalition.
Defined in:
USERSOUND
Parameter:
DCS#coalition Coalition
The coalition to play the usersound to.
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
BlueVictory:ToCoalition( coalition.side.BLUE ) -- Play the sound that Blue has won to the blue coalition.
Play the usersound to the given country.
Defined in:
USERSOUND
Parameter:
DCS#country Country
The country to play the usersound to.
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
BlueVictory:ToCountry( country.id.USA ) -- Play the sound that Blue has won to the USA country.
Play the usersound to the given Wrapper.Group.
Defined in:
USERSOUND
Parameters:
Wrapper.Group#GROUP Group
The Wrapper.Group to play the usersound to.
#number Delay
(Optional) Delay in seconds, before the sound is played. Default 0.
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
local PlayerGroup = GROUP:FindByName( "PlayerGroup" ) -- Search for the active group named "PlayerGroup", that contains a human player.
BlueVictory:ToGroup( PlayerGroup ) -- Play the victory sound to the player group.
Play the usersound to the given Wrapper.Unit.
Defined in:
USERSOUND
Parameters:
Wrapper.Unit#UNIT Unit
The Wrapper.Unit to play the usersound to.
#number Delay
(Optional) Delay in seconds, before the sound is played. Default 0.
Return value:
The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" )
local PlayerUnit = UNIT:FindByName( "PlayerUnit" ) -- Search for the active unit named "PlayerUnit", a human player.
BlueVictory:ToUnit( PlayerUnit ) -- Play the victory sound to the player unit.