Sponsored Content
Special Forums Windows & DOS: Issues & Discussions A SOX 1KHz Sinewave Generator Using A Batch File... Post 302790641 by wisecracker on Saturday 6th of April 2013 06:38:46 AM
Old 04-06-2013
A SOX 1KHz Sinewave Generator Using A Batch File...

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~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...

 

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sudo & Sox compliance

Hello, I am trying to convince my boss to stop allowing our users to login as root (superuser). Currently our users login to our unix server with their own account, then as needed, they will do an su and put in the root password. This scares me, for a bunch of reasons. Mainly, one is that we... (1 Reply)
Discussion started by: rwallaceisg
1 Replies

2. UNIX for Dummies Questions & Answers

Parsing Powerbroker Logs for SysAdmin Changes (SOX)

I need to identify a list of AIX command strings that can be used to parse Powerbroker logs for changes that are being made by Unix SysAdmins. Need to filter out (as much as possible) inquiry or routine maintenance activity and concentrate on software/security changes. This is for internal... (1 Reply)
Discussion started by: bcouchtx
1 Replies

3. Programming

Python, Platform Independent, Pure Audio Sinewave Generator...

IKHz_SW_OSX.py A DEMO mono _pure_ sinewave generator using standard text mode Python 2.6.7 to at least 2.7.3. This code is EASILY modifyable to Python version 3.x.x... This DEMO kids level 1KHz generator is mainly for a MacBook Pro, (13 inch in my case), OSX 10.7.5 and above. See below...... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. Shell Programming and Scripting

A Crude 1KHz Audio Sinewave Generator Demo...

A very simple crude sinewave generator. The file required is generated inside the code, is linear interpolated and requires /dev/audio to work. Ensure you have this device, if not the download oss-compat from your OS's repository... It lasts for about 8 seconds before exiting and saves a... (5 Replies)
Discussion started by: wisecracker
5 Replies

5. Programming

A Function To Create A 1 Second Sinewave WAVE Beep File In Python.

sinebeep.py Creating an audio WAVE file called... beep.wav ...that can be played using almost ANY audio player available. This simple DEMO snippet of code generates a 1 second sinewave WAVE file. It IS saved inside the CURRENT drawer so that you can find it... ;o) Note that the... (1 Reply)
Discussion started by: wisecracker
1 Replies

6. OS X (Apple)

A simple variable frequency sinewave audio generator.

Hi all... Well I have not been inactive but working out how to make OSX 10.14.x command line audio player have a variable sample rate. This is a back door as afplay does not have a sample rate flag unlike aplay for ALSA, in Linux flavours. This is a DEMO only but a derivative of it will... (2 Replies)
Discussion started by: wisecracker
2 Replies
queuedefs(4)							   File Formats 						      queuedefs(4)

NAME
queuedefs - queue description file for at, batch, and cron SYNOPSIS
/etc/cron.d/queuedefs DESCRIPTION
The queuedefs file describes the characteristics of the queues managed by cron(1M). Each non-comment line in this file describes one queue. The format of the lines are as follows: q.[njobj][nicen][nwaitw] The fields in this line are: q The name of the queue. a is the default queue for jobs started by at(1); b is the default queue for jobs started by batch (see at(1)); c is the default queue for jobs run from a crontab(1) file. njob The maximum number of jobs that can be run simultaneously in that queue; if more than njob jobs are ready to run, only the first njob jobs will be run, and the others will be run as jobs that are currently running terminate. The default value is 100. nice The nice(1) value to give to all jobs in that queue that are not run with a user ID of super-user. The default value is 2. nwait The number of seconds to wait before rescheduling a job that was deferred because more than njob jobs were running in that job's queue, or because the system-wide limit of jobs executing has been reached. The default value is 60. Lines beginning with # are comments, and are ignored. EXAMPLES
Example 1: A sample file. # # a.4j1n b.2j2n90w This file specifies that the a queue, for at jobs, can have up to 4 jobs running simultaneously; those jobs will be run with a nice value of 1. As no nwait value was given, if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. The b queue, for batch(1) jobs, can have up to 2 jobs running simultaneously; those jobs will be run with a nice(1) value of 2. If a job cannot be run because too many other jobs are running, cron(1M) will wait 90 seconds before trying again to run it. All other queues can have up to 100 jobs running simultaneously; they will be run with a nice value of 2, and if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. FILES
/etc/cron.d/queuedefs queue description file for at, batch, and cron. SEE ALSO
at(1), crontab(1), nice(1), cron(1M) SunOS 5.10 1 Mar 1994 queuedefs(4)
All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy