--- a/mpd2src/wavreader.cpp
+++ b/mpd2src/wavreader.cpp
@@ -51,6 +51,12 @@
         return false;
     }
     return true;
+}
+
+void WavReader::close()
+{
+    if (m_fp > 0)
+        fclose(m_fp);
 }
 
 const unsigned char *WavReader::data(size_t packetbytes, ssize_t &nread)