carb.audio#

Classes Summary:

AudioResult

Possible result codes for audio operations.

Context

The Context object for the audio system.

ContextCaps

The capabilities of the context object. Some of these values are set

ContextError

Common base class for all non-exit exceptions.

ContextParams

Context parameters block. This can potentially contain all of a

ContextParams2

Extended context parameters block. This is used to set and retrieve

DecoderError

Common base class for all non-exit exceptions.

DeviceCaps

Contains information about a single audio input or output device. Note that this information should not be stored since it can change at any time due to user activity (ie: unplugging a device, plugging in a new device, changing system default devices, etc). Device information should only be queried just before deciding which device to select.

DspValuePair

Specifies a pair of values that define a DSP value range to be interpolated between based on an emitter-listener angle that is between a cone’s inner and outer angles. For angles that are smaller than the cone’s inner angle, the ‘inner’ DSP value will always be used. Similarly, for angles that are larger than the cone’s outer angle, the ‘outer’ DSP value will always be used. Interpolation will only occur when the emitter-listener angle is between the cone’s inner and outer angles. No specific meaning or value range is attached to the ‘inner’ and ‘outer’ DSP values. These come from the specific purpose that this object is used for.

EmitterAttributes

Spatial attributes of an emitter entity.

EncoderError

Common base class for all non-exit exceptions.

EntityAttributes

Base spatial attributes of the entity. This includes its position, orientation, and velocity and an optional cone.

EntityCone

Defines a sound cone relative to an entity’s front vector. It is defined by two angles -

EventPoint

An event point parsed from a data file. This contains the ID of the event point, its name

Float2

A Python friendly replacement of the carb::Float2 struct.

Guid

Representation of a globally unique identifier. This is a 128 bit identifier that is often printed in the format ‘{00000000-0000-0000-0000-000000000000}’.

IAudioData

Sound Data management interface. This allows sounds to be loaded from disk or a blob in

IAudioPlayback

Audio playback interface. This interface and its objects manages all audio playback operations and objects. The main operations in this interface are device discovery and context object creation. Once a context object has been created, all of the playback operations are managed through it. Note that only a limited number of playback contexts can exist in a process at any given time. It is best practice to always explicitlyset the variable holding the context object to `None` when it is no longer needed. This helps prevent other attempts to create a new context from failing while waiting for the object to be garbage collected.

LoopPointDesc

Descriptor of a loop point to set on a voice. This may be specified

NotAvailable

Common base class for all non-exit exceptions.

OutputDesc

Descriptor of the audio output target to use for an audio context. This may be specified both when creating an audio context and when calling set_output(). An output may only consist of a real audio device from the Python side

PeakVolumes

Used to retrieve the peak volume information for a sound data object. This contains one volume level per channel in the stream and the frame in the stream at which the peak occurs.

PlaybackContextDesc

Descriptor used to indicate the options passed to the createContext() function. This determines the how the context will behave.

ReadOnly

Common base class for all non-exit exceptions.

RolloffDesc

Descriptor of the rolloff mode and range. The C++ API allows rolloff curves to be set

RolloffType

Distance based DSP value rolloff curve types. These represent the formula that will be used to calculate the spatial DSP values given the distance between an emitter and the listener. This represents the default attenuation calculation that will be performed for all curves that are not overridden with custom curves. The default rolloff model will follow the inverse square law (ie: `INVERSE`).

SampleFormat

the data type for a single sample of raw audio data. This describes how each sample in the data buffer should be interpreted. In general, audio data can only be uncompressed Pulse Code Modulation (PCM) data, or encoded in some kind of compressed format.

SoundData

Sound data object. This provides storage for a single sound asset. The asset’s data, metadata (if any), and various properties about its format are stored and can be retrieved as needed. There are also helper functions to allow new data to be written to the object’s internal data buffers.

SoundDataError

Common base class for all non-exit exceptions.

SoundFormat

Provides information about the format of a sound. When a sound is loaded from a file, its format will be implicitly set on load. The actual format can then be retrieved later with get_format() on a sound data object.

Speaker

Names for each supported standard speaker. Positions are given relative to the unit circle where the listener is at the circle’s center and angles run in the clockwise direction with 0 degrees being directly in front of the listener. Note that some of these speakers may have different positions depending on the overall speaker layout. For example, in a stereo layout the ‘front left’ and ‘front right’ speakers are typically used but are located at 270 and 90 degrees respectively instead of 315 and 45 degrees.

UnitType

Description of how a size or offset value is defined.

Voice

Represents a single instance of a playing sound. A single sound object

VoiceParamBalance

Non-spatial sound positioning parameters. These provide pan and fade values for the voice to give the impression that the sound is located closer to one of the quadrants of the acoustic space versus the others. These values are ignored for spatial sounds.

VoiceParamOcclusion

The occlusion factors for a voice. This is valid when the `VOICE_PARAM_OCCLUSION_FACTOR` flag is used. These values control automatic low pass filters that get applied to the spatial sounds to simulate object occlusion between the emitter and listener positions.

VoiceParams

Voice parameters block. This can potentially contain all of a voice’s

Functions Summary:

acquire_data_interface

acquire_data_interface(plugin_name: str = None, library_path: str = None) -> carb.audio._audio.IAudioData

acquire_playback_interface

acquire_playback_interface(plugin_name: str = None, library_path: str = None) -> carb.audio._audio.IAudioPlayback

get_force_off_playback_mode_flags

get_force_off_playback_mode_flags(flags: int) -> int

get_force_on_playback_mode_flags

get_force_on_playback_mode_flags(flags: int) -> int