diff --git a/src/common/SoundSDL2.cxx b/src/common/SoundSDL2.cxx index b98b538a7..4b619566f 100644 --- a/src/common/SoundSDL2.cxx +++ b/src/common/SoundSDL2.cxx @@ -72,7 +72,7 @@ SoundSDL2::~SoundSDL2() { ASSERT_MAIN_THREAD; - stopWav(); + stopWav(); // NOLINT if(myWavDevice) SDL_CloseAudioDevice(myWavDevice); @@ -409,7 +409,7 @@ bool SoundSDL2::playWav(const char* fileName, uInt32 position, uInt32 length) // - volume (requires callback using SDL_MixAudio) // - (un)mute SDL_AudioSpec wavSpec; - uInt32 wavLength; + uInt32 wavLength{0}; // Stop any playing WAVs stopWav(); diff --git a/src/emucore/Sound.hxx b/src/emucore/Sound.hxx index 52d696209..016f7c102 100644 --- a/src/emucore/Sound.hxx +++ b/src/emucore/Sound.hxx @@ -114,19 +114,20 @@ class Sound @return True, if the WAV file can be played */ - virtual bool playWav(const char* fileName, uInt32 position = 0, uInt32 length = 0) = 0; + virtual bool playWav(const char* fileName, uInt32 position = 0, + uInt32 length = 0) { return false; } /** Stop any currently playing WAV file. */ - virtual void stopWav() = 0; + virtual void stopWav() { } /** Get the size of the WAV file which remains to be played. @return The remaining number of bytes */ - virtual uInt32 wavSize() const = 0; + virtual uInt32 wavSize() const { return 0; } protected: /** diff --git a/src/os/libretro/SoundLIBRETRO.hxx b/src/os/libretro/SoundLIBRETRO.hxx index 5c576df76..d626190f1 100644 --- a/src/os/libretro/SoundLIBRETRO.hxx +++ b/src/os/libretro/SoundLIBRETRO.hxx @@ -151,10 +151,6 @@ class SoundLIBRETRO : public Sound bool toggleMute() override { return !myIsInitializedFlag; } string about() const override { return ""; } - bool playWav(const char*, uInt32, uInt32) override { return false; } - void stopWav() override { } - uInt32 wavSize() const override { return 0; } - private: // Indicates if the sound device was successfully initialized bool myIsInitializedFlag{false};