I’m using the low level API C# wrapper in Unity to manually drive the streaming, such that:
just a call to
playSound and no
manually retrieving decoded stream via
in a separate thread.
Works almost for all situations as intended, except
getOpenStatestarving flag is unreliable (is not set) in this case - I’m using a workaround by monitoring the buffer percentage ( not, unfortunately 100% reliable, too ) but what is worse
sound.readDatablocks on stream error - i.e. when the network is lost, or file playback is finished.
On Windows, it seems like it is blocking on
WaitForSocketcall and never / until a timeout expires returns.
Is there a way to inspect the stream condition other than by calling ‘getOpenState’ and / or a way to for
sound.readDatato actually return proper error code when there’s no data available in this scenario ?