SoundBuffer is the low-level for loading and manipulating sound buffers.
More...
#include <SFML/Audio/SoundBuffer.hpp>
|
| | SoundBuffer () |
| | Default constructor.
|
| | SoundBuffer (const SoundBuffer &Copy) |
| | Copy constructor.
|
| | ~SoundBuffer () |
| | Destructor.
|
| bool | LoadFromFile (const std::string &Filename) |
| | Load the sound buffer from a file.
|
| bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes) |
| | Load the sound buffer from a file in memory.
|
| bool | LoadFromSamples (const Int16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate) |
| | Load the sound buffer from an array of samples - assumed format for samples is 16 bits signed integer.
|
| bool | SaveToFile (const std::string &Filename) const |
| | Save the sound buffer to a file.
|
| const Int16 * | GetSamples () const |
| | Return the sound samples.
|
| std::size_t | GetSamplesCount () const |
| | Return the samples count.
|
| unsigned int | GetSampleRate () const |
| | Get the sample rate.
|
| unsigned int | GetChannelsCount () const |
| | Return the number of channels (1 = mono, 2 = stereo, ...).
|
| float | GetDuration () const |
| | Get the sound duration.
|
| SoundBuffer & | operator= (const SoundBuffer &Other) |
| | Assignment operator.
|
SoundBuffer is the low-level for loading and manipulating sound buffers.
Definition at line 46 of file SoundBuffer.hpp.
◆ SoundBuffer() [1/2]
| sf::SoundBuffer::SoundBuffer |
( |
| ) |
|
◆ SoundBuffer() [2/2]
| sf::SoundBuffer::SoundBuffer |
( |
const SoundBuffer & | Copy | ) |
|
Copy constructor.
- Parameters
-
◆ ~SoundBuffer()
| sf::SoundBuffer::~SoundBuffer |
( |
| ) |
|
◆ GetChannelsCount()
| unsigned int sf::SoundBuffer::GetChannelsCount |
( |
| ) |
const |
Return the number of channels (1 = mono, 2 = stereo, ...).
- Returns
- Number of channels
◆ GetDuration()
| float sf::SoundBuffer::GetDuration |
( |
| ) |
const |
Get the sound duration.
- Returns
- Sound duration, in seconds
◆ GetSampleRate()
| unsigned int sf::SoundBuffer::GetSampleRate |
( |
| ) |
const |
Get the sample rate.
- Returns
- Sound frequency (number of samples per second)
◆ GetSamples()
| const Int16 * sf::SoundBuffer::GetSamples |
( |
| ) |
const |
Return the sound samples.
- Returns
- Pointer to the array of sound samples, in 16 bits signed integer format
◆ GetSamplesCount()
| std::size_t sf::SoundBuffer::GetSamplesCount |
( |
| ) |
const |
Return the samples count.
- Returns
- Number of samples
◆ LoadFromFile()
| bool sf::SoundBuffer::LoadFromFile |
( |
const std::string & | Filename | ) |
|
Load the sound buffer from a file.
- Parameters
-
| Filename | : Path of the sound file to load |
- Returns
- True if loading has been successful
◆ LoadFromMemory()
| bool sf::SoundBuffer::LoadFromMemory |
( |
const char * | Data, |
|
|
std::size_t | SizeInBytes ) |
Load the sound buffer from a file in memory.
- Parameters
-
| Data | : Pointer to the file data in memory |
| SizeInBytes | : Size of the data to load, in bytes |
- Returns
- True if loading has been successful
◆ LoadFromSamples()
| bool sf::SoundBuffer::LoadFromSamples |
( |
const Int16 * | Samples, |
|
|
std::size_t | SamplesCount, |
|
|
unsigned int | ChannelsCount, |
|
|
unsigned int | SampleRate ) |
Load the sound buffer from an array of samples - assumed format for samples is 16 bits signed integer.
- Parameters
-
| Samples | : Pointer to the samples in memory |
| SamplesCount | : Number of samples pointed by Samples |
| ChannelsCount | : Number of channels (1 = mono, 2 = stereo, ...) |
| SampleRate | : Frequency (number of samples to play per second) |
- Returns
- True if loading has been successful
◆ operator=()
Assignment operator.
- Parameters
-
| Other | : Instance to assign |
- Returns
- Reference to the sound buffer
◆ SaveToFile()
| bool sf::SoundBuffer::SaveToFile |
( |
const std::string & | Filename | ) |
const |
Save the sound buffer to a file.
- Parameters
-
| Filename | : Path of the sound file to write |
- Returns
- True if saving has been successful
◆ Sound
The documentation for this class was generated from the following file: