Difference between revisions of "API Sound.SetRate"

From Flowcode Help
Jump to navigationJump to search
(XML import API auto-gen)
(XML import)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
wiki page name
+
<sidebar>API Contents</sidebar>
 
Sets the current sample rate for the sound - this will stop the playing sound
 
Sets the current sample rate for the sound - this will stop the playing sound
  
 +
<div style="width:25%; float:right" class="toc">
 +
====Class hierarchy====
 +
[[API Sound|Sound]]
 +
:[[API Sound|SetRate]]
 +
</div>
 +
__TOC__
  
===Parameters===
+
==Parameters==
''[[Variable types|HANDLE]] Sounds''
+
[[Variable Types|HANDLE]] ''Sounds''
 
:The handle of the sound object to modify
 
:The handle of the sound object to modify
  
''[[Variable types|ULONG]] Rate''
+
[[Variable Types|ULONG]] ''Rate''
 
:The sample rate to set
 
:The sample rate to set
  
===Return value===
+
 
 +
==Return value==
 
''This call does not return a value''
 
''This call does not return a value''
  
===Detailed description===
 
''No additional information''
 
  
===Examples===
+
==Detailed description==
====Calling in a calculation====
+
The base sample is specified in creation through [[API Sound.Create|Sound.Create]]. This call stops the current playing sound and resets that rate. Subsequent sounds played through this handle will play at the given rate.
* Add to a calculation icon: ::Sound.SetRate(sounds, rate)
+
 
 +
 
 +
If the sound handle is currently playing samples, these will be cleared meaning noticeable glitches may occur. To avoid this, use the ''RateMul'' parameter in [[API Sound.Queue|Sound.Queue]] or [[API Sound.QueueEx|Sound.QueueEx]] to perform software conversion per wave, which will not glitch.
 +
 
 +
 
 +
==Examples==
 +
===Calling in a calculation===
 +
* Add to a calculation icon: <pre class="brush:[cpp]">::Sound.SetRate(sounds, rate)</pre>
 +
 
 +
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:57, 16 January 2014

<sidebar>API Contents</sidebar> Sets the current sample rate for the sound - this will stop the playing sound

Class hierarchy

Sound

SetRate

Parameters

HANDLE Sounds

The handle of the sound object to modify

ULONG Rate

The sample rate to set


Return value

This call does not return a value


Detailed description

The base sample is specified in creation through Sound.Create. This call stops the current playing sound and resets that rate. Subsequent sounds played through this handle will play at the given rate.


If the sound handle is currently playing samples, these will be cleared meaning noticeable glitches may occur. To avoid this, use the RateMul parameter in Sound.Queue or Sound.QueueEx to perform software conversion per wave, which will not glitch.


Examples

Calling in a calculation

  • Add to a calculation icon:
    ::Sound.SetRate(sounds, rate)

No additional examples