Update VA[...]SourceComponent authored by Jonathan Ehret's avatar Jonathan Ehret
This is the sound source component simulating a sound source and its reflections by the FAReflectionWalls on the VAServer
## Editor Interface
**General Settings**
* Sound Name:
* File of the sound *(either relative to the Unreal Content folder (**recommended**, when using VAServerLauncher) or relative to the VAServer data folder)*
* Action:
* Action of the Sound at start (``Stop``, ``Play``, ``Pause``)
* Play from x:
* Point in time of the sound file at the begining
* Loop:
* Whether too loop the sound or not
* Use reflections:
* Whether to reflect this sound source at the VAReflectionWalls
* Sound Power:
* The Power of the sound in Watts (The default value of 31.67 mW (105 dB re 10e-12 Watts) corresponds to 1 Pascal (94.0 dB SPL re 20e-6 Pascal ) in a distance of 1 m for spherical spreading.)
**Position**
* Position Settings:
* How the Component should act relative to its owner`: ``MoveWithObject``, ``ObjectSpawnPoint`` (no Position update), or ``AttatchToBone``.
* Use Offset:
* Check if want to use Offset
* Offset Position:
* Position Offset, available when using Offset
* Offset Rotation:
* Rotation Offset, available when using Offset
* Bone Name:
* Name of bone to which the sound source should be bound. Only relevant when using ``AttatchToBone``.
* The bone is looked for in all skeletal meshes of the same actor the sound source component is attached to. If none is found it is also searched along the hierachical chain (when using ``AttachActorToActor``).
**Directivity**
* Directivity:
* Decide which setting for the directivities should be used.
* Directivity by file name:
* Initial Directivity created by its file name.
* Phoneme Directivity from config:
* Intitial Directivity by mapping in Receiver owner
## Runtime Functions
**Playback Settings**
* `PlaySound()`
* Play Sound
* `PlaySoundFromSecond(float)`
* Play Sound from second of file
* `StopSound()`
* Stop Sound
* `PauseSound()`
* Pause Sound
**Sound Settings**
* `MuteSound(bool)`
* Mute / unmute sound (true = mute)
* `LoadSoundFile(FString)`
* Load a sound file (for later usage)
* `SetSoundFile(FString)`
* Set a sound file (if already loaded, taking the loaded one, if not creating new sound)
* `GetSoundFile()`
* Gets the name of the current sound file
* `SetSoundPower(float)`
* Sets the sound power in watts
* `GetSoundPower()`
* Gets the sound power in watts
* `SetLoop(bool)`
* Sets whether to loop or not (true = loop)
* `GetLoop()`
* Gets whether sound loops or not (true = loop)
* `GetHandleReflections()`
* Gets whether to handle reflections for this sound source
**Sound Pose**
* `GetPosition()`
* Gets the position of the sound source
* `GetRotation()`
* Gets the rotation of the sound source
* `SetMovementSetting(EMovement)`
* Sets how the position of the movement should be set (0 = Move with object, 1 = Object Spawn Point, 2 = Attatch to bone)
* `SetUsePoseOffset(bool)`
* Sets whether to use offset or not
* `SetOffsetPosition(FVector)`
* Sets position offset, activates the Pose Offset if it is disabled and updates the pose
* `SetOffsetRotation(FRotator)`
* Sets rotation offset, activates the Pose Offset if it is disabled and updates the pose
**Directivities**
* `SetDirectivityByMapping(FString)`
* Sets directivity based on mapping of VAReceiverActor
* `SetDirectivityByFileName(FString)`
* Sets directivity based on file name
* `GetDirectivityFileName()`
* Gets the file name of the current directivity
**Graphical Representation**
* `SetVisibility(bool)`
* Sets the visibility of the sound representation
* `GetVisibility()`
* Gets the visibility of the sound representation
* `SetBoneName(FString)`
* Sets the bound bone name and sets the movement Settings to the bone if the bone is found
* `GetBoneName()`
* Gets the name of the bone the sound source is attached to
**For more information checkout the header file and comments there.**
**Also look at specific implementations of sound sources, for example the ``UVAAudiofileSoundSource`` holds a ``UVAAudiofileSignalSource`` which can be accessed and provides more possibilities to control replay.
\ No newline at end of file