Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim sp As SoundPool
Dim BrownNoiseId As Int
End Sub
Sub Globals
Dim tbBrownNoise As ToggleButton
Dim tbWhiteNoise As ToggleButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
sp.Initialize(1)
BrownNoiseId = sp.Load(File.DirAssets, "brown.ogg")
End If
Activity.LoadLayout("main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed = True Then
sp.Stop(BrownNoiseId)
End If
End Sub
Sub tbBrownNoise_CheckedChange(Checked As Boolean)
If tbBrownNoise.Checked = True Then
Log("brown noise on")
sp.Play(BrownNoiseId, 1, 1, 1, -1, 1)
Else
Log("brown noise off")
sp.Stop(BrownNoiseId)
End If
End Sub