Page 1 of 1

how can i get beep sound when abc = dice

Posted: Fri Oct 21, 2022 3:43 pm
by samxxx
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()

Re: how can i get beep sound when abc = dice

Posted: Fri Oct 21, 2022 3:59 pm
by Axolotl
I am on window, so I do not have any idea if this works on other plattforms

Code: Select all

  PrintN(Chr(7)) 
Only on windows

Code: Select all

Beep_(200, 200)
from help

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.

Re: how can i get beep sound when abc = dice

Posted: Fri Oct 21, 2022 4:01 pm
by mk-soft
Funny :) That it still works with the control character 'BEL'.

Code: Select all

If OpenConsole()
  out.s = "Hello Ding Dong " + #BEL$
  PrintN(out)
  Input()
  CloseConsole()
EndIf
Window, Linux, macOS

Re: how can i get beep sound when abc = dice

Posted: Fri Oct 21, 2022 4:32 pm
by infratec