T1CSound - Simple ActiveX component for sound generation using system speaker:

The component can be used for the generation of sound using system speaker by any applications that support ActiveX components: VBScript and Jscript, ASP (IIS), VBA for Access, Word and Excel, etc.

Platform: Windows 95/98/NT/2000.

The component can be used by system administrator for the alert of predefined system events like port scanning, intrusion detection, applications running, read of specific pages or files, etc. The frequency and duration of sound can be set so that different sound patterns can be assigned to different set of events. Also a developer can use the component for applications debugging, i.e. testing ambiguous conditions, catching not handled exceptions, etc. ASP developer can avoid using response.write and Session variables for debugging and use predefined system sounds for a set of predefined events. You should use the component carefully since the execution of applications stops during sound.

The component is supplied with full source code that can be used freely for any purpose.

 

To create the component you should:
    1. Open MS Visual C++
    2. Choose File - > New
    3. Select ATL COM AppWizard in Projects tab



4.Type the name, i.e Tonec1. Click OK button.
5.On the next screen, click Finish button.

6.Add new ATL object. Insert -> New ATL Object

7.Choose Objects in Category list, and select Simple Objects icon

8.Type the component name. LongBeep for example

9.Add new method to the newly created object. Right click on Ibeep item and select Add Method in pop-up menu.

10. Choose the type of input parameters for the component. Method name: BeepSound. Parameters: [in] long Frequency, [in] long Duration

11. Add the following line of code to ÑlongBeep.cpp file.

   STDMETHODIMP CLongBeep::BeepSound(long Frequency, long Duration)
   {
       BOOL b1;
       b1= Beep(Frequency, Duration);

       return S_OK;
   }

12. Compile the project (preferably with MinDependency option).
13. Register the component: regsvr32 Tonec1.dll. (It's necessary even if you use the compiled component from the zip file below)

Download source code (includes compiled DLL):

Example of calling BeepSound from example.vbs or example.asp:

 Dim objBeep
 Set objBeep = CreateObject("TONEC1.LongBeep")
 objBeep.BeepSound 1000,3000
 Set objBeep = Nothing


Note that Tonec Inc. also provides custom programming and cost-effective offshore software development services. Check out our Free Products page.


If you have any questions, write to info@tonec.com