Banks
EnvironmentBank
- class EnvironmentBank[source]
Bases:
objectInterface for environmental audio assets and FMOD Studio banks.
This class manages the lifecycle of environmental sound banks, including loading the ‘Master’ and ‘Environment’ banks. It instantiates and maintains persistent event instances for ambient sounds like rain and wind, allowing them to be modulated in real-time by the
EnvironmentAdapter.- studio_system
The active FMOD Studio playback engine.
- Type:
StudioSystem
- rain_inst
Persistent instance for the rain audio loop.
- Type:
EventInstance
- wind_inst
Persistent instance for the wind audio loop.
- Type:
EventInstance
- DEFAULT_BANK_PATH = 'path/to/environment_bank'
The default filesystem directory containing the .bank files, sourced from the global configuration.
- Type:
- __init__()[source]
Initializes the FMOD system, loads the environment banks, and immediately starts the ambient sound instances.
- update_studio_system()[source]
Synchronizes the FMOD Studio system. Must be called in main loop to apply parameter changes (intensity) to the running instances.
ExampleBank
- class ExampleBank[source]
Bases:
objectThis class handles the low-level initialization of the FMOD Studio System, manages the loading of .bank files, and provides an interface for retrieving event instances. It serves as a blueprint for specialized banks like
EnvironmentBankandTriggerBank.Note
The class explicitly configures ‘PYFMODEX_DLL_PATH’ and ‘PYFMODEX_STUDIO_DLL_PATH’ to locate the FMOD Engine binaries on Windows.
- studio_system
The core FMOD Studio System instance managing audio execution.
- Type:
StudioSystem
- EXAMPLE_EVENT_PATH = 'event:/Example'
The FMOD project path for the example event.
- Type:
- update_studio_system()[source]
Advances the FMOD Studio playback engine.
This must be called in the main loop to process playback states, parameter changes, and 3D positioning.
TriggerBank
- class TriggerBank[source]
Bases:
objectInterface for discrete, one-shot audio assets within FMOD Studio.
This class manages the loading and playback of trigger-based sound events, such as collisions, horns, and warnings. It maintains specific event instances and provides public methods to initiate playback, which are typically invoked by the
TriggerAdapter.- warning_sound
Instance for the overspeed warning audio.
- Type:
EventInstance
- crash_sound
Instance for the vehicle collision audio.
- Type:
EventInstance
- honk_sound
Instance for the vehicle horn audio.
- Type:
EventInstance
- handBrake_sound
Instance for the handbrake engagement audio.
- Type:
EventInstance
- DEFAULT_BANK_PATH = 'path/to/trigger_bank'
Default directory for trigger .bank files, defined in the system configuration.
- Type:
config
FMOD Project Configuration
This module defines the filesystem paths and event strings required to link the Python engine with FMOD Studio assets. It dynamically resolves the project root to ensure cross-platform compatibility and defines the URI-style paths for specific FMOD events.
- FMOD_CORE_DLL = 'C:\\Program Files (x86)\\FMOD SoundSystem\\FMOD Studio API Windows\\api\\core\\lib\\x64\\fmod.dll'
Absolute path to FMOD Core dll
- FMOD_STUDIO_DLL = 'C:\\Program Files (x86)\\FMOD SoundSystem\\FMOD Studio API Windows\\api\\studio\\lib\\x64\\fmodstudio.dll'
Absolute path to FMOD Studio dll
- TRIGGER_BANK_PATH = 'path/to/trigger_bank'
Absolute path to the Trigger sound banks directory.
- ENVIRONMENT_BANK_PATH = 'path/to/environment_bank'
Absolute path to the Environment sound banks directory.
- RAIN_EVENT_PATH = 'event:/Rain'
FMOD Studio path for the ambient rain loop.
- WIND_EVENT_PATH = 'event:/Wind'
FMOD Studio path for the ambient wind loop.
- WARNING_EVENT_PATH = 'event:/Warning'
FMOD Studio path for the overspeed warning signal.
- CRASH_EVENT_PATH = 'event:/Crash'
FMOD Studio path for the vehicle collision impact.
- HONK_EVENT_PATH = 'event:/Honk'
FMOD Studio path for the vehicle horn.
- HANDBRAKE_EVENT_PATH = 'event:/HandBrake'
FMOD Studio path for the handbrake engagement sound.