Difference between revisions of "Sound.new"

From GiderosMobile
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[Sound]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sound|Sound]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Creates a new '''Sound''' object.
Creates a new [[Special:MyLanguage/Sound|Sound]] object.<br />
+
<syntaxhighlight lang="lua">
<br /></translate>
+
Sound.new(filename)
<source lang="lua">
+
Sound.new(data,rate,stereo)
Sound.new(filename)
+
</syntaxhighlight>
</source>
+
 
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''filename''': (string) <translate>The name of the sound file to be loaded.</translate> <br/>
+
'''filename''': (string) the path of the sound file to be loaded<br/>
 +
'''data''': (table) an array of values between -1 and 1 describing the waveform of the sound<br/>
 +
'''rate''': (number) the sampling rate of the waveform<br/>
 +
'''stereo''': (boolean) set to true if the array contains two channels<br/>
  
 
{{Sound}}
 
{{Sound}}

Latest revision as of 07:44, 31 August 2023

Available since: Gideros 2011.6
Class: Sound

Description

Creates a new Sound object.

Sound.new(filename)
Sound.new(data,rate,stereo)

Parameters

filename: (string) the path of the sound file to be loaded
data: (table) an array of values between -1 and 1 describing the waveform of the sound
rate: (number) the sampling rate of the waveform
stereo: (boolean) set to true if the array contains two channels