Xcelled194's picture

OpenAL.GetSource State returning 0?

Hi guys, I'm creating a sound cleanup routine, to delete finished sources. Here is my code:

            SyncLock Sources
                For I = Sources.Count - 1 To 0 Step -1
                    If OpenAL.AL.GetSourceState(Sources(I)) <> OpenAL.ALSourceState.Playing Then
                        OpenAL.AL.SourceStop(Sources(I))
                        OpenAL.AL.DeleteSource(Sources(I))
                        Sources.RemoveAt(I)
                    End If
                Next
            End SyncLock

But for some reason, OpenAL.AL.GetSourceState(Sources(I)) ALWAYS returns 0. And zero is not in the enums....