Welcome, guest | Sign In | My Account | Store | Cart

32 bit Windows to Windows 7...

This batch file generates a 65536 byte binary file to give 8 seconds of pure sinewave at the earphone/speaker output(s)...

It uses ONLY a default Windows 32 bit installation, to Windows 7, except for the installation of SOX...

Obtain SOX from here:-

http://sox.sourceforge.net/

Notepad was the _main_ editor... ;o)

Hopefully the code section does NOT corrupt the binary part which is 8 bytes in size. If it does then let me know on here and I will post a pointer from where to grab it...

Enjoy...

Batch, 26 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
REM Prevent echoing to the CLI...
@ECHO OFF
CLS

REM Generate a pure 1KHz sinewave using SOX...
REM $VER: SOX_DEMO.BAT_Version_0.00.10_(C)2013_B.Walker_G0LCU.

REM This script uses standard Notepad and a default Windows 32 bit install ONLY...
REM It requires no extra installs except SOX itself...
REM The 8 bytes of binary was also generated inside the default Windows OS to windows 7... ;o)

REM Create an 8 byte binary _string_ first for 1 complete sinewave cycle...
SET "rawfile=€&&€ÙþÙ"

REM Write the 8 bytes of binary data to disk in your default TEMP folder...
ECHO | SET /P="%rawfile%" > %TEMP%.\SINEWAVE.RAW

REM Append to the file in powers of 2 to 8*(2^13) = 65536 bytes...
FOR /L %%n IN (1,1,13) DO TYPE %TEMP%.\SINEWAVE.RAW >> %TEMP%.\SINEWAVE.RAW

REM The path is where a default install of SOX resides...
REM Now play the tone burst for around 8 to 9 seconds...
C:\PROGRA~1\SOX-14-4-1\SOX -b 8 -r 8000 -e unsigned-integer -c 1 %TEMP%.\SINEWAVE.RAW -d

REM 1KHz sinewave demo end...
REM ENjoy finding simple solutions to often very difficult problems...

This is a _pure_ 1KHz sinewave generator, batch file, signal source using the earphone socket(s) as the output(s).

It generates the waveform on the fly and saves it to your default _TEMP_ drawer.

IF the SINEWAVE.RAW file is NOT 65536 bytse in size then the binary section of the file has been corrupted by uploading to this site.

Just use the comments section to let me know...

Enjoy finding simple solutions to often very difficult problems. ;o)

Bazza...