31#include <SFML/Audio/Export.hpp>
32#include <SFML/Audio/SoundStream.hpp>
33#include <SFML/Audio/InputSoundFile.hpp>
34#include <SFML/System/Mutex.hpp>
35#include <SFML/System/Time.hpp>
264 Uint64 timeToSamples(
Time position)
const;
274 Time samplesToTime(Uint64 samples)
const;
280 std::vector<Int16> m_samples;
Streamed music played from an audio file.
Music()
Default constructor.
virtual void onSeek(Time timeOffset)
Change the current playing position in the stream source.
Time getDuration() const
Get the total duration of the music.
bool openFromFile(const std::string &filename)
Open a music from an audio file.
bool openFromStream(InputStream &stream)
Open a music from an audio file in a custom stream.
virtual Int64 onLoop()
Change the current playing position in the stream source to the loop offset.
TimeSpan getLoopPoints() const
Get the positions of the of the sound's looping sequence.
virtual bool onGetData(Chunk &data)
Request a new chunk of audio samples from the stream source.
void setLoopPoints(TimeSpan timePoints)
Sets the beginning and duration of the sound's looping sequence using sf::Time.
bool openFromMemory(const void *data, std::size_t sizeInBytes)
Open a music from an audio file in memory.
Blocks concurrent access to shared resources from multiple threads.
Abstract base class for streamed audio sources.
Structure defining a time range using the template type.
T offset
The beginning offset of the time range.
T length
The length of the time range.
Span()
Default constructor.
Span(T off, T len)
Initialization constructor.
Structure defining a chunk of audio data to stream.