EntityCone

class carb.audio.EntityCone

Bases: pybind11_object

Defines a sound cone relative to an entity’s front vector. It is defined by two angles - the inner and outer angles. When the angle between an emitter and the listener (relative to the entity’s front vector) is smaller than the inner angle, the resulting DSP value will be the ‘inner’ value. When the emitter-listener angle is larger than the outer angle, the resulting DSP value will be the ‘outer’ value. For emitter-listener angles that are between the inner and outer angles, the DSP value will be interpolated between the inner and outer angles. If a cone is valid for an entity, the `ENTITY_FLAG_CONE` flag should be set in `EntityAttributes.flags`.

Note that a cone’s effect on the spatial volume of a sound is purely related to the angle between the emitter and listener. Any distance attenuation is handled separately.

Methods

__init__(self)

Attributes

inside_angle

The inside angle of the entity's sound cone in radians.

low_pass_filter

The low pass filter parameter values to use for emitter-listener lines that are inside and outside the entity's cone angles.

outside_angle

The outside angle of the entity's sound cone in radians.

reverb

The reverb mix level values to use for emitter-listener lines that are inside and outside the entity's cone angles.

volume

The volumes to use for emitter-listener lines that are inside and outside the entity's cone angles.

__init__(self: carb.audio._audio.EntityCone) None
property inside_angle

The inside angle of the entity’s sound cone in radians. This describes the angle around the entity’s forward vector within which the entity’s DSP values will always use their ‘inner’ values. This angle will extend half way in all directions around the forward vector. For example, a 30 degree (as converted to radians to store here) inside angle will extend 15 degrees in all directions around the forward vector. Set this to `CONE_ANGLE_OMNI_DIRECTIONAL` to define an omni-directional entity. This must be greater than or equal to 0 and less than or equal to `outside_angle`.

property low_pass_filter

The low pass filter parameter values to use for emitter-listener lines that are inside and outside the entity’s cone angles. These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. There is no specific range for these values other than what is commonly accepted for low pass filter parameters. This multiplies by member `direct` of `VoiceParams.occlusion`, if that is set to anything other than 1.0. Setting this to a value outside of [0.0, 1.0] will result in an undefined low pass filter value being used.

property outside_angle

The outside angle of the entity’s sound cone in radians. This describes the angle around the entity’s forward vector up to which the volume will be interpolated. When the emitter-listener angle is larger than this angle, the ‘outer’ DSP values will always be used. This angle will extend half way in all directions around the forward vector. For example, a 30 degree (as converted to radians to store here) inside angle will extend 15 degrees in all directions around the forward vector. Set this to `CONE_ANGLE_OMNI_DIRECTIONAL` to define an omni-directional entity. This must be greater than or equal to `inside_angle`.

property reverb

The reverb mix level values to use for emitter-listener lines that are inside and outside the entity’s cone angles. These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. This should be in the range 0.0 (no reverb) to 1.0 (full reverb).

property volume

The volumes to use for emitter-listener lines that are inside and outside the entity’s cone angles. These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. These should be in the range 0.0 (silence) to 1.0 (full volume).