From 2d51fefb7235c7a365ce3c3916a899eb3e414758 Mon Sep 17 00:00:00 2001 From: vittorioromeo Date: Sat, 4 May 2024 19:30:40 +0200 Subject: [PATCH] Remove `sf::AudioResource` --- include/SFML/Audio/AudioResource.hpp | 68 -------------- include/SFML/Audio/SoundSource.hpp | 4 +- src/SFML/Audio/AudioDevice.cpp | 128 +++++++++++---------------- src/SFML/Audio/AudioDevice.hpp | 64 ++++++-------- src/SFML/Audio/AudioResource.cpp | 62 ------------- src/SFML/Audio/CMakeLists.txt | 2 - src/SFML/Audio/Listener.cpp | 24 ++--- src/SFML/Audio/Sound.cpp | 2 +- src/SFML/Audio/SoundStream.cpp | 2 +- test/Audio/AudioResource.test.cpp | 9 -- test/CMakeLists.txt | 1 - 11 files changed, 93 insertions(+), 273 deletions(-) delete mode 100644 include/SFML/Audio/AudioResource.hpp delete mode 100644 src/SFML/Audio/AudioResource.cpp delete mode 100644 test/Audio/AudioResource.test.cpp diff --git a/include/SFML/Audio/AudioResource.hpp b/include/SFML/Audio/AudioResource.hpp deleted file mode 100644 index f423b3d8b..000000000 --- a/include/SFML/Audio/AudioResource.hpp +++ /dev/null @@ -1,68 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org) -// -// This software is provided 'as-is', without any express or implied warranty. -// In no event will the authors be held liable for any damages arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it freely, -// subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; -// you must not claim that you wrote the original software. -// If you use this software in a product, an acknowledgment -// in the product documentation would be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, -// and must not be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source distribution. -// -//////////////////////////////////////////////////////////// - -#pragma once - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include - -#include - - -namespace sf -{ -//////////////////////////////////////////////////////////// -/// \brief Base class for classes that require an audio device -/// -//////////////////////////////////////////////////////////// -class SFML_AUDIO_API AudioResource -{ -protected: - //////////////////////////////////////////////////////////// - /// \brief Default constructor - /// - //////////////////////////////////////////////////////////// - AudioResource(); - -private: - //////////////////////////////////////////////////////////// - // Member data - //////////////////////////////////////////////////////////// - const std::shared_ptr m_device; //!< Sound device -}; - -} // namespace sf - - -//////////////////////////////////////////////////////////// -/// \class sf::AlResource -/// \ingroup audio -/// -/// This class is for internal use only, it must be the base -/// of every class that requires a valid audio device in -/// order to work. -/// -//////////////////////////////////////////////////////////// diff --git a/include/SFML/Audio/SoundSource.hpp b/include/SFML/Audio/SoundSource.hpp index c67da7084..2b9aa701b 100644 --- a/include/SFML/Audio/SoundSource.hpp +++ b/include/SFML/Audio/SoundSource.hpp @@ -29,8 +29,6 @@ //////////////////////////////////////////////////////////// #include -#include - #include #include @@ -42,7 +40,7 @@ namespace sf /// \brief Base class defining a sound's properties /// //////////////////////////////////////////////////////////// -class SFML_AUDIO_API SoundSource : protected AudioResource +class SFML_AUDIO_API SoundSource { public: //////////////////////////////////////////////////////////// diff --git a/src/SFML/Audio/AudioDevice.cpp b/src/SFML/Audio/AudioDevice.cpp index edab9ad62..b18c5ee33 100644 --- a/src/SFML/Audio/AudioDevice.cpp +++ b/src/SFML/Audio/AudioDevice.cpp @@ -38,10 +38,6 @@ namespace sf::priv //////////////////////////////////////////////////////////// AudioDevice::AudioDevice() { - // Ensure we only ever have a single AudioDevice instance - assert(getInstance() == nullptr); - getInstance() = this; - // Create the log m_log.emplace(); @@ -136,31 +132,33 @@ AudioDevice::AudioDevice() } // Set master volume, position, velocity, cone and world up vector - if (const auto result = ma_device_set_master_volume(ma_engine_get_device(&*m_engine), - getListenerProperties().volume * 0.01f); + if (const auto result = ma_device_set_master_volume(ma_engine_get_device(&*m_engine), m_listenerProperties.volume * 0.01f); result != MA_SUCCESS) err() << "Failed to set audio device master volume: " << ma_result_description(result) << std::endl; ma_engine_listener_set_position(&*m_engine, 0, - getListenerProperties().position.x, - getListenerProperties().position.y, - getListenerProperties().position.z); + m_listenerProperties.position.x, + m_listenerProperties.position.y, + m_listenerProperties.position.z); + ma_engine_listener_set_velocity(&*m_engine, 0, - getListenerProperties().velocity.x, - getListenerProperties().velocity.y, - getListenerProperties().velocity.z); + m_listenerProperties.velocity.x, + m_listenerProperties.velocity.y, + m_listenerProperties.velocity.z); + ma_engine_listener_set_cone(&*m_engine, 0, - getListenerProperties().cone.innerAngle.asRadians(), - getListenerProperties().cone.outerAngle.asRadians(), - getListenerProperties().cone.outerGain); + m_listenerProperties.cone.innerAngle.asRadians(), + m_listenerProperties.cone.outerAngle.asRadians(), + m_listenerProperties.cone.outerGain); + ma_engine_listener_set_world_up(&*m_engine, 0, - getListenerProperties().upVector.x, - getListenerProperties().upVector.y, - getListenerProperties().upVector.z); + m_listenerProperties.upVector.x, + m_listenerProperties.upVector.y, + m_listenerProperties.upVector.z); } @@ -182,20 +180,14 @@ AudioDevice::~AudioDevice() // Destroy the log if (m_log) ma_log_uninit(&*m_log); - - // Ensure we only ever have a single AudioDevice instance - assert(getInstance() != nullptr); - getInstance() = nullptr; } //////////////////////////////////////////////////////////// ma_engine* AudioDevice::getEngine() { - auto* instance = getInstance(); - - if (instance && instance->m_engine) - return &*instance->m_engine; + if (m_engine.has_value()) + return &*m_engine; return nullptr; } @@ -205,23 +197,21 @@ ma_engine* AudioDevice::getEngine() void AudioDevice::setGlobalVolume(float volume) { // Store the volume in case no audio device exists yet - getListenerProperties().volume = volume; + m_listenerProperties.volume = volume; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - if (const auto result = ma_device_set_master_volume(ma_engine_get_device(&*instance->m_engine), volume * 0.01f); + if (const auto result = ma_device_set_master_volume(ma_engine_get_device(&*m_engine), volume * 0.01f); result != MA_SUCCESS) err() << "Failed to set audio device master volume: " << ma_result_description(result) << std::endl; } //////////////////////////////////////////////////////////// -float AudioDevice::getGlobalVolume() +float AudioDevice::getGlobalVolume() const { - return getListenerProperties().volume; + return m_listenerProperties.volume; } @@ -229,21 +219,19 @@ float AudioDevice::getGlobalVolume() void AudioDevice::setPosition(const Vector3f& position) { // Store the position in case no audio device exists yet - getListenerProperties().position = position; + m_listenerProperties.position = position; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - ma_engine_listener_set_position(&*instance->m_engine, 0, position.x, position.y, position.z); + ma_engine_listener_set_position(&*m_engine, 0, position.x, position.y, position.z); } //////////////////////////////////////////////////////////// -Vector3f AudioDevice::getPosition() +Vector3f AudioDevice::getPosition() const { - return getListenerProperties().position; + return m_listenerProperties.position; } @@ -251,21 +239,19 @@ Vector3f AudioDevice::getPosition() void AudioDevice::setDirection(const Vector3f& direction) { // Store the direction in case no audio device exists yet - getListenerProperties().direction = direction; + m_listenerProperties.direction = direction; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - ma_engine_listener_set_direction(&*instance->m_engine, 0, direction.x, direction.y, direction.z); + ma_engine_listener_set_direction(&*m_engine, 0, direction.x, direction.y, direction.z); } //////////////////////////////////////////////////////////// -Vector3f AudioDevice::getDirection() +Vector3f AudioDevice::getDirection() const { - return getListenerProperties().direction; + return m_listenerProperties.direction; } @@ -273,21 +259,19 @@ Vector3f AudioDevice::getDirection() void AudioDevice::setVelocity(const Vector3f& velocity) { // Store the velocity in case no audio device exists yet - getListenerProperties().velocity = velocity; + m_listenerProperties.velocity = velocity; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - ma_engine_listener_set_velocity(&*instance->m_engine, 0, velocity.x, velocity.y, velocity.z); + ma_engine_listener_set_velocity(&*m_engine, 0, velocity.x, velocity.y, velocity.z); } //////////////////////////////////////////////////////////// -Vector3f AudioDevice::getVelocity() +Vector3f AudioDevice::getVelocity() const { - return getListenerProperties().velocity; + return m_listenerProperties.velocity; } @@ -295,14 +279,12 @@ Vector3f AudioDevice::getVelocity() void AudioDevice::setCone(const Listener::Cone& cone) { // Store the cone in case no audio device exists yet - getListenerProperties().cone = cone; + m_listenerProperties.cone = cone; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - ma_engine_listener_set_cone(&*instance->m_engine, + ma_engine_listener_set_cone(&*m_engine, 0, std::clamp(cone.innerAngle.asRadians(), 0.f, sf::degrees(360).asRadians()), std::clamp(cone.outerAngle.asRadians(), 0.f, sf::degrees(360).asRadians()), @@ -311,9 +293,9 @@ void AudioDevice::setCone(const Listener::Cone& cone) //////////////////////////////////////////////////////////// -Listener::Cone AudioDevice::getCone() +Listener::Cone AudioDevice::getCone() const { - return getListenerProperties().cone; + return m_listenerProperties.cone; } @@ -321,37 +303,27 @@ Listener::Cone AudioDevice::getCone() void AudioDevice::setUpVector(const Vector3f& upVector) { // Store the up vector in case no audio device exists yet - getListenerProperties().upVector = upVector; + m_listenerProperties.upVector = upVector; - auto* instance = getInstance(); - - if (!instance || !instance->m_engine) + if (!m_engine.has_value()) return; - ma_engine_listener_set_world_up(&*instance->m_engine, 0, upVector.x, upVector.y, upVector.z); + ma_engine_listener_set_world_up(&*m_engine, 0, upVector.x, upVector.y, upVector.z); } //////////////////////////////////////////////////////////// -Vector3f AudioDevice::getUpVector() +Vector3f AudioDevice::getUpVector() const { - return getListenerProperties().upVector; + return m_listenerProperties.upVector; } //////////////////////////////////////////////////////////// -AudioDevice*& AudioDevice::getInstance() +AudioDevice& AudioDevice::get() { - static AudioDevice* instance{}; + static AudioDevice instance; return instance; } - -//////////////////////////////////////////////////////////// -AudioDevice::ListenerProperties& AudioDevice::getListenerProperties() -{ - static ListenerProperties properties; - return properties; -} - } // namespace sf::priv diff --git a/src/SFML/Audio/AudioDevice.hpp b/src/SFML/Audio/AudioDevice.hpp index b092aadec..39a17cc9b 100644 --- a/src/SFML/Audio/AudioDevice.hpp +++ b/src/SFML/Audio/AudioDevice.hpp @@ -46,7 +46,7 @@ namespace sf::priv //////////////////////////////////////////////////////////// class AudioDevice { -public: +private: //////////////////////////////////////////////////////////// /// \brief Default constructor /// @@ -59,17 +59,16 @@ public: //////////////////////////////////////////////////////////// ~AudioDevice(); +public: //////////////////////////////////////////////////////////// /// \brief Get the audio engine /// /// There should only be a single instance of AudioDevice. - /// As long as an AudioResource exists, this function should - /// always return a valid pointer to the audio engine. /// /// \return The audio engine /// //////////////////////////////////////////////////////////// - static ma_engine* getEngine(); + ma_engine* getEngine(); //////////////////////////////////////////////////////////// /// \brief Change the global volume of all the sounds and musics @@ -83,7 +82,7 @@ public: /// \see getGlobalVolume /// //////////////////////////////////////////////////////////// - static void setGlobalVolume(float volume); + void setGlobalVolume(float volume); //////////////////////////////////////////////////////////// /// \brief Get the current value of the global volume @@ -93,7 +92,7 @@ public: /// \see setGlobalVolume /// //////////////////////////////////////////////////////////// - static float getGlobalVolume(); + float getGlobalVolume() const; //////////////////////////////////////////////////////////// /// \brief Set the position of the listener in the scene @@ -105,7 +104,7 @@ public: /// \see getPosition, setDirection /// //////////////////////////////////////////////////////////// - static void setPosition(const Vector3f& position); + void setPosition(const Vector3f& position); //////////////////////////////////////////////////////////// /// \brief Get the current position of the listener in the scene @@ -115,7 +114,7 @@ public: /// \see setPosition /// //////////////////////////////////////////////////////////// - static Vector3f getPosition(); + Vector3f getPosition() const; //////////////////////////////////////////////////////////// /// \brief Set the forward vector of the listener in the scene @@ -132,7 +131,7 @@ public: /// \see getDirection, setUpVector, setPosition /// //////////////////////////////////////////////////////////// - static void setDirection(const Vector3f& direction); + void setDirection(const Vector3f& direction); //////////////////////////////////////////////////////////// /// \brief Get the current forward vector of the listener in the scene @@ -142,7 +141,7 @@ public: /// \see setDirection /// //////////////////////////////////////////////////////////// - static Vector3f getDirection(); + Vector3f getDirection() const; //////////////////////////////////////////////////////////// /// \brief Set the velocity of the listener in the scene @@ -154,7 +153,7 @@ public: /// \see getVelocity, getDirection, setUpVector, setPosition /// //////////////////////////////////////////////////////////// - static void setVelocity(const Vector3f& velocity); + void setVelocity(const Vector3f& velocity); //////////////////////////////////////////////////////////// /// \brief Get the current forward vector of the listener in the scene @@ -164,7 +163,7 @@ public: /// \see setVelocity /// //////////////////////////////////////////////////////////// - static Vector3f getVelocity(); + Vector3f getVelocity() const; //////////////////////////////////////////////////////////// /// \brief Set the cone properties of the listener in the audio scene @@ -177,7 +176,7 @@ public: /// \see getCone /// //////////////////////////////////////////////////////////// - static void setCone(const Listener::Cone& cone); + void setCone(const Listener::Cone& cone); //////////////////////////////////////////////////////////// /// \brief Get the cone properties of the listener in the audio scene @@ -187,7 +186,7 @@ public: /// \see setCone /// //////////////////////////////////////////////////////////// - static Listener::Cone getCone(); + Listener::Cone getCone() const; //////////////////////////////////////////////////////////// /// \brief Set the upward vector of the listener in the scene @@ -204,7 +203,7 @@ public: /// \see getUpVector, setDirection, setPosition /// //////////////////////////////////////////////////////////// - static void setUpVector(const Vector3f& upVector); + void setUpVector(const Vector3f& upVector); //////////////////////////////////////////////////////////// /// \brief Get the current upward vector of the listener in the scene @@ -214,17 +213,17 @@ public: /// \see setUpVector /// //////////////////////////////////////////////////////////// - static Vector3f getUpVector(); + Vector3f getUpVector() const; + + //////////////////////////////////////////////////////////// + /// \brief Gets the audio device singleton, initializing it if necessary + /// + /// \return The audio device + /// + //////////////////////////////////////////////////////////// + static AudioDevice& get(); private: - //////////////////////////////////////////////////////////// - /// \brief This function makes sure the instance pointer is initialized before using it - /// - /// \return The instance pointer - /// - //////////////////////////////////////////////////////////// - static AudioDevice*& getInstance(); - struct ListenerProperties { float volume{100.f}; @@ -235,21 +234,14 @@ private: sf::Vector3f upVector{0, 1, 0}; }; - //////////////////////////////////////////////////////////// - /// \brief Get the listener properties - /// - /// \return The listener properties - /// - //////////////////////////////////////////////////////////// - static ListenerProperties& getListenerProperties(); - //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - std::optional m_log; //!< The miniaudio log - std::optional m_context; //!< The miniaudio context - std::optional m_playbackDevice; //!< The miniaudio playback device - std::optional m_engine; //!< The miniaudio engine (used for effects and spatialisation) + ListenerProperties m_listenerProperties; //!< The listener properties + std::optional m_log; //!< The miniaudio log + std::optional m_context; //!< The miniaudio context + std::optional m_playbackDevice; //!< The miniaudio playback device + std::optional m_engine; //!< The miniaudio engine (used for effects and spatialisation) }; } // namespace sf::priv diff --git a/src/SFML/Audio/AudioResource.cpp b/src/SFML/Audio/AudioResource.cpp deleted file mode 100644 index 8df7a3f3d..000000000 --- a/src/SFML/Audio/AudioResource.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org) -// -// This software is provided 'as-is', without any express or implied warranty. -// In no event will the authors be held liable for any damages arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it freely, -// subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; -// you must not claim that you wrote the original software. -// If you use this software in a product, an acknowledgment -// in the product documentation would be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, -// and must not be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source distribution. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include -#include - -#include -#include - - -namespace sf -{ -//////////////////////////////////////////////////////////// -AudioResource::AudioResource() : -m_device( - []() - { - // Ensure we only ever create a single instance of an - // AudioDevice that is shared between all AudioResources - static std::mutex mutex; - static std::weak_ptr weakAudioDevice; - - const std::lock_guard lock(mutex); - - auto audioDevice = weakAudioDevice.lock(); - - if (audioDevice == nullptr) - { - audioDevice = std::make_shared(); - weakAudioDevice = audioDevice; - } - - return audioDevice; - }()) -{ -} - -} // namespace sf diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt index 258116ce8..6e1c5d75b 100644 --- a/src/SFML/Audio/CMakeLists.txt +++ b/src/SFML/Audio/CMakeLists.txt @@ -3,8 +3,6 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/Audio) # all source files set(SRC - ${SRCROOT}/AudioResource.cpp - ${INCROOT}/AudioResource.hpp ${SRCROOT}/AudioDevice.cpp ${SRCROOT}/AudioDevice.hpp ${INCROOT}/Export.hpp diff --git a/src/SFML/Audio/Listener.cpp b/src/SFML/Audio/Listener.cpp index 521a38a13..7ed5714df 100644 --- a/src/SFML/Audio/Listener.cpp +++ b/src/SFML/Audio/Listener.cpp @@ -34,84 +34,84 @@ namespace sf //////////////////////////////////////////////////////////// void Listener::setGlobalVolume(float volume) { - priv::AudioDevice::setGlobalVolume(volume); + priv::AudioDevice::get().setGlobalVolume(volume); } //////////////////////////////////////////////////////////// float Listener::getGlobalVolume() { - return priv::AudioDevice::getGlobalVolume(); + return priv::AudioDevice::get().getGlobalVolume(); } //////////////////////////////////////////////////////////// void Listener::setPosition(const Vector3f& position) { - priv::AudioDevice::setPosition(position); + priv::AudioDevice::get().setPosition(position); } //////////////////////////////////////////////////////////// Vector3f Listener::getPosition() { - return priv::AudioDevice::getPosition(); + return priv::AudioDevice::get().getPosition(); } //////////////////////////////////////////////////////////// void Listener::setDirection(const Vector3f& direction) { - priv::AudioDevice::setDirection(direction); + priv::AudioDevice::get().setDirection(direction); } //////////////////////////////////////////////////////////// Vector3f Listener::getDirection() { - return priv::AudioDevice::getDirection(); + return priv::AudioDevice::get().getDirection(); } //////////////////////////////////////////////////////////// void Listener::setVelocity(const Vector3f& velocity) { - priv::AudioDevice::setVelocity(velocity); + priv::AudioDevice::get().setVelocity(velocity); } //////////////////////////////////////////////////////////// Vector3f Listener::getVelocity() { - return priv::AudioDevice::getVelocity(); + return priv::AudioDevice::get().getVelocity(); } //////////////////////////////////////////////////////////// void Listener::setCone(const Listener::Cone& cone) { - priv::AudioDevice::setCone(cone); + priv::AudioDevice::get().setCone(cone); } //////////////////////////////////////////////////////////// Listener::Cone Listener::getCone() { - return priv::AudioDevice::getCone(); + return priv::AudioDevice::get().getCone(); } //////////////////////////////////////////////////////////// void Listener::setUpVector(const Vector3f& upVector) { - priv::AudioDevice::setUpVector(upVector); + priv::AudioDevice::get().setUpVector(upVector); } //////////////////////////////////////////////////////////// Vector3f Listener::getUpVector() { - return priv::AudioDevice::getUpVector(); + return priv::AudioDevice::get().getUpVector(); } } // namespace sf diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp index b683fdf59..5e71b831b 100644 --- a/src/SFML/Audio/Sound.cpp +++ b/src/SFML/Audio/Sound.cpp @@ -61,7 +61,7 @@ struct Sound::Impl void initialize() { // Initialize the sound - auto* engine = priv::AudioDevice::getEngine(); + auto* engine = priv::AudioDevice::get().getEngine(); if (engine == nullptr) { diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 7eeeef813..8299bae13 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -61,7 +61,7 @@ struct SoundStream::Impl void initialize() { // Initialize the sound - auto* engine = priv::AudioDevice::getEngine(); + auto* engine = priv::AudioDevice::get().getEngine(); if (engine == nullptr) { diff --git a/test/Audio/AudioResource.test.cpp b/test/Audio/AudioResource.test.cpp deleted file mode 100644 index 5cc5e6175..000000000 --- a/test/Audio/AudioResource.test.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#include - -static_assert(!std::is_constructible_v); -static_assert(std::is_copy_constructible_v); -static_assert(!std::is_copy_assignable_v); -static_assert(std::is_nothrow_move_constructible_v); -static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6d60480e0..c2986dde1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -130,7 +130,6 @@ set(NETWORK_SRC sfml_add_test(test-sfml-network "${NETWORK_SRC}" SFML::Network) set(AUDIO_SRC - Audio/AudioResource.test.cpp Audio/InputSoundFile.test.cpp Audio/Music.test.cpp Audio/OutputSoundFile.test.cpp