Tag Archives: SET

A SOX 1KHz Sinewave Generator Using A Batch File…

By wisecracker

Hi all…

I don’t think this has been done before but I am open to being corrected…

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

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…
(Hmmm, just did a preview and it looks as though it does… ;o( )

Enjoy…

Code:

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~1SOX-14-4-1SOX -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...


…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Can anybody change this into Linux shell scripts?

By monisha

Code:

@echo off

SET "p0=%~0"
SET "p1=%~1"
SET "p2=%~2"
SET "p3=%~3"
SET "p4=%~4"
SET "p5=%~5"
SET "p6=%~6"
SET "p7=%~7"
SET "p8=%~8"
SET "p9=%~9"
SHIFT
SET "p10=%~9"
SHIFT
SET "p11=%~9"

SET "zip_path=D:OraOutputinterco%p10%"

echo Program Name : %p0%
rem echo "Next param : %p1%
echo Next param : Username/Password
echo User Id : %p2%
echo User Name : %p3%
echo Request ID : %p4%
echo File Name : %p5%
echo Entity Name : %p6%
echo Email Address : %p7%
echo Extract ID : %p8%
echo path name : %p9%
echo share directory : %p10%
echo Master Request ID : %p11%

rm !(D:tempXX.txt)

echo Process and Mail Output files
echo %zip_path%
IF NOT EXIST D:OraOutputinterco%p10%out%p11% GOTO MAPERROR
cd D:OraOutputinterco%p10%out%p11%
echo changed to D:OraOutputinterco%p10%out%p11%
IF EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
zip -j D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip D:OraOutputinterco%p10%out%p11%*.*
echo after zip
IF NOT EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip GOTO ENDPROCESS
echo zip file exists after zip
REM rm D:OraOutputinterco%p10%chello_interco*.*
echo Before Mail to %p7%
D:OraOutputintercoes.exe %p7% "Chello Interco Extract has completed" "Please find attached the compressed Intercompany spreadsheets" D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
echo After Mail to %p7%
rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
GOTO ENDPROCESS
:MAPERROR<br ...read more
Source: FULL ARTICLE at The UNIX and Linux Forums

HI! Can anybody change this into Linux shell scripts

By monisha

Code:

@echo off

SET "p0=%~0"
SET "p1=%~1"
SET "p2=%~2"
SET "p3=%~3"
SET "p4=%~4"
SET "p5=%~5"
SET "p6=%~6"
SET "p7=%~7"
SET "p8=%~8"
SET "p9=%~9"
SHIFT
SET "p10=%~9"
SHIFT
SET "p11=%~9"

SET "zip_path=D:OraOutputinterco%p10%"

echo Program Name : %p0%
rem echo "Next param : %p1%
echo Next param : Username/Password
echo User Id : %p2%
echo User Name : %p3%
echo Request ID : %p4%
echo File Name : %p5%
echo Entity Name : %p6%
echo Email Address : %p7%
echo Extract ID : %p8%
echo path name : %p9%
echo share directory : %p10%
echo Master Request ID : %p11%

rm !(D:tempXX.txt)

echo Process and Mail Output files
echo %zip_path%
IF NOT EXIST D:OraOutputinterco%p10%out%p11% GOTO MAPERROR
cd D:OraOutputinterco%p10%out%p11%
echo changed to D:OraOutputinterco%p10%out%p11%
IF EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
zip -j D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip D:OraOutputinterco%p10%out%p11%*.*
echo after zip
IF NOT EXIST D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip GOTO ENDPROCESS
echo zip file exists after zip
REM rm D:OraOutputinterco%p10%chello_interco*.*
echo Before Mail to %p7%
D:OraOutputintercoes.exe %p7% "Chello Interco Extract has completed" "Please find attached the compressed Intercompany spreadsheets" D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
echo After Mail to %p7%
rm D:OraOutputinterco%p10%out%p11%chello_compressed_interco_files.zip
GOTO ENDPROCESS
:MAPERROR<br ...read more
Source: FULL ARTICLE at The UNIX and Linux Forums