From 33cb8f439177208ad9bd8dbcb6b7a4bd3f3e384d Mon Sep 17 00:00:00 2001 From: Coder-Rahul-Y Date: Thu, 28 Apr 2022 16:18:08 +0530 Subject: [PATCH 1/2] Corrected/clarified the setLoopPoints() documentation The previous documentation talks about 'end points' but the current code does not take end point as an argument and hence does not allow specifying the end point of the loop. (Instead the functions allows specifying the beginning offset and the length of the loop.) --- include/SFML/Audio/Music.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp index 89289a7f..60daad4a 100644 --- a/include/SFML/Audio/Music.hpp +++ b/include/SFML/Audio/Music.hpp @@ -189,11 +189,11 @@ public: TimeSpan getLoopPoints() const; //////////////////////////////////////////////////////////// - /// \brief Sets the beginning and end of the sound's looping sequence using sf::Time + /// \brief Sets the beginning and duration of the sound's looping sequence using sf::Time /// - /// Loop points allow one to specify a pair of positions such that, when the music + /// setLoopPoints() allows for specifying the beginning offset and the duration of the loop such that, when the music /// is enabled for looping, it will seamlessly seek to the beginning whenever it - /// encounters the end. Valid ranges for timePoints.offset and timePoints.length are + /// encounters the end of the duration. Valid ranges for timePoints.offset and timePoints.length are /// [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by getDuration(). /// Note that the EOF "loop point" from the end to the beginning of the stream is still honored, /// in case the caller seeks to a point after the end of the loop range. This function can be From 9842c8fdf84208222c71f098bb65c48293efa930 Mon Sep 17 00:00:00 2001 From: kimci86 Date: Fri, 6 May 2022 15:35:44 +0200 Subject: [PATCH 2/2] Fix incorrect cast when loading 16-bit samples from WAV file --- src/SFML/Audio/SoundFileReaderWav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/Audio/SoundFileReaderWav.cpp b/src/SFML/Audio/SoundFileReaderWav.cpp index fcbfa675..6a71703b 100644 --- a/src/SFML/Audio/SoundFileReaderWav.cpp +++ b/src/SFML/Audio/SoundFileReaderWav.cpp @@ -50,7 +50,7 @@ namespace if (static_cast(stream.read(bytes, static_cast(sizeof(bytes)))) != sizeof(bytes)) return false; - value = static_cast(bytes[0] | (bytes[1] << 8)); + value = static_cast(bytes[0] | (bytes[1] << 8)); return true; }