unreal.MediaSoundComponent

class unreal.MediaSoundComponent(outer: Object | None = None, name: Name | str = 'None')

Bases: SynthComponent

Implements a sound component for playing a media player’s audio output.

C++ Source:

  • Module: MediaAssets

  • File: MediaSoundComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • absolute_location (bool): [Read-Write] If RelativeLocation should be considered relative to the world, rather than the parent

  • absolute_rotation (bool): [Read-Write] If RelativeRotation should be considered relative to the world, rather than the parent

  • absolute_scale (bool): [Read-Write] If RelativeScale3D should be considered relative to the world, rather than the parent

  • allow_spatialization (bool): [Read-Write] Is this audio component allowed to be spatialized?

  • asset_user_data (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • attenuation_overrides (SoundAttenuationSettings): [Read-Write] If bOverrideSettings is true, the attenuation properties to use for sounds generated by this component

  • attenuation_settings (SoundAttenuation): [Read-Write] If bOverrideSettings is false, the asset to use to determine attenuation properties for sounds generated by this component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • bus_sends (Array[SoundSourceBusSendInfo]): [Read-Write] This sound will send its audio output to this list of buses if there are bus instances playing after source effects are processed.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • channels (MediaSoundChannels): [Read-Write] Media sound channel type.

  • component_tags (Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • concurrency_set (Set[SoundConcurrency]): [Read-Write] What sound concurrency to use for sounds generated by this audio component

  • detail_mode (DetailMode): [Read-Write] If detail mode is >= system detail mode, primitive won’t be rendered.

  • dynamic_rate_adjustment (bool): [Read-Write] Dynamically adjust the sample rate if audio and media clock desynchronize.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • enable_base_submix (bool): [Read-Write] If enabled, sound will route to the Master Submix by default or to the Base Submix if defined. If disabled, sound will route ONLY to the Submix Sends and/or Bus Sends

  • enable_bus_sends (bool): [Read-Write] Whether or not to enable sending this audio’s output to buses.

  • enable_submix_sends (bool): [Read-Write] Whether or not to enable Submix Sends other than the Base Submix.

  • envelope_follower_attack_time (int32): [Read-Write] The attack time in milliseconds for the envelope follower. Delegate callbacks can be registered to get the envelope value of sounds played with this audio component. Only used in audio mixer.

  • envelope_follower_release_time (int32): [Read-Write] The release time in milliseconds for the envelope follower. Delegate callbacks can be registered to get the envelope value of sounds played with this audio component. Only used in audio mixer.

  • hidden_in_game (bool): [Read-Write] Whether to hide the primitive in game, if the primitive is Visible.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • is_ui_sound (bool): [Read-Write] Whether or not this sound plays when the game is paused in the UI

  • media_player (MediaPlayer): [Read-Write] The media player asset associated with this component.

    This property is meant for design-time convenience. To change the associated media player at run-time, use the SetMediaPlayer method. see: SetMediaPlayer

  • mobility (ComponentMobility): [Read-Write] How often this component is allowed to move, used to make various optimizations. Only safe to set in constructor.

  • modulation_routing (SoundModulationDefaultRoutingSettings): [Read-Write]

  • on_audio_envelope_value (OnSynthEnvelopeValue): [Read-Write]

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • override_attenuation (bool): [Read-Write] Should the Attenuation Settings asset be used (false) or should the properties set directly on the component be used for attenuation properties

  • physics_volume_changed_delegate (PhysicsVolumeChanged): [Read-Write] Delegate that will be called when PhysicsVolume has been changed *

  • pre_effect_bus_sends (Array[SoundSourceBusSendInfo]): [Read-Write] This sound will send its audio output to this list of buses if there are bus instances playing before source effects are processed.

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • rate_adjustment_factor (float): [Read-Write] Factor for calculating the sample rate adjustment.

    If dynamic rate adjustment is enabled, this number is multiplied with the drift between the audio and media clock (in 100ns ticks) to determine the adjustment. that is to be multiplied into the current playrate.

  • rate_adjustment_range (FloatRange): [Read-Write] The allowed range of dynamic rate adjustment.

    If dynamic rate adjustment is enabled, and the necessary adjustment falls outside of this range, audio samples will be dropped.

  • relative_location (Vector): [Read-Write] Location of the component relative to its parent

  • relative_rotation (Rotator): [Read-Write] Rotation of the component relative to its parent

  • relative_scale3d (Vector): [Read-Write] Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)

  • replicate_using_registered_sub_object_list (bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • should_update_physics_volume (bool): [Read-Write] Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()

  • sound_class (SoundClass): [Read-Write] Sound class this sound belongs to

  • sound_submix (SoundSubmixBase): [Read-Write] Submix this sound belongs to

  • sound_submix_sends (Array[SoundSubmixSendInfo]): [Read-Write] An array of submix sends. Audio from this sound will send a portion of its audio to these effects.

  • source_effect_chain (SoundEffectSourcePresetChain): [Read-Write] The source effect chain to use for this sound.

  • use_attach_parent_bound (bool): [Read-Write] If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.

  • visible (bool): [Read-Write] Whether to completely draw the primitive; if false, the primitive is not drawn, does not cast a shadow.

get_attenuation_settings_to_apply() SoundAttenuationSettings or None

Get the attenuation settings based on the current component settings.

Returns:

true if attenuation settings were returned, false if attenuation is disabled.

out_attenuation_settings (SoundAttenuationSettings): Will contain the attenuation settings, if available.

Return type:

SoundAttenuationSettings or None

get_envelope_value() float

Retrieves the current amplitude envelope.

Return type:

float

get_media_player() MediaPlayer

Get the media player that provides the audio samples. see: SetMediaPlayer

Returns:

The component’s media player, or nullptr if not set.

Return type:

MediaPlayer

get_normalized_spectral_data() Array[MediaSoundComponentSpectralData]

Retrieves and normalizes the spectral data if spectral analysis is enabled.

Return type:

Array[MediaSoundComponentSpectralData]

get_spectral_data() Array[MediaSoundComponentSpectralData]

Retrieves the spectral data if spectral analysis is enabled.

Return type:

Array[MediaSoundComponentSpectralData]

set_enable_envelope_following(envelope_following) None

Turns on amplitude envelope following the audio in the media sound component.

Parameters:

envelope_following (bool) –

set_enable_spectral_analysis(spectral_analysis_enabled) None

Turns on spectral analysis of the audio generated in the media sound component.

Parameters:

spectral_analysis_enabled (bool) –

set_envelope_followingsettings(attack_time_msec, release_time_msec) None

Sets the envelope attack and release times (in ms).

Parameters:
  • attack_time_msec (int32) –

  • release_time_msec (int32) –

set_media_player(new_media_player) None

Set the media player that provides the audio samples. see: GetMediaPlayer

Parameters:

new_media_player (MediaPlayer) – The player to set.

set_spectral_analysis_settings(frequencies_to_analyze, fft_size=MediaSoundComponentFFTSize.MEDIUM_512) None

Sets the settings to use for spectral analysis.

Parameters: