16 bit Ptr values

BlitzMax Forums/BlitzMax Programming/16 bit Ptr values

A look at the definition of TAudioSample shows that samples is a byte pointer.
So samples[something] refers to a byte.

You need a short pointer to the same memory. Here's how to cast a Byte Ptr to a Short Ptr.
Local n

Local bp:Byte Ptr = Varptr(n)

bp[0] = 256 + 1
Print n

Local sp:Short Ptr = Short Ptr bp

sp[0] = 256 + 1
Print n