API Sound.SetRate

From Flowcode Help
Jump to navigationJump to search
Fc9-comp-macro.png SetRate
Sets the current sample rate for the sound - this will stop the playing sound 
Fc9-h32-icon.png - HANDLE Sounds
The handle of the sound object to modify 
Fc9-u32-icon.png - ULONG Rate
The sample rate to set 
Fc9-void-icon.png - NONE Return


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)