Difference between revisions of "SoundData:getSample"

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.)
m (Update argument description)
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 ===
Line 8: Line 6:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|i|The position of the sample (0 means first sample). Values are not interpolated, so use whole numbers only.}}
+
{{param|number|i|An integer value specifying the position of the sample (0 points to the first sample).}}
  
 
=== Returns ===
 
=== Returns ===

Revision as of 10:29, 10 March 2017

Gets the sample at the specified position.

Function

Synopsis

sample = SoundData:getSample( i )

Arguments

number i
An integer value specifying the position of the sample (0 points to the first sample).

Returns

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

See Also


Other Languages