Sound / Beep function from within VB or Excel VBA

Discussion in 'Microsoft Excel Programming' started by tomcee, Oct 16, 2007.

  1. tomcee

    tomcee Guest

    I would like to output a sound with specific frequency and amplitude
    through the pc soundcard (like the 'sound' function in QB).
    (It appears that both VB and ExcelVBA have only a very simple 'Beep'
    command.)
    Control of channel (left and right) would be nice too.
    Thanks,
    TomCee
     
    tomcee, Oct 16, 2007
    #1
    1. Advertisements

  2. tomcee

    JW Guest

    JW, Oct 16, 2007
    #2
    1. Advertisements

  3. tomcee

    tomcee Guest

    On Oct 16, 10:19 am, JW <> wrote:
    > Have a look here.http://www.exceltip.com/st/Playing_sound_notes_using_VBA_in_Microsoft...
    >
    >
    >
    > tomcee wrote:
    > > I would like to output a sound with specific frequency and amplitude
    > > through the pc soundcard (like the 'sound' function in QB).
    > > (It appears that both VB and ExcelVBA have only a very simple 'Beep'
    > > command.)
    > > Control of channel (left and right) would be nice too.
    > > Thanks,
    > > TomCee- Hide quoted text -

    >
    > - Show quoted text -


    Thanks for the tip, but that tip shows how to play .wav files.

    I would like to specify the frequency and duration (like the 'sound'
    command in QB), and have the system generate that tone through the
    speakers.
    Thanks,
    TomCee
     
    tomcee, Oct 16, 2007
    #3
  4. tomcee

    Alice Guest

    Private Type tbeep
    F As Long
    D As Long
    End Type

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

    dim B as tbeep

    b.F = 200 ' Frequency interval from 37 to 10000
    b.D = 100 ' Duration

    Beep b.F, b.D

    Fede

    "tomcee" <> ha scritto nel messaggio
    news:...
    > On Oct 16, 10:19 am, JW <> wrote:
    > > Have a look

    here.http://www.exceltip.com/st/Playing_sound_notes_using_VBA_in_Microsoft..
    ..
    > >
    > >
    > >
    > > tomcee wrote:
    > > > I would like to output a sound with specific frequency and amplitude
    > > > through the pc soundcard (like the 'sound' function in QB).
    > > > (It appears that both VB and ExcelVBA have only a very simple 'Beep'
    > > > command.)
    > > > Control of channel (left and right) would be nice too.
    > > > Thanks,
    > > > TomCee- Hide quoted text -

    > >
    > > - Show quoted text -

    >
    > Thanks for the tip, but that tip shows how to play .wav files.
    >
    > I would like to specify the frequency and duration (like the 'sound'
    > command in QB), and have the system generate that tone through the
    > speakers.
    > Thanks,
    > TomCee
    >
     
    Alice, Oct 17, 2007
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michel

    How BEEP on internal speakers, not on sound-card?

    Michel, Oct 8, 2003, in forum: Microsoft Excel Programming
    Replies:
    4
    Views:
    1,970
    Michel
    Oct 15, 2003
  2. Beep or Make Sound after Calcing

    , Feb 7, 2005, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    254
    Jon Peltier
    Feb 9, 2005
  3. Guest

    Create VBA Function/Sub programatically within Excel VBA

    Guest, Sep 28, 2007, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    304
    Guest
    Sep 28, 2007
  4. kirkm

    Can you stop a Msgbox from making a beep sound? Thanks.

    kirkm, Jul 2, 2009, in forum: Microsoft Excel Programming
    Replies:
    3
    Views:
    1,260
    kirkm
    Jul 4, 2009
  5. JoeU2004

    How to tell when Beep sound is done?

    JoeU2004, Sep 13, 2009, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    193
    JoeU2004
    Sep 13, 2009
Loading...

Share This Page