m_snderror = wxSOUND_INVSTRM;
return FALSE;
}
+ m_snderror = wxSOUND_NOERROR;
data.BigEndianOrdered(TRUE);
wxUint32 num_samples;
double srate;
wxSoundFormatPcm sndformat;
-
+
+ // Get sound data informations
data >> channels >> num_samples >> bps >> srate;
-
+
+ // Convert them in a wxSoundFormat object
sndformat.SetSampleRate((wxUint32) srate);
sndformat.SetBPS(bps);
sndformat.SetChannels(channels);
if (!SetSoundFormat(sndformat))
return FALSE;
+ // We pass all data left
m_input->SeekI(len-18, wxFromCurrent);
break;
}
// m_input->SeekI(len-4, wxFromCurrent); // Pass the rest
m_input->SeekI(ssnd + 4, wxFromCurrent);
m_base_offset = m_input->TellI();
+ // len-8 bytes of samples
FinishPreparation(len - 8);
end_headers = TRUE;
break;
bool wxSoundAiff::RepositionStream(wxUint32 position)
{
+ // If the stream is not seekable "TellI() returns wxInvalidOffset" we cannot reposition stream
if (m_base_offset == wxInvalidOffset)
return FALSE;
m_input->SeekI(m_base_offset, wxFromStart);