Related sites:
More related sites:

Naurtech Support Wiki

Navigation: Print | Search | Wiki Home | Back to www.naurtech.com

Support Topics

  • Home
  • Usage Videos
  • Scripting
  • Web Browser
  • Download & Setup
  • License Registration
  • Cold Boot Persistence
  • Barcode Scanner
  • Remapping keys
  • Sounds & Tones
  • Lockdown & Fullscreen
  • Misc. & Usage Tips
  • Tools & Utilities

Wiki Actions

  • View
  • Edit
  • Print
Naurtech Corporation Copyright. All rights reserved.

Sound a tone or play a WAV file

This sample script shows how you can sound tones and play a WAV file. You can use this functionality as part of any other script or web web application to provide an audible notification. This sample is implemented as a web application. However you can use the script functions as part of any other event handler.

The script shows how you can play beeps, tones or WAV files. If playing WAV files, you must make sure and copy the WAV file to the device path being referenced.

To download, right mouse click and "Save Target As..." PlaySound.htm

Here are the different ways to play / sound tones:

  • To play a standard message beep, you can use the IDA command
function doIDABeepOK()
{
    external.CETerm.PostIDA("IDA_BEEP_OK", 0);
}

  • To play a loud beep, you can use the IDA command
function doIDABeepLoud()
{
    external.CETerm.PostIDA("IDA_BEEP_LOUD", 0);
}
  • To sound a tone, you can use the Playtone interface of the OS object and provide volume, frequency and duration as input parameters. The same interface can be sequenced with variations in the input parameters to sound complex tones. For the Playtone interface
* volume is 00 -10 (0 is off, 10 is loudest)
* frequency is in Hz.
duration is in milliseconds.
function doOSPlayTone()
{
    external.OS.PlayTone(10, 783, 200);
    external.OS.PlayTone(10, 880, 200);
    external.OS.PlayTone(10, 987, 200);
    external.OS.PlayTone(10, 1046, 200);
    external.OS.PlayTone(10, 1174, 200);
    external.OS.PlayTone(10, 1318, 200);
    external.OS.PlayTone(10, 1396, 200);
    external.OS.PlayTone(10, 1566, 200);
    external.OS.PlayTone(10, 1760, 200);
    external.OS.PlayTone(10, 1974, 200);
    external.OS.PlayTone(10, 2092, 400);
}
  • To play a WAV file, you can use Paysound interface. The default folder is the \Windows directory. if the WAV file is in some other folder on the device, then you must use the absolute path to it.
function doOSPlaySound()
{
    external.OS.PlaySound( "infbeg.wav", 0);
    external.OS.PlaySound( "infend.wav", 0);
}

The article is provided as a service to current and perspective Naurtech customers. Trademark references made to various companies and their products belong to the respective companies. All information is provided as is. For questions, please contact us at  support@naurtech.com.