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
IBDM-TOPO-FILE(1)					       IB DATA MODEL PACKAGE						 IBDM-TOPO-FILE(1)

NAME
ibdm-topo-file - 1IBDM Topology File DESCRIPTION
The topology file describes the IB connectivity and systems included in the network. It serves two purposes: 1. Support for arbitrary system names to be later used in every report that IBDM generates. 2. Connectivity verification: The specified network topology is verified against the discovered one. Mismatch errors resulting from missing cables and/or wrong connections are reported by IBADM. The topology file is composed "system" sections. Each such section describes the connectivity of one system to other systems in the network. The first line of each section is a declaration of the system composed of a system-type, its system-name section, and optional configuration details. The lines to follow until the next empty line describe the connections between this system ports to the other systems. The following is a formal definition of a system section syntax. An example is listed afterwards. SYSTEM-TYPE SYSTEM-NAME [CFG: <b1>=<modifier>, [<b2>=<modifier>]...] LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME . . . SYSTEM-TYPE SYSTEM-NAME [CFG: <b1>=<modifier>, [<b2>=<modifier>]...] LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME LOCAL-PORT-PANEL-NAME -> REM-SYS-TYPE REM-SYS-NAME REM-PORT-PANEL-NAME . . . . . . Where: SYSTEM-TYPE and REM-SYS-TYPE Any system that has a corresponding IBNL definition. See man ibdm-ibnl-file SYSTEM-NAME The name of the system described in this topology file section. LOCAL-PORT-PANEL-NAME The name of the local system port. The numbers printed on the front panel are used together with Ln for Leaf no. N or Sn for Spine no. N. REM-SYS-NAME The name of the system connected to the local port. REM-PORT-PANEL-NAME A name of the remote system port. We use the numbers as printed on the front panel and Ln for Leaf number N or Sn for Spine number N. EXAMPLE
The following is a topology file for a simple cluster with one 24 port switch and two HCAs. The firts HCA named H-1 and connect to the fabric with its two ports. The second HCA named H-2. The switch is of type MTS2400 and is named S-1 MTS2400 S-1 P1 -> MT23108 H-1 P1 P2 -> MT23108 H-1 P2 P24 -> MT23108 H-2 P1 OPTIONAL CFG SECTION
This section in the system declaration line describes the special customization of each board of the system. That is the CFG string is a set of comma-separated sub-fields. Each sub-field describes some special configuration of a corresponding system board. The actual semantics of the specific board modifiers is defined by the IBNL of the specific system. EXAMPLE
The following is an example of a definition-line in a topology file of the MTS9600 switch system. This switch system can have up to eight leafs and four spines. This example of the MTS9600 lacks (R) leafs no.6,7 and 8, and lacks spines no. 3 and 4. MTS9600 PartialGz1 CFG: leaf3=R,leaf5=R,leaf7=R,spine1=R AUTHOR
Eitan Zahavi, Mellanox Technologies LTD, eitan@mellanox.co.il IBDM 1.0 2009-02-16 IBDM-TOPO-FILE(1)
All times are GMT -4. The time now is 01:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy