RhythmGame 1.4.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sounds::NormalSoundBuffer Class Reference

A buffer that can be used to create sounds. Wraps an buffer. More...

#include <NormalSoundBuffer.h>

Inheritance diagram for sounds::NormalSoundBuffer:
Inheritance graph
[legend]
Collaboration diagram for sounds::NormalSoundBuffer:
Collaboration graph
[legend]

Public Member Functions

 NormalSoundBuffer (AudioEngine *engine, const std::filesystem::path &filename)
 Creates a new sound buffer from a file.
 
 NormalSoundBuffer (AudioEngine *engine, QByteArrayView encoded)
 Creates a new sound buffer from an encoded file in memory.
 
auto getFrames () const -> ma_uint64 override
 
auto getSamples () const -> std::span< const float > override
 
- Public Member Functions inherited from sounds::SoundBuffer
virtual ~SoundBuffer ()=default
 

Detailed Description

A buffer that can be used to create sounds. Wraps an buffer.

This class is used to load, decode and store the sound data. It can be used to create multiple sounds that share the same buffer. Creating new instances of this class can be very expensive, so it is recommended to load every sound only once, at the start of a scene.

Constructor & Destructor Documentation

◆ NormalSoundBuffer() [1/2]

sounds::NormalSoundBuffer::NormalSoundBuffer ( AudioEngine *  engine,
const std::filesystem::path &  filename 
)
explicit

Creates a new sound buffer from a file.

Parameters
filenameThe path to the file to load.

◆ NormalSoundBuffer() [2/2]

sounds::NormalSoundBuffer::NormalSoundBuffer ( AudioEngine *  engine,
QByteArrayView  encoded 
)
explicit

Creates a new sound buffer from an encoded file in memory.

Member Function Documentation

◆ getFrames()

auto sounds::NormalSoundBuffer::getFrames ( ) const -> ma_uint64
overridevirtual

Implements sounds::SoundBuffer.

◆ getSamples()

auto sounds::NormalSoundBuffer::getSamples ( ) const -> std::span<const float>
overridevirtual

Implements sounds::SoundBuffer.


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