WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
Music defines a big sound played using streaming, so usually what we call a music :) More...
#include <Music.hpp>
Inheritance diagram for sf::Music:Public Types | |
| enum | Status |
| Enumeration of the sound states. More... | |
Public Member Functions | |
| Music (std::size_t BufferSize=44100) | |
| Construct the music with a buffer size. | |
| ~Music () | |
| Destructor. | |
| bool | OpenFromFile (const std::string &Filename) |
| Open a music file (doesn't play it -- call Play() for that) | |
| bool | OpenFromMemory (const char *Data, std::size_t SizeInBytes) |
| Open a music file from memory (doesn't play it -- call Play() for that) | |
| void | SetLoop (bool Loop) |
| Set the music loop state. | |
| bool | GetLoop () const |
| Tell whether or not the music is looping. | |
| float | GetDuration () const |
| Get the music duration. | |
| void | Play () |
| Start playing the audio stream. | |
| void | Stop () |
| Stop playing the audio stream. | |
| unsigned int | GetChannelsCount () const |
| Return the number of channels (1 = mono, 2 = stereo) | |
| unsigned int | GetSampleRate () const |
| Get the stream sample rate. | |
| Status | GetStatus () const |
| Get the status of the stream (stopped, paused, playing) | |
Protected Member Functions | |
| void | Initialize (unsigned int ChannelsCount, unsigned int SampleRate) |
| Set the audio stream parameters, you must call it before Play() | |
Music defines a big sound played using streaming, so usually what we call a music :)
enum sf::Sound::Status [inherited] |
| sf::Music::Music | ( | std::size_t | BufferSize = 44100 | ) |
Construct the music with a buffer size.
| BufferSize | : Size of the internal buffer, expressed in number of samples (ie. size taken by the music in memory) (44100 by default) |
| sf::Music::~Music | ( | ) |
Destructor.
| unsigned int sf::SoundStream::GetChannelsCount | ( | ) | const [inherited] |
Return the number of channels (1 = mono, 2 = stereo)
| float sf::Music::GetDuration | ( | ) | const |
Get the music duration.
| bool sf::Music::GetLoop | ( | ) | const |
Tell whether or not the music is looping.
Reimplemented from sf::Sound.
| unsigned int sf::SoundStream::GetSampleRate | ( | ) | const [inherited] |
Get the stream sample rate.
| Status sf::SoundStream::GetStatus | ( | ) | const [inherited] |
Get the status of the stream (stopped, paused, playing)
Reimplemented from sf::Sound.
| void sf::SoundStream::Initialize | ( | unsigned int | ChannelsCount, |
| unsigned int | SampleRate | ||
| ) | [protected, inherited] |
Set the audio stream parameters, you must call it before Play()
| ChannelsCount | : Number of channels |
| SampleRate | : Sample rate |
| bool sf::Music::OpenFromFile | ( | const std::string & | Filename | ) |
Open a music file (doesn't play it -- call Play() for that)
| Filename | : Path of the music file to open |
| bool sf::Music::OpenFromMemory | ( | const char * | Data, |
| std::size_t | SizeInBytes | ||
| ) |
Open a music file from memory (doesn't play it -- call Play() for that)
| Data | : Pointer to the file data in memory |
| SizeInBytes | : Size of the data to load, in bytes |
| void sf::SoundStream::Play | ( | ) | [inherited] |
Start playing the audio stream.
Reimplemented from sf::Sound.
| void sf::Music::SetLoop | ( | bool | Loop | ) |
Set the music loop state.
This parameter is disabled by default
| Loop | : True to play in loop, false to play once |
Reimplemented from sf::Sound.
| void sf::SoundStream::Stop | ( | ) | [inherited] |
Stop playing the audio stream.
Reimplemented from sf::Sound.