3// SFML - Simple and Fast Multimedia Library 4// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-dev.org) 6// This software is provided 'as-is', without any express or implied warranty. 7// In no event will the authors be held liable for any damages arising from the use of this software. 9// Permission is granted to anyone to use this software for any purpose, 10// including commercial applications, and to alter it and redistribute it freely, 11// subject to the following restrictions: 13// 1. The origin of this software must not be misrepresented; 14// you must not claim that you wrote the original software. 15// If you use this software in a product, an acknowledgment 16// in the product documentation would be appreciated but is not required. 18// 2. Altered source versions must be plainly marked as such, 19// and must not be misrepresented as being the original software. 21// 3. This notice may not be removed or altered from any source distribution. 240 [[nodiscard]]
void* getSound()
const override;
246const std::unique_ptr<Impl> m_impl;
Storage for audio samples defining a sound.
SoundSource(const SoundSource &)=default
Copy constructor.
std::function< void(const float *inputFrames, unsigned int &inputFrameCount, float *outputFrames, unsigned int &outputFrameCount, unsigned int frameChannelCount)> EffectProcessor
Callable that is provided with sound data for processing.
Status
Enumeration of the sound source states.
Status getStatus() const override
Get the current status of the sound (stopped, paused, playing)
void pause() override
Pause the sound.
~Sound() override
Destructor.
void setLooping(bool loop)
Set whether or not the sound should loop after reaching the end.
Sound(const SoundBuffer &buffer)
Construct the sound with a buffer.
Sound(const SoundBuffer &&buffer)=delete
Disallow construction from a temporary sound buffer.
bool isLooping() const
Tell whether or not the sound is in loop mode.
Time getPlayingOffset() const
Get the current playing position of the sound.
void setBuffer(const SoundBuffer &buffer)
Set the source buffer containing the audio data to play.
Sound & operator=(const Sound &right)
Overload of assignment operator.
void stop() override
stop playing the sound
void play() override
Start or resume playing the sound.
void setBuffer(const SoundBuffer &&buffer)=delete
Disallow setting from a temporary sound buffer.
const SoundBuffer & getBuffer() const
Get the audio buffer attached to the sound.
void setPlayingOffset(Time timeOffset)
Change the current playing position of the sound.
void setEffectProcessor(EffectProcessor effectProcessor) override
Set the effect processor to be applied to the sound.
Sound(const Sound ©)
Copy constructor.