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
AudioSource.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <glm/glm.hpp>
4#include "core/EngineAPI.hpp"
6
7
12// [ReflectClass]
15 // [ReflectField]
16 std::string clipPath = "";
18 // [ReflectField]
19 float volume = 1.0f;
21 // [ReflectField]
22 float pitch = 1.0f;
24 // [ReflectField]
25 bool loop = false;
27 // [ReflectField]
28 bool playOnAwake = true;
30 // [ReflectField]
31 bool spatialized = true;
33 // [ReflectField]
34 float minDistance = 1.0f;
36 // [ReflectField]
37 float maxDistance = 50.0f;
38
39
41 bool isPlaying = false;
43 bool wasPlaying = false;
45 void* internalSound = nullptr;
47 std::string currentLoadedPath = "";
48};
49
50
52
53
54
55
56
57
58
59
#define REGISTER_COMPONENT(Type, MenuPath)
Definition ComponentReflection.hpp:156
#define ENGINE_API
Definition EngineAPI.hpp:10
Component to emit 2D or spatialized 3D sounds.
Definition AudioSource.hpp:13
bool isPlaying
Active playback state flag.
Definition AudioSource.hpp:41
bool wasPlaying
Previous frame playback state flag.
Definition AudioSource.hpp:43
void * internalSound
Opaque handle pointer to miniaudio sound object (ma_sound*).
Definition AudioSource.hpp:45
float minDistance
Distance at which volume starts attenuating.
Definition AudioSource.hpp:34
bool playOnAwake
Automatically start audio playback when scene initializes.
Definition AudioSource.hpp:28
bool loop
Whether sound loops continuously when playback completes.
Definition AudioSource.hpp:25
float pitch
Playback pitch/frequency multiplier.
Definition AudioSource.hpp:22
std::string currentLoadedPath
Currently loaded audio file path.
Definition AudioSource.hpp:47
std::string clipPath
Path to the audio sound clip file (e.g. .wav, .mp3, .flac).
Definition AudioSource.hpp:16
bool spatialized
Enable 3D spatial attenuation and directional panning.
Definition AudioSource.hpp:31
float maxDistance
Maximum distance beyond which sound is silent.
Definition AudioSource.hpp:37
float volume
Playback volume multiplier (0.0 to 1.0+).
Definition AudioSource.hpp:19