| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Tone.rar | 2014-06-07 | 224.6 kB | |
| Tone.7z | 2014-06-07 | 200.3 kB | |
| Readme.txt | 2014-06-07 | 1.4 kB | |
| Totals: 3 Items | 426.3 kB | 3 |
Was unable to find simple program to generate sound using a batch file or windows console. I needed this and figured that everyone and their brother had written a simple program to output a sound using the default sound device on a windows 32 or 64 computer by typing tone plus frequency and duration (in milliseconds) Tone 1000 2000 (1khz at 2 seconds) great for server farms. This is a spin-off of a project of controlling a inteliport III. I got lazy and will just use mp3 files to do the job. This program is written using windows API calls and works on 32/64 bit systems (apple macbook pro using win 7 32 bit pro and also a 64 bit hp computer running win 7 ultimate 64 and also a Panasonic Toughpad with win 7 32 bit on I5 processer. I did find out this had problems running on a 32 bit eee pc 901 running winXp with a realtek HD audio output
I concluded the problem might be with the sound driver.
Usage: tone 440 1000 generates 440hz tone for 1 second
Sourcecode as follows, this was compiled using Code blocks with gcc
#include <stdio.h>
#include <iostream>
#include <windows.h>
int main(int argc , char * argv[])
{
if(argc!=3)
{
printf("Usage sound frequency duration in ms.");
exit(1);
}
int frq=0;
int dur=0;
frq = atoi(argv[1]);
dur = atoi(argv[2]);
printf("%d", frq);
printf("%d", dur);
Beep(frq,dur);
return 0;
}