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....


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
neoproudek's picture

Once, I accidentaly disposed AudioContext and then GetSourceState() was returning 0 instead of enum value. Maybe this is also the case.