Difference between revisions of "SoundData:getSample"

(Arguments: Added notice to input parameters not being interpolated, to thwart any assumptions.)
m (Have API docs describe what the API does, but also mention the relevant feature an user might expect it to do, regarding the API's behaviour.)
Line 1: Line 1:
 
Gets the sample at the specified position.
 
Gets the sample at the specified position.
 +
 +
Valid indices start at 0 and go up to buffer length minus one. Non-integer indices are floored, which means the function does not do value interpolation of any kind.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Revision as of 21:12, 18 January 2017

Gets the sample at the specified position.

Valid indices start at 0 and go up to buffer length minus one. Non-integer indices are floored, which means the function does not do value interpolation of any kind.

Function

Synopsis

sample = SoundData:getSample( i )

Arguments

number i
The position of the sample (0 means first sample). Values are not interpolated, so use whole numbers only.

Returns

number sample
The normalized sample (range -1.0 to 1.0).

See Also


Other Languages