From the moment we call Win API's WaveInOpen
method the system won't sleep nor hibernate until this stream is closed.
Is there any workaround for this?
Wild guess: try calling SetThreadExecutionState(ES_CONTINUOUS) on the same thread that called WaveInOpen.