GetSoundFrequency()
Syntax
Result = GetSoundFrequency(#Sound [, Channel])Description
Get the current frequency of the sound.
Parameters
#Sound The sound to use. Channel (optional) The channel to use. It's the value returned by PlaySound() when using the #PB_Sound_MultiChannel flag.
Return value
Returns the current frequency (in Hz) of the sound.
Example
If InitSound() ; Initialize Sound system UseOGGSoundDecoder() ; Use ogg files ; Loads a sound from a file If LoadSound(0, #PB_Compiler_Home +"Examples/3D/Data/Siren.ogg") ; The sound is playing PlaySound(0, #PB_Sound_Loop, 20) MessageRequester("Info", "The average frequency is " + Str(GetSoundFrequency(0))+" Hz") MessageRequester("Info", "Ok to stop.") FreeSound(0) ; The sound is freed End EndIf Else Debug "Warning! The sound environment couldn't be initialized. So no sound commands can be used..." EndIf
See Also
SetSoundFrequency()
Supported OS
Windows