From e6d4ee7ad1c29ceb546559fb2bbb604bc3edd4ff Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 22 May 2024 16:37:09 -0600 Subject: [PATCH] Fix sound file docs --- include/SFML/Audio/InputSoundFile.hpp | 4 +--- include/SFML/Audio/OutputSoundFile.hpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/SFML/Audio/InputSoundFile.hpp b/include/SFML/Audio/InputSoundFile.hpp index effeed492..42032972b 100644 --- a/include/SFML/Audio/InputSoundFile.hpp +++ b/include/SFML/Audio/InputSoundFile.hpp @@ -275,9 +275,7 @@ private: /// Usage example: /// \code /// // Open a sound file -/// sf::InputSoundFile file; -/// if (!file.openFromFile("music.ogg")) -/// /* error */; +/// auto file = sf::InputSoundFile::openFromFile("music.ogg").value(); /// /// // Print the sound attributes /// std::cout << "duration: " << file.getDuration().asSeconds() << '\n' diff --git a/include/SFML/Audio/OutputSoundFile.hpp b/include/SFML/Audio/OutputSoundFile.hpp index e21ad58e7..77758275d 100644 --- a/include/SFML/Audio/OutputSoundFile.hpp +++ b/include/SFML/Audio/OutputSoundFile.hpp @@ -111,9 +111,7 @@ private: /// Usage example: /// \code /// // Create a sound file, ogg/vorbis format, 44100 Hz, stereo -/// sf::OutputSoundFile file; -/// if (!file.openFromFile("music.ogg", 44100, 2)) -/// /* error */; +/// auto file = sf::OutputSoundFile::openFromFile("music.ogg", 44100, 2).value(); /// /// while (...) /// {