Difference between revisions of "API Sound.SetRate"
From Flowcode Help
Jump to navigationJump to search (XML import of updated API docs) |
|||
Line 24: | Line 24: | ||
==Detailed description== | ==Detailed description== | ||
− | '' | + | The base sample is specified in creation through [[API Sound.Create|Sound.Create]]. This call does not alter that rate, but specifies a scale factor for the samples played. Subsequent sounds played through this handle will have their wave-forms transformed using this scale factor as a step. Linear interpolation is used to smooth the waveform. |
+ | |||
+ | |||
+ | The conversion factor is calculated as (Original_Rate / ''Rate''), meaning a ''Rate'' of zero is illegal and will cause the call to fail. | ||
+ | |||
Revision as of 16:30, 7 August 2013
<sidebar>API contents</sidebar>
Sets the current sample rate for the sound - this will stop the playing sound
Contents
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 does not alter that rate, but specifies a scale factor for the samples played. Subsequent sounds played through this handle will have their wave-forms transformed using this scale factor as a step. Linear interpolation is used to smooth the waveform.
The conversion factor is calculated as (Original_Rate / Rate), meaning a Rate of zero is illegal and will cause the call to fail.
Examples
Calling in a calculation
- Add to a calculation icon:
::Sound.SetRate(sounds, rate)
No additional examples