1. alternative to sound or beep command

Hello. Since the sound and beep functions only work under DOS, are there alternatives for Windows, Linux and Mac OS 10? I wrote a countdown timer that I would like to beep a few times when the time is up. Thanks.

new topic     » topic index » view message » categorize

2. Re: alternative to sound or beep command

tiger0581 said...

Hello. Since the sound and beep functions only work under DOS, are there alternatives for Windows, Linux and Mac OS 10? I wrote a countdown timer that I would like to beep a few times when the time is up. Thanks.

Its generally better to use the sound-playing APIs on those systems. Win32lib has playSound() and Beep() for example. It is possible to do a system-speaker beep, but note that some newer computers lack an internal speaker or play it thru the regular speakers at an obscenely loud volume level.

new topic     » goto parent     » topic index » view message » categorize

3. Re: alternative to sound or beep command

Try

include graphic.e 
 
 global procedure beep(integer num) 
 atom t 
 for i = 1 to num do 
     machine_proc(1, 1000) 
         t = time() 
          while time() < t + .1 do 
           end while 
    machine_proc(1, 0) 
        t = time() 
           while time() < t + .1 do 
         end while 
    end for 
 end procedure 
 
Don Cole
new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu