This is the sound source component simulating a sound source that is attached to an actor in the world.
There are different implementations for this, e.g., one for playing audio files: VAAudiofileSourceComponent
As modelled in VA these sound sources each hold a signal source, which is the actual signal to be played, so for example the VAAudiofileSourceComponent
has a VAAudiofileSignalSource
which is the interface to the actual signal to be played an holds more functionality than that available in the sound source itself.
If you want to play audiofiles, you can store them somewhere in your Content folder (just make sure that this folder is marked in DirectoriesToAlwaysStageAsNonUFS
when packaging your application). At runtime the files are then copied over to the VAServerLauncher (the first time, or when they changed). This together with loading them into memory creates a short delay, so make sure to preload all audiofiles for each soundsource it is used on by setting them or using UVAAudiofileSignalSource::PreLoadAudiofile()
.
.wav
files directly, so they need to be stored there, created .uasset
are simply ignored.
Editor Interface
This list might not be up to date, so also check the headers for more information
General Settings
- Handle 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``.
- How the Component should act relative to its owner`:
- 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
).
- Name of bone to which the sound source should be bound. Only relevant when using
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
Spedifics for VAAudiofileSignalSource
- 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
)
- Action of the Sound at start (
- Play from x:
- Point in time of the sound file at the begining
- Loop:
- Whether too loop the sound or not
For more information checkout the header file and comments there.