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 (...) /// {