GenTone


Routine

GenTone [options] AFile

Purpose

Generate an audio file containing a sine wave

Description

This program generates a sine wave of a given amplitude and phase. The samples of the sine wave are written to an audio file. Options are available to specify the number of samples, the sampling frequency and the data format of the output file.

Options

Output file name: AFile:
Specifying "-" as the output file indicates that output is to be written to standard output. If the output file type is not explicitly given (-F option), the extension of the output file name is used to determine the file type.
  ".au"   - AU audio file
  ".wav"  - RIFF WAVE file
  ".aif"  - AIFF-C audio file
  ".raw"  - Headerless file (native byte order)
  ".txt"  - Headerless file (text data)
-f FREQ, --frequency=FREQ
Frequency of the sine wave in Hertz, default 1000.
-r SDEV, --rms=SDEV
Root-mean-square value of the sinusoid, default 1000.
-a AMPL, --amplitude_max=AMPL
Maximum amplitude of the sine wave, default 1414. The amplitude of the sine wave is specified by either the rms value or the maximum amplitude.
-p PHASE, --phase PHASE
Initial phase of the sinusoid (cosine) in degrees, default 0. Zero phase gives a cosine, -90 degrees gives a sine.
-n NSAMP, --number_frames=NSAMP
Number of output samples to be generated.
-s SFREQ, --srate=SFREQ
Sampling frequency for the output audio file, default 8000.
-F FTYPE, --file_type=FTYPE
Output file type.
  "AU" or "au"             - AU audio file
  "WAVE" or "wave"         - RIFF WAVE file
  "AIFF-C" "aiff-c"        - AIFF-C audio file
  "noheader" or "noheader_native" - Headerless file (native byte
                             order)
  "noheader_swap"          - Headerless file (byte swapped)
  "noheader_big-endian"    - Headerless file (big-endian byte
                             order)
  "noheader_little-endian" - Headerless file (little-endian byte
                             order)
-D DFORMAT, --data_format=DFORMAT
Data format for the output file, default integer16
  "mu-law8"   - 8-bit mu-law data
  "A-law8"    - 8-bit A-law data
  "unsigned8" - offset-binary 8-bit integer data
  "integer8"  - two's-complement 8-bit integer data
  "integer16" - two's-complement 16-bit integer data
  "integer24" - two's-complement 24-bit integer data
  "integer32" - two's-complement 32-bit integer data
  "float32"   - 32-bit floating-point data
  "float64"   - 64-bit floating-point data
  "text"      - text data
The data formats available depend on the output file type. AU audio files:
  mu-law, A-law, 8-bit integer, 16-bit integer, 32-bit float, 64-bit
  float
RIFF WAVE files:
  mu-law, A-law, offset-binary 8-bit integer, 16-bit integer
AIFF-C audio files:
  mu-law, A-law, 8-bit integer, 16-bit integer
Headerless files:
  all data formats
-I INFO, --info=INFO
Header information string.
-h, --help
Print a list of options and exit.
-v, --version
Print the version number and exit.

By default, the audio file header for the output file contains a standard information string.

  Standard Header Information:
    date: 1998/09/25 19:19:39 UTC    date
    user: kabal@aldebaran            user
    program: GenTone                program name
This information can be changed with the header information string which is specified as one of the command line options. Structured information records should adhere to the above format with a named field terminated by a colon, followed by numeric data or text. Comments can follow as unstructured information. For the purpose of this program, records are terminated by newline characters. However in the header itself, the newline characters are replaced by nulls. To place a newline character into the header, escape the newline character by preceding it with a '\' character. If the first character of the user supplied header information string is a newline character, the header information string is appended to the standard header information. If not, the user supplied header information string replaces the standard header information.

Author / version

P. Kabal / v4r0 1999/06/06 Copyright (C) 1999


Main Index AFsp