Difference between revisions of "SoundChannel:setPitch"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2012.09.3<br/> === Description === <br /> Sets the pitch relative to the pitch of the original sound channel. Default pitch is 1. Se...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros 2012.09.3<br/> | '''Available since:''' Gideros 2012.09.3<br/> | ||
+ | '''Class:''' [[SoundChannel]]<br/> | ||
+ | |||
=== Description === | === Description === | ||
− | + | Sets the pitch relative to the pitch of the original sound channel. | |
− | Sets the pitch relative to the pitch of the original sound channel. | + | <syntaxhighlight lang="lua"> |
+ | SoundChannel:setPitch(pitch) | ||
+ | </syntaxhighlight> | ||
+ | |||
Default pitch is 1. | Default pitch is 1. | ||
− | Setting pitch as 0.5 will make the pitch lower | + | |
− | Setting pitch as 1.5 will make the pitch higher | + | Setting pitch as 0.5 will make the pitch lower. |
− | + | ||
− | + | Setting pitch as 1.5 will make the pitch higher. | |
− | + | ||
− | = | + | '''Note''': you cannot set the pitch of a background music (mp3) |
− | + | ||
− | '''pitch | + | === Parameters === |
+ | '''pitch''': (number) pitch relative to original (0 < lower pitch < 1 < higher pitch)<br/> | ||
+ | |||
+ | {{SoundChannel}} |
Latest revision as of 14:33, 13 July 2023
Available since: Gideros 2012.09.3
Class: SoundChannel
Description
Sets the pitch relative to the pitch of the original sound channel.
SoundChannel:setPitch(pitch)
Default pitch is 1.
Setting pitch as 0.5 will make the pitch lower.
Setting pitch as 1.5 will make the pitch higher.
Note: you cannot set the pitch of a background music (mp3)
Parameters
pitch: (number) pitch relative to original (0 < lower pitch < 1 < higher pitch)
- SoundChannel:getPitch
- SoundChannel:getPosition
- SoundChannel:getStreamId
- SoundChannel:getVolume
- SoundChannel:isLooping
- SoundChannel:isPaused
- SoundChannel:isPlaying
- SoundChannel:setEffect
- SoundChannel:setLooping
- SoundChannel:setPaused
- SoundChannel:setPitch
- SoundChannel:setPosition
- SoundChannel:setVolume
- SoundChannel:setWorldPosition
- SoundChannel:stop