OpenConsole()
abc = 3
;Repeat
Dice = Random(3,1)
PrintN("")
;Print (" Choice = " + Str(Choice))
;Print(" ")
;PrintN ("Dice = " + Str(Dice))
If abc = dice
;HOW CAN I GET A BEEP SOUND WHEN abc = dice*******************************************
PrintN ( " Chester " +Str(Dice))
PrintN("")
PrintN( " Guinyard " +Str(abc))
;Debug ""Chester"
Else
PrintN(" Chester " +Str(Dice))
PrintN("")
PrintN( " Guinyard " +Str(abc))
;Debug "Guinyard"
EndIf
Input()
how can i get beep sound when abc = dice
Re: how can i get beep sound when abc = dice
I am on window, so I do not have any idea if this works on other plattforms
Only on windows
from help
Happy Coding and stay healthy.
Code: Select all
PrintN(Chr(7))
Code: Select all
Beep_(200, 200)
Code: Select all
InitSound() ; Initialize Sound system
UseOGGSoundDecoder() ; Use ogg files
; Loads a sound from a file
LoadSound(0, #PB_Compiler_Home +"Examples\3D\Data\Siren.ogg")
; The sound is playing
PlaySound(0, #PB_Sound_Loop, 20)
PrintN("Info: Press any key to stop.")
Input()
FreeSound(0) ; The sound is freed
Happy Coding and stay healthy.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Re: how can i get beep sound when abc = dice
Funny
That it still works with the control character 'BEL'.
Window, Linux, macOS

Code: Select all
If OpenConsole()
out.s = "Hello Ding Dong " + #BEL$
PrintN(out)
Input()
CloseConsole()
EndIf
Last edited by mk-soft on Fri Oct 21, 2022 4:33 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive