25 #ifndef SFML_MUSIC_HPP
26 #define SFML_MUSIC_HPP
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;
288 #endif // SFML_MUSIC_HPP
bool openFromStream(InputStream &stream)
Open a music from an audio file in a custom stream.
Structure defining a chunk of audio data to stream.
Abstract base class for streamed audio sources.
virtual Int64 onLoop()
Change the current playing position in the stream source to the loop offset.
bool openFromMemory(const void *data, std::size_t sizeInBytes)
Open a music from an audio file in memory.
Streamed music played from an audio file.
Time getDuration() const
Get the total duration of the music.
T length
The length of the time range.
Span(T off, T len)
Initialization constructor.
Structure defining a time range using the template type.
TimeSpan getLoopPoints() const
Get the positions of the of the sound's looping sequence.
Music()
Default constructor.
virtual bool onGetData(Chunk &data)
Request a new chunk of audio samples from the stream source.
void setLoopPoints(TimeSpan timePoints)
Sets the beginning and end of the sound's looping sequence using sf::Time.
T offset
The beginning offset of the time range.
Span()
Default constructor.
bool openFromFile(const std::string &filename)
Open a music from an audio file.
Blocks concurrent access to shared resources from multiple threads.
virtual void onSeek(Time timeOffset)
Change the current playing position in the stream source.