]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxMMedia/sndwav.cpp
jconfig.h uses configures results
[wxWidgets.git] / utils / wxMMedia / sndwav.cpp
index ad6419147c9f9fcd75d9e5560ee131e38d025ea9..23857f15c181fa033db64b8036f99f238b7a27aa 100644 (file)
@@ -86,9 +86,6 @@ wxUint32 wxSndWavCodec::PrepareToPlay()
   if (!riff_codec.FindChunk("data"))
     return 0;
 
-  m_sndformat.SetSampleRate(wav_hdr.sample_fq);
-  m_sndformat.SetBps(wav_hdr.bits_p_spl);
-  m_sndformat.SetChannels(wav_hdr.channels);
   m_sndmode = wxSND_OUTPUT;
   ChangeCodec(wav_hdr.format);
 
@@ -109,6 +106,7 @@ wxUint32 wxSndWavCodec::PrepareToPlay()
   m_sndtime.seconds = sec2 % 60;
 
   wxSndFileCodec::m_mmerror = wxMMFILE_NOERROR;
+  wxSndFileCodec::m_fstate = wxSFILE_PREPARED_TO_PLAY;
 
   return riff_codec.GetChunkLength();
 }
@@ -142,13 +140,12 @@ bool wxSndWavCodec::PrepareToRecord(wxUint32 m_fsize)
   if (!riff_codec.CreateChunk("fmt ", sizeof(wav_hdr)))
     return FALSE;
 
-  wav_hdr.format = 1; // PCM_WAV_FORMAT
+  wav_hdr.format = m_sndformat.GetCodecNo(); // PCM_WAV_FORMAT
   wav_hdr.channels = m_sndformat.GetChannels();
   wav_hdr.sample_fq = m_sndformat.GetSampleRate();
   wav_hdr.byte_p_spl = (m_sndformat.GetBps() / 8) * wav_hdr.channels;
   wav_hdr.byte_p_sec = m_sndformat.GetCodec()->GetByteRate();
   wav_hdr.bits_p_spl = m_sndformat.GetBps();
-  ChangeCodec(WXSOUND_PCM);
 
   if (wav_hdr.format == WXSOUND_PCM) {
     m_sndformat.SetSign(wxSND_SAMPLE_SIGNED);