I need to get the actual Sampleposition, while playing it.
So I use GetAttribute(#SAMPLE,id,#ATTRPOSITION) to get that value.
On OS3 (Amithlon) everything works fine, but on OS4 I get very nasty values.
In the following Code I get values around -1151680034, while the #DURATION-Attribute gives me a samplelenght of 2282 ms.
Whats the problem here??
Example Code:
Code: Select all
Function p_showduration()
DebugPrint(GetAttribute(#SAMPLE,1,#ATTRDURATION),GetAttribute(#SAMPLE,1,#ATTRPOSITION))
EndFunction
smpdata = {}
slen = 200
For k = 0 To 30
For i = 0 To (slen\2)-1
smpdata[k*slen+i] = -128
smpdata[k*slen+i+(slen\2)] = 127
Next
Next
CreateSample(1, smpdata, 6982)
PlaySample(1)
SetInterval(1,p_showduration,40)
While IsSamplePlaying(1)
waitevent()
wend