Fri 14 Nov 2008 11:54:12 AM UTC, comment #1:
Ah, yes. I considered this eventuality.
Basically what I did was moving the audio initialization
at SDL sound handler construction time rather then later.
Before, some user code made assumptions as to when
the audio initialization would have taken place, whihc
would have been at on-needed basis (when sound is attempted
to be played).
The exception would still be thrown, but maybe some users
(not all) would catch it.
You get an abort because nobody catches the exception
on construction time. It should be the Player's duty
to do so, and fall-back to use NO sound handler.
Would be easy to do so.
One problem thouh, is you'd never get an (say) onSoundCompleted
call as sound will NEVER be completed if we use NullSoundHandler
and never manually fetch the samples.
The only way to really fix this is one of these:
- Have NullSoundHandler fire its own samples-consuming thread
- Have libcore consume samples manually in main thread, and throw them away if there's no registered VirtualAudioCard
We don't have a VirtualAudioCard yet, so option 2 is still
not possible, and would result in weird side-effects.
For example, is sound is not consumed, NetStream will never
complete...
|