Chapter 7
Multimedia Services Command Line Applications
This chapter introduces the Multimedia Services for DIGITAL UNIX command line applications. The chapter also describes the functionality of each application.
Topics include:
- The audiodevices Application
- The audioplay Application
- The audiorecord Application
- The audioselectports Application
- The jpegconvert Application
This section introduces the audiodevices application. Topics include:
- What is audiodevices?
- Command Line Syntax for audiodevices
The audiodevices application gets audio device capabilities. The application prints out the available audio devices for the Multimedia Services product, the associated device numbers, and the device capabilities for both input and output.
The audiodevices application provides the following information regarding the audio devices you use with the Multimedia Services product:
Product ID Description of the audio device. Product Name Name given to the audio device in Multimedia Services. Manufacturer ID Identifies the manufacturer of the audio device. Driver Version Version number of the Multimedia Services device driver for the audio device. Channels Channel mode (mono or stereo). Device Supports Additional features such as volume control and left/right volume. Supported Formats Audio formats supported by the device. They include the sample rate, sample size, and format as well as mono and stereo. Format Support Flags are single letter codes that may appear within asterisks at the end of a supported format line. These codes provide additional information about the support for the listed format. The Format Support Flag codes and meanings are:
N = Rate not native to device.
M = Stereo channels mixed to mono output.
A = CPU assistance provides software rate conversion.
U = Format currently unavailable due to another rate in use.
Command Line Syntax for audiodevices
The command line syntax for audiodevices is:
audiodevices [-device #] [-verbose] [-help]
where:
[-device #]
Is the device number starting with device 0. The default is display all.
To display only the input ports of a specific device, use [-device_i #].
To display only the output ports of a specific device, use [-device_o #].[-verbose]
Prints various status messages.
[-help]
Displays help information.
This section introduces the audioplay application. Topics include:
- What is audioplay?
- Command Line Syntax for audioplay
The audioplay application plays an audio file. The file may be in WAVE format or SUN (.au) format. This includes files recorded using the audiorecord and DECsound applications. If the file is not in one of these formats, it will be played as a raw audio file.
The format options that are in the file header will be used to play the file. The user can override any of these using the command line options. If the file is a raw audio file, then the default values will be used.
Pressing Ctrl/C pauses the playback, which can be resumed by pressing Return. Pressing a second Ctrl/C terminates the application; otherwise, the entire file is played.
To determine the device number and formats supported for an audio output device, use the audiodevices application.
Command Line Syntax for audioplay
The command line syntax for audioplay is:
audioplay [-filename filename] [-device #] [-channels #] [-bitspersample #]
[-rate #] [-encoding format] [-numbuffers #] [-sizebuffers #]
[-msbuffers #] [-verbose] [-help]
where:
[-filename filename]
Is the audio file name to play. If the file name is "-", input will be taken from stdin (the standard input device). The default is tempfile.wav.
[-device #]
Is the output device number. Default is the first available device.
[-channels #]
Is the number of channels. The channel may be mono (1) or stereo (2). For raw audio files the default is mono (1).
[-bitspersample #]
Is the number of bits per sample. For raw audio files the default is 8.
[-rate #]
Is the sample rate in Hz. For raw audio files the default is 8000.
[-encoding format]
Is an audio encoding format. Valid entries are pcm for PCM format, mulaw for mulaw format, or adpcm for ADPCM format. For raw audio files, the default is mulaw.
[-numbuffers #]
Is the number of buffers to allocate. The default is 4.
[-sizebuffers #]
Is the size, in bytes, of each buffer.
If values are entered for [-sizebuffers #] and [-msbuffers #], the [-msbuffers #] value is used and the [-sizebuffers #] value is ignored. By default, the byte size of each buffer is dependent upon the value for [-msbuffers #].
[-msbuffers #]
Is the size, in milliseconds, of each buffer. Unless [sizebuffers #] overrides this value, the default value is 250 milliseconds.
[-verbose]
Prints various status messages while playing the file.
[-help]
Displays help information.
This section introduces the audiorecord application. Topics include:
- What is audiorecord?
- Command Line Syntax for audiorecord
The audiorecord application records an audio file using the Multimedia Services product. The file is written in WAVE format. Files recorded by audiorecord may be played back using the audioplay application and DECsound.
Pressing Ctrl/C pauses the recording, which can be resumed by pressing Return. The application is terminated by pressing a second Ctrl/C.
To determine the device number and formats supported for an audio input device, use the audiodevices application.
Command Line Syntax for audiorecord
The command line syntax for audiorecord is:
audiorecord [-filename filename] [-device #] [-channels #]
[-bitspersample #] [-rate #] [-time #] [-encoding format]
[-numbuffers #] [-sizebuffers #] [-msbuffers #]
[-verbose] [-help]
where:
[-filename filename]
Is the file name to use to save audio input. This file name defaults to tempfile.wav.
[-device #]
Is the input device number. The default is the first available device.
[-channels #]
Is the number of channels. The channels may be 1 (mono) or 2 (stereo). The default is 1.
[-bitspersample #]
Is the number of bits per sample. The default is 16.
[-rate #]
Is the sample rate in Hz. The default is 11025.
[-time #]
Is the time to record, in seconds. The recording can be terminated sooner by pressing Ctrl/C.
[-encoding format]
Describes the audio encoding format. Valid entries are pcm for PCM format, mulaw for mulaw format, or adpcm for ADPCM format. The default is pcm.
[-numbuffers #]
Is the number of buffers. The default is 4.
[-sizebuffers #]
Is the size, in bytes, of each buffer.
If values are entered for [-sizebuffers #] and [-msbuffers #], the [-msbuffers #] value is used and the [-sizebuffers #] value is ignored. By default, the byte size of each buffer is dependent upon the value for [-msbuffers #].
[-msbuffers #]
Is the size, in milliseconds, of each buffer. Unless [-sizebuffers #] overrides this value, the default value is 250 milliseconds.
[-verbose]
Prints various status messages while recording.
[-help]
Displays help information.
The audioselectports Application
This section introduces the audioselectports application.
Topics include:
- What is audioselectports?
- Command Line Syntax for audioselectports
The audioselectports application selects input or output ports for audio devices, using the Multimedia Services product. The application has the same functionality as Audio Control.
The availability of the ports and how many may be selected will depend on what the particular device supports. Once set, the ports will be used for all applications using Multimedia Services, such as DECsound and audiorecord, until the ports are reset or the mmeserver process is restarted.
If no port setting is specified, audioselectports will display the available ports for the audio devices as well as which ports are currently selected.
Command Line Syntax for audioselectports
The command line syntax for audioselectports is:
audioselectports [-device #] [[-port #]. . .] [-disableport] [-verbose] [-help]
where:
[-device #]
Is the device number starting with device 0. The default is display all devices.
To display only the input ports of a specific device, use [-device_i #].
To display only the output ports of a specific device, use [-device_o #].[[-port #]. . .]
Is the port to be enabled. You may specify multiple ports using the same command line. For example, to enable ports 1 and 2 for device p, type:
audioselectports -d 0 -port 1 -port 2
If no port information is entered, the default is to display port information for a specified device, or if no device is specified, then port information is displayed for all devices.
[-disableport]
Disables all ports specified with -port.
[-verbose]
Prints various status messages.
[-help]
Displays help information.
This section introduces the jpegconvert application. Topics include:
- What is jpegconvert?
- Command Line Syntax for jpegconvert
The jpegconvert application converts an AVI file containing compressed JPEG video. The input file must contain video compressed using any version of Multimedia Services prior to V2.0.
The jpegconvert application converts the file using a newer compression algorithm that is compatible with industry standards for JPEG compression.
Prior to V2.0 the algorithm used to compress video to the JPEG format used more quantization than necessary. The jpegconvert application decompresses each video frame in the input file and recompresses it using the new algorithm.
The jpegconvert application should not be used to convert files created with Multimedia Services V2.0 or later. The results will appear washed out. The application copies all non-video data found in the input file (including all audio data) to the output file.
Command Line Syntax for jpegconvert
The command line syntax for jpegconvert is:
jpegconvert -infile infilename -outfile outfilename [-help]
where:
-infile infilename
Is the input AVI file to convert. This is required.
-outfile outfilename
Is the converted output AVI file. This is required.
[-help]
Displays help information.