SoundFreq
SoundFreq SoundIndex, FreqValue
 
Parameters:

    SoundIndex = The Index identifier of sound you wish the change the volume of
    FreqValue = The play back frequency of this sound.
Returns: NONE
 

SoundFreq will set the play back frequency of this sound. Frequency lets you manually control the speed at which a sound is played back. By changing the speed, you also change the pitch of the sound. Playing it faster will make it higher, slower will be lower.

By default sounds get their play back frequency during loading with LoadSound. Frequencies range from 0 through 44000.



FACTS:


* SoundFreq values range between 0 to 44000

* Changing SoundFreq while a sound is playing, will alter the played sounds frequency also.




Mini Tutorial:


This example loads a sound file as sound #1, sets it to loop and plays it.

Then in the main Do/Loop section of the code it is constantly adjusting the sounds play back frequency, to slow and speed up the looping sound.


  
  
; Load the Sound File "Explosion.wav" as sound #1
  LoadSound "explosion.wav",1
  
  
; Set sound to loop automatically once played
  LoopSound 1
  
; Begin playing the looped sound
  PlaySound 1
  
; Start a Do/loop
  Do
   ;Clear the Screen top black
     Cls RGB(0,0,0)
     
   ; display a message
     Print "Sound Is Panning"
     
   ; Bump the Angle# variable by 1
     angle#=WrapAngle(angle#,1)
     
   ; Set the sound 1 to Pan left/right under a cosine
     SoundFreq 1,22000+CosRadius(angle#,22000)
     
   ; Display the sound #1's curremt panning value
     Print GetSoundFreq(1)
     
   ; display the screen
     Sync
   ; Loop back to the DO statement.
  Loop
  



 
Related Info: GetSoundFreq | GetSoundMasterVolume | GetSoundPan | GetSoundStatus | GetSoundVolume | SoundMasterVolume | SoundPan | SoundVolume :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com