+ if (m_router)
+ delete m_router;
+
+ // First, we try to setup the sound device
+ if (m_sndio->SetSoundFormat(format)) {
+ // We are lucky, it is working.
+ wxSoundStream::SetSoundFormat(m_sndio->GetSoundFormat());
+ return TRUE;
+ }
+
+ switch(format.GetType()) {
+ case wxSOUND_NOFORMAT:
+ return FALSE;
+ case wxSOUND_PCM:
+ m_router = new wxSoundStreamPcm(*m_sndio);
+ m_router->SetSoundFormat(format);
+ break;
+ case wxSOUND_ULAW:
+ m_router = new wxSoundStreamUlaw(*m_sndio);
+ m_router->SetSoundFormat(format);
+ break;
+ case wxSOUND_G72X:
+ m_router = new wxSoundStreamG72X(*m_sndio);
+ m_router->SetSoundFormat(format);
+ break;
+ }
+ wxSoundStream::SetSoundFormat(m_router->GetSoundFormat());