Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
AudioSourceComponent Struct Reference

Component to emit 2D or spatialized 3D sounds. More...

#include <AudioSource.hpp>

Public Attributes

std::string clipPath = ""
 Path to the audio sound clip file (e.g. .wav, .mp3, .flac).
float volume = 1.0f
 Playback volume multiplier (0.0 to 1.0+).
float pitch = 1.0f
 Playback pitch/frequency multiplier.
bool loop = false
 Whether sound loops continuously when playback completes.
bool playOnAwake = true
 Automatically start audio playback when scene initializes.
bool spatialized = true
 Enable 3D spatial attenuation and directional panning.
float minDistance = 1.0f
 Distance at which volume starts attenuating.
float maxDistance = 50.0f
 Maximum distance beyond which sound is silent.
bool isPlaying = false
 Active playback state flag.
bool wasPlaying = false
 Previous frame playback state flag.
void * internalSound = nullptr
 Opaque handle pointer to miniaudio sound object (ma_sound*).
std::string currentLoadedPath = ""
 Currently loaded audio file path.

Detailed Description

Component to emit 2D or spatialized 3D sounds.

Member Data Documentation

◆ clipPath

std::string AudioSourceComponent::clipPath = ""

Path to the audio sound clip file (e.g. .wav, .mp3, .flac).

◆ currentLoadedPath

std::string AudioSourceComponent::currentLoadedPath = ""

Currently loaded audio file path.

◆ internalSound

void* AudioSourceComponent::internalSound = nullptr

Opaque handle pointer to miniaudio sound object (ma_sound*).

◆ isPlaying

bool AudioSourceComponent::isPlaying = false

Active playback state flag.

◆ loop

bool AudioSourceComponent::loop = false

Whether sound loops continuously when playback completes.

◆ maxDistance

float AudioSourceComponent::maxDistance = 50.0f

Maximum distance beyond which sound is silent.

◆ minDistance

float AudioSourceComponent::minDistance = 1.0f

Distance at which volume starts attenuating.

◆ pitch

float AudioSourceComponent::pitch = 1.0f

Playback pitch/frequency multiplier.

◆ playOnAwake

bool AudioSourceComponent::playOnAwake = true

Automatically start audio playback when scene initializes.

◆ spatialized

bool AudioSourceComponent::spatialized = true

Enable 3D spatial attenuation and directional panning.

◆ volume

float AudioSourceComponent::volume = 1.0f

Playback volume multiplier (0.0 to 1.0+).

◆ wasPlaying

bool AudioSourceComponent::wasPlaying = false

Previous frame playback state flag.


The documentation for this struct was generated from the following file: