X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526ddb13e289be62ee1926c265138c0dea36fa56..ac2def68edf450f51483c8d78dbc2890dd6985bc:/utils/wxMMedia2/lib/sndfile.cpp diff --git a/utils/wxMMedia2/lib/sndfile.cpp b/utils/wxMMedia2/lib/sndfile.cpp index f6a00e1376..6525d2bbc6 100644 --- a/utils/wxMMedia2/lib/sndfile.cpp +++ b/utils/wxMMedia2/lib/sndfile.cpp @@ -5,7 +5,12 @@ // Author: Guilhem Lavaux (C) 1999 // CVSID: $Id$ // -------------------------------------------------------------------------- +#include + +#ifndef WX_PRECOMP #include +#endif + #include "sndbase.h" #include "sndcodec.h" #include "sndfile.h" @@ -168,7 +173,7 @@ bool wxSoundFileStream::Record(unsigned long time) if (!PrepareToRecord(time)) return FALSE; - m_len = m_sndformat->GetByteFromTime(time); + m_len = m_sndformat->GetBytesFromTime(time); if (!StartProduction(wxSOUND_INPUT)) return FALSE; @@ -258,8 +263,9 @@ bool wxSoundFileStream::StopProduction() void wxSoundFileStream::OnSoundEvent(int evt) { size_t len = m_sndio->GetBestSize(); - char buffer[m_sndio->GetBestSize()]; + char *buffer; + buffer = new char[m_sndio->GetBestSize()]; wxSoundStream::OnSoundEvent(evt); switch(evt) { @@ -284,6 +290,7 @@ void wxSoundFileStream::OnSoundEvent(int evt) m_codec.Write(buffer, len); break; } + delete[] buffer; } bool wxSoundFileStream::SetSoundFormat(const wxSoundFormatBase& format)