CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::AudioClip Class Referenceabstract

A audio clip is a small piece of audio that is entirely loaded into memory. More...

#include <CeresEngine/Audio/AudioResource.hpp>

Inheritance diagram for CeresEngine::AudioClip:
CeresEngine::AudioResource< AudioClip > CeresEngine::TResource< AudioClip > CeresEngine::AbstractAudioResource CeresEngine::Resource CeresEngine::IReflectable CeresEngine::SimpleAudioClip

Public Member Functions

virtual const SamplesgetSamples () const =0
 
AudioResourceType getType () const final
 
- Public Member Functions inherited from CeresEngine::AbstractAudioResource
virtual ~AbstractAudioResource ()=default
 
virtual const AudioMetadatagetMetadata () const =0
 
bool isClip () const
 
AudioClipasClip ()
 
const AudioClipasClip () const
 
bool isStream () const
 
AudioStreamasStream ()
 
const AudioStreamasStream () const
 
- Public Member Functions inherited from CeresEngine::TResource< AudioClip >
ResourceHandle< AudioClipgetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< AudioClipgetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const AudioClipgetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Resource
 Resource ()
 Default constructor for the Resource class.
 
 Resource (ResourceData &data)
 Creates a new Resource instance by passing a ResourceData instance.
 
virtual ~Resource () noexcept=default
 Resource virtual destructor.
 
ResourceManagergetResourceManager () const noexcept
 
HResource getResourceHandle () const noexcept
 Generates a hash for the provided type.
 
UUID getResourceID () const noexcept
 
HResource getParentResource () const noexcept
 A parent resource to which this resource is attached to.
 
SPtr< ResourceMetadatagetResourceMetadata () const noexcept
 A pointer to the user-defined resource metadata.
 
const PackagePtrgetPackage () const noexcept
 The package from which the resource was loaded from.
 
template<typename T = Resource>
SPtr< TgetShared () noexcept
 Gets a shared pointer to the resource.
 
template<typename T = Resource>
SPtr< const TgetShared () const noexcept
 Gets a shared pointer to the resource.
 
 Resource (ResourceData &data, InputStream &dataStream)
 Creates a new resource by reading data from dataStream.
 
- Public Member Functions inherited from CeresEngine::IReflectable
virtual ~IReflectable () noexcept=default
 

Additional Inherited Members

- Public Types inherited from CeresEngine::AbstractAudioResource
using Sample = unsigned short
 A audio sample type.
 
using Samples = Vector< Sample >
 A collection of multiple audio samples.
 
using SampleIndex = unsigned int
 A type representing the index of a sample.
 
using SampleOffset = int
 A type representing a sample offset.
 
- Static Public Member Functions inherited from CeresEngine::Resource
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 
- Protected Member Functions inherited from CeresEngine::Resource
HResourceStream createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default)
 Creates a new resource stream.
 
void destroyStream (HResourceStream &stream)
 Destroys a stream.
 
void markAsDirty ()
 Marks the resource as dirty.
 

Detailed Description

A audio clip is a small piece of audio that is entirely loaded into memory.

In most cases, a clip is so small that it would not make sense (and even be slower!) to stream the audio in pieces.

Audio clips are most suitable for audio effects and tracks that are played frequently or multiple times.

Template Parameters
Sthe audio sample type

Member Function Documentation

◆ getSamples()

virtual const Samples & CeresEngine::AudioClip::getSamples ( ) const
pure virtual
Returns
The audio clip samples

Implemented in CeresEngine::SimpleAudioClip.

◆ getType()

AudioResourceType CeresEngine::AudioClip::getType ( ) const
finalvirtual

Returns
The audio resource type

Implements CeresEngine::AbstractAudioResource.


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