#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Beep

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Beep

You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Beep

Sorry I should have mentioned that you can also change the duration of the
sound...

Sub TestBeep2()
Beep 500, 100
Beep 1000, 200
Beep 5000, 100
Beep 2000, 300
Beep 200, 700
Beep 500, 200
Beep 1000, 400
Beep 5000, 700
Beep 2000, 200
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Beep

jim:

is there something that needs to be loaded to use the beep arguments?

--


Gary


"Jim Thomlinson" wrote in message
...
Sorry I should have mentioned that you can also change the duration of the
sound...

Sub TestBeep2()
Beep 500, 100
Beep 1000, 200
Beep 5000, 100
Beep 2000, 300
Beep 200, 700
Beep 500, 200
Beep 1000, 400
Beep 5000, 700
Beep 2000, 200
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Beep

oh, i see the function is needed.

--


Gary


"Jim Thomlinson" wrote in message
...
Sorry I should have mentioned that you can also change the duration of the
sound...

Sub TestBeep2()
Beep 500, 100
Beep 1000, 200
Beep 5000, 100
Beep 2000, 300
Beep 200, 700
Beep 500, 200
Beep 1000, 400
Beep 5000, 700
Beep 2000, 200
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Beep

Thank you very much Jim.

That is exactly what I needed.

Antonio

"Jim Thomlinson" wrote:

Sorry I should have mentioned that you can also change the duration of the
sound...

Sub TestBeep2()
Beep 500, 100
Beep 1000, 200
Beep 5000, 100
Beep 2000, 300
Beep 200, 700
Beep 500, 200
Beep 1000, 400
Beep 5000, 700
Beep 2000, 200
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Beep

You can change the beep sound by going to StartControl PanelSounds, Speech
& Audio devicesSounds & Audio DevicesSounds tabClick on Default Beep, then
click Browse. The only selections offered are .wav sounds but you can change
the Beep sound.

"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Beep

Just to avoid confusion with the standard VBA Beep statement, I would modify
the code as follows:

Private Declare Function API_Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq
As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
API_Beep 500, 100
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Jim Thomlinson" wrote in message
...
You can change the frequency of the beep if you impliment the API...
Something like this in a standard code module...

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Sub TestBeep()
Beep 500, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 1000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 5000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 2000, 100
Application.Wait (Now + TimeSerial(0, 0, 1))
Beep 200, 100
End Sub

--
HTH...

Jim Thomlinson


"Antonio" wrote:

I know how to play a .wav file.

I know that the Beep function does not allow to play different sounds.

Is there an easy way to emit two or three (or several) different sounds
without resorting to playing a wav file?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BEEP ziad Excel Discussion (Misc queries) 5 December 28th 07 03:56 PM
No Beep Certior Excel Programming 2 October 24th 05 05:01 PM
Is BEEP all there is?? Gary's Student Excel Programming 5 May 4th 05 07:42 PM
I want to *beep* *beep*!!!! Jake Marx[_3_] Excel Programming 1 February 22nd 04 01:00 PM
I want to *beep* *beep*!!!! KJTFS[_105_] Excel Programming 0 February 20th 04 02:59 PM


All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"