Is there an easier way to create the default system alert sound on a Mac without having to read the setting file to see what sound file it is set to, load the sound and then play the sound?
Thanks
Create a system alert beep on a Mac
Re: Create a system alert beep on a Mac
You mean a beep like this ?
or
Code: Select all
OpenWindow(0, 0, 0, 222, 200, "Beep example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 200, 40, "Beep")
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget And EventGadget() = 0
NSBeep_()
EndIf
Until Event = #PB_Event_CloseWindow
Code: Select all
#kUserPreferredAlert = $00001000
ImportC "-framework AudioToolbox"
AudioServicesPlaySystemSound(SystemSoundID.l)
EndImport
OpenWindow(0, 0, 0, 222, 200, "User alert example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 200, 40, "Alert")
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget And EventGadget() = 0
AudioServicesPlaySystemSound(#kUserPreferredAlert)
EndIf
Until Event = #PB_Event_CloseWindow
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Create a system alert beep on a Mac
Perfect. Thank you