if (ptr == NULL)
return FALSE;
+ // Normally, these three functions could be called only once.
codec->SetOutStream(ptr->sndbuf);
codec->InitIO(m_drvformat);
+ codec->InitMode(wxSoundCodec::DECODING);
// Fill it up
codec->Decode();
} else {
codec = buf->GetCurrentCodec();
+ // Normally, these three functions could be called only once.
codec->SetInStream(ptr->sndbuf);
codec->InitIO(m_drvformat);
+ codec->InitMode(wxSoundCodec::ENCODING);
// As there is an "auto-stopper" in the codec, we don't worry ...
codec->Encode();
buf->Clear(wxSND_BUFSTOP);
continue;
}
- if (buf->GetMode() == wxSND_OUTPUT)
+ switch (buf->GetMode()) {
+ case wxSND_OUTPUT:
ret = NotifyOutputBuffer(buf);
- else
+ break;
+ case wxSND_INPUT:
ret = NotifyInputBuffer(buf);
+ break;
+ case wxSND_DUPLEX:
+ case wxSND_OTHER_IO:
+ // ret = NotifyDuplexBuffer(buf);
+ break;
+ }
buf->HardUnlock();
}