how can i get beep sound when abc = dice

Just starting out? Need help? Post your questions and find answers here.
samxxx
User
User
Posts: 10
Joined: Sun Oct 09, 2022 5:17 pm

how can i get beep sound when abc = dice

Post 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()
Axolotl
Addict
Addict
Posts: 870
Joined: Wed Dec 31, 2008 3:36 pm

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

Post 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.
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).
User avatar
mk-soft
Always Here
Always Here
Posts: 6285
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

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

Post 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
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
infratec
Always Here
Always Here
Posts: 7658
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post by infratec »

Post Reply