SoundVolume
Same as CASL play command, but with volume control. Also possible to use the volume for system, alarm and game sounds as defined in the preferences panel. 
Download

SoundVolume.zip (55 KB)

Functions definition

external "CASL_SoundVolume";

function snd_GetSoundVolume(numeric SoundType) as numeric;
# returns the curremtly sound volume for the specified type of sound
# Parameter:
# SoundType = 0: System Sound
#           = 1: Game Sound
#           = 2: Alarm Sound
#
# Return value: Sound volume between 0 and 100 
#                 0 = Off
#                13 = Low
#                50 = Medium
#               100 = High (Max)

function snd_PlaySound(numeric Frequency, 
                       numeric Duration, 
                       numeric SoundVolume,
                       numeric Synchron) as numeric;
# Parameter
#   Frequency [Hertz]
#   Duration [Milliseconds]
#   SoundVolume: between 0 and 100 
#                 0 = Off
#                13 = Low
#                50 = Medium
#               100 = High (Max)
#   Synchron = 1: synchron, function waits until sound is finished
#   Synchron = 0: asynchron, function returns immediatly, 
#                 sound is played in background. 
#                 The user can stop the sound by tapping the screen


end_external;

variables;
  numeric snd_SystemSound = 0;
  numeric snd_GameSound = 1;
  numeric snd_AlarmSound = 2;
  #
  numeric snd_Asynchron = 0;
  numeric snd_Synchron = 1;
end;
 

  © 2005 Ulrich Riepert / Authorized for posting at CASLSoft.com