CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Play Command (GW BASIC)

    Any body familiar with QBASIC or GW BASIC may know about the Play command ?
    Ie. a function requesting for 2 parameters viz : Frequency & Duration
    Once this line get executed the sound corresponding to the Frequency specified, will be played by the system speaker.

    Eg: Play (700, 20) ' this line will play the sound having 700 Hz for a period of 20 seconds

    Is there a Similar function or any thing in VB (I am not interested in MIDI file players etc)
    Srinika


    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

  2. #2
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    Re: Play Command (GW BASIC)

    You can use Win32 function.

    ' declaration
    private Declare Function Beep Lib "kernel32" (byval dwFreq as Long, _
    byval dwDuration as Long) as Long
    ' button handler
    private Sub Command1_Click()
    Beep 700, 20000
    End Sub



    Duration is in milliseconds of course.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured