]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxMMedia2/lib/sndfile.cpp
makefile typo
[wxWidgets.git] / utils / wxMMedia2 / lib / sndfile.cpp
index f6a00e1376067714013e77284dfadef1391b2537..6525d2bbc6a8b77357e89a22ec4cbbe9bf2f577d 100644 (file)
@@ -5,7 +5,12 @@
 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
 // CVSID: $Id$
 // --------------------------------------------------------------------------
+#include <wx/wxprec.h>
+
+#ifndef WX_PRECOMP
 #include <wx/stream.h>
+#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)