96 explicit Music(
const std::filesystem::path& filename);
119 Music(
const void* data, std::size_t sizeInBytes);
179 [[nodiscard]]
bool openFromFile(const std::filesystem::path& filename);
304 std::optional<std::uint64_t>
onLoop() override;
315 [[nodiscard]] std::uint64_t timeToSamples(
Time position) const;
325 [[nodiscard]]
Time samplesToTime(std::uint64_t samples) const;
331 std::unique_ptr<Impl> m_impl;
Music()
Default constructor.
void onSeek(Time timeOffset) override
Change the current playing position in the stream source.
std::optional< std::uint64_t > onLoop() override
Change the current playing position in the stream source to the loop offset.
Time getDuration() const
Get the total duration of the music.
bool openFromStream(InputStream &stream)
Open a music from an audio file in a custom stream.
Music(Music &&) noexcept
Move constructor.
bool onGetData(Chunk &data) override
Request a new chunk of audio samples from the stream source.
Music(const std::filesystem::path &filename)
Construct a music from an audio file.
bool openFromFile(const std::filesystem::path &filename)
Open a music from an audio file.
TimeSpan getLoopPoints() const
Get the positions of the of the sound's looping sequence.
Music(InputStream &stream)
Construct a music from an audio file in a custom stream.
Music(const void *data, std::size_t sizeInBytes)
Construct a music from an audio file in memory.
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.
~Music() override
Destructor.
SoundStream(SoundStream &&) noexcept
Move constructor.
Structure defining a time range using the template type.
Structure defining a chunk of audio data to stream.