Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Assets::Audio Class Reference

Holds decoded PCM audio data as an engine asset. More...

#include <AudioAsset.h>

Inheritance diagram for Engine::Assets::Audio:
Collaboration diagram for Engine::Assets::Audio:

Public Member Functions

 Audio (bool initEcsData=false)
 Creates an audio asset and optionally initializes ECS-backed asset data.
 ~Audio () override=default
 Destroys the audio asset.
void setAudioData (AudioData &&audioData)
 Sets the decoded audio data.
uint32_t getSampleRate () const
 Getter.
uint32_t getChannels () const
 Getter.
uint64_t getFrameCount () const
 Getter.
float getDurationSeconds () const
 Getter.
const std::vector< float > & getPcmData () const
 Getter.
void unload () override
 Unloads the audio data and releases resources.
void updateLoadingState () override
 Updates the loading state based on data availability.
Public Member Functions inherited from Asset::AssetBase
 AssetBase (bool initializeDefaultEntity=false)
 Creates a base asset and optionally allocates its default ECS entity.
virtual ~AssetBase ()
 Releases base asset resources.
CpuLoadingState getLoadingState ()
 Gets the loading state of this asset.
void requestLoad ()
 If this asset is in the UNLOADED state it will get added to the assets to load.
entt::entity getEntity () const
 Getter for data.

Private Attributes

uint32_t sampleRate_ = 0
uint32_t channels_ = 0
uint64_t frameCount_ = 0
float durationSeconds_ = 0.0f
std::vector< float > pcmData_

Additional Inherited Members

Protected Attributes inherited from Asset::AssetBase
CpuLoadingState loadingState = UNLOADED
 Current CPU loading state.
entt::registry & mainRegistry
 Registry that owns this asset's ECS data.
entt::entity data
 Entity containing the asset's component data.

Detailed Description

Holds decoded PCM audio data as an engine asset.

Definition at line 14 of file AudioAsset.h.

Constructor & Destructor Documentation

◆ Audio()

Engine::Assets::Audio::Audio ( bool initEcsData = false)
explicit

Creates an audio asset and optionally initializes ECS-backed asset data.

Parameters
initEcsDataWhen true, initializes the base asset's ECS data entity.

◆ ~Audio()

Engine::Assets::Audio::~Audio ( )
overridedefault

Destroys the audio asset.

Member Function Documentation

◆ getChannels()

uint32_t Engine::Assets::Audio::getChannels ( ) const
inlinenodiscard

Getter.

Definition at line 42 of file AudioAsset.h.

References channels_.

◆ getDurationSeconds()

float Engine::Assets::Audio::getDurationSeconds ( ) const
inlinenodiscard

Getter.

Definition at line 52 of file AudioAsset.h.

References durationSeconds_.

◆ getFrameCount()

uint64_t Engine::Assets::Audio::getFrameCount ( ) const
inlinenodiscard

Getter.

Definition at line 47 of file AudioAsset.h.

References frameCount_.

◆ getPcmData()

const std::vector< float > & Engine::Assets::Audio::getPcmData ( ) const
inlinenodiscard

Getter.

Definition at line 57 of file AudioAsset.h.

References pcmData_.

◆ getSampleRate()

uint32_t Engine::Assets::Audio::getSampleRate ( ) const
inlinenodiscard

Getter.

Definition at line 37 of file AudioAsset.h.

References sampleRate_.

◆ setAudioData()

void Engine::Assets::Audio::setAudioData ( AudioData && audioData)

Sets the decoded audio data.

Parameters
audioDataDecoded PCM data from AudioLoader (moved in)

◆ unload()

void Engine::Assets::Audio::unload ( )
overridevirtual

Unloads the audio data and releases resources.

Reimplemented from Asset::AssetBase.

◆ updateLoadingState()

void Engine::Assets::Audio::updateLoadingState ( )
overridevirtual

Updates the loading state based on data availability.

Reimplemented from Asset::AssetBase.

Member Data Documentation

◆ channels_

uint32_t Engine::Assets::Audio::channels_ = 0
private

Definition at line 71 of file AudioAsset.h.

Referenced by getChannels().

◆ durationSeconds_

float Engine::Assets::Audio::durationSeconds_ = 0.0f
private

Definition at line 73 of file AudioAsset.h.

Referenced by getDurationSeconds().

◆ frameCount_

uint64_t Engine::Assets::Audio::frameCount_ = 0
private

Definition at line 72 of file AudioAsset.h.

Referenced by getFrameCount().

◆ pcmData_

std::vector<float> Engine::Assets::Audio::pcmData_
private

Definition at line 74 of file AudioAsset.h.

Referenced by getPcmData().

◆ sampleRate_

uint32_t Engine::Assets::Audio::sampleRate_ = 0
private

Definition at line 70 of file AudioAsset.h.

Referenced by getSampleRate().


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Audio/AudioAsset.h