Difference between revisions of "SoundData:setSample"

m (1 revision: Importing from potato (again).)
m (0.11.0 -> 11.0)
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
Sets the value of the sample-point at the specified position. For stereo SoundData objects, the data from the left and right channels are interleaved in that order.
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
SoundData:setSample( i, sample )
 +
</source>
 +
=== Arguments ===
 +
{{param|number|i|An integer value specifying the position of the sample (starting at 0).}}
 +
{{param|number|sample|The normalized samplepoint (range -1.0 to 1.0).}}
 +
=== Returns ===
 +
Nothing.
  
Sets the sample at the specified position.
 
 
== Function ==
 
== Function ==
 +
{{newin|[[11.0]]|110|type=variant}}
 +
Sets the value of a sample using an explicit sample index instead of interleaving them in the sample position parameter.
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
SoundData:setSample( i, sample )
+
SoundData:setSample( i, channel, sample )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|i|The position of the sample (0 means first sample).}}
+
{{param|number|i|An integer value specifying the position of the sample (starting at 0).}}
{{param|number|sample|A normalized sample (range -1.0 to 1.0).}}
+
{{param|number|channel|The index of the channel to set within the given sample.}}
 +
{{param|number|sample|The normalized samplepoint (range -1.0 to 1.0).}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
 
== See Also ==
 
== See Also ==
 
* [[parent::SoundData]]
 
* [[parent::SoundData]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets the sample at the specified position.}}
 
{{#set:Description=Sets the sample at the specified position.}}
 +
{{#set:Since=000}}
 +
== Other Languages ==
 +
{{i18n|SoundData:setSample}}

Revision as of 14:16, 22 December 2018

Sets the value of the sample-point at the specified position. For stereo SoundData objects, the data from the left and right channels are interleaved in that order.

Function

Synopsis

SoundData:setSample( i, sample )

Arguments

number i
An integer value specifying the position of the sample (starting at 0).
number sample
The normalized samplepoint (range -1.0 to 1.0).

Returns

Nothing.

Function

Available since LÖVE 11.0
This variant is not supported in earlier versions.

Sets the value of a sample using an explicit sample index instead of interleaving them in the sample position parameter.

Synopsis

SoundData:setSample( i, channel, sample )

Arguments

number i
An integer value specifying the position of the sample (starting at 0).
number channel
The index of the channel to set within the given sample.
number sample
The normalized samplepoint (range -1.0 to 1.0).

Returns

Nothing.

See Also


Other Languages