AuRecordWidget(3X) — Series 700 Only
NAME
AuRecordWidget − audio record widget
SYNOPSIS
#include <audio/Record.h>
DESCRIPTION
The audio record widget is a member of the new Audio subclass of the X Core widget class.
If the record operation is file-based, the AuNdataAvailable event is returned when all of the data has been saved in the file. To use this information, add a callback routine for AuNdataAvailable using AtAddCallback().
If you use the streams facility, the toolkit creates a file descriptor in connectFd during AuInvokeRecord(). After calling AuInvokeRecord(), retrieve the file descriptor by calling
XtSetArg(args[0], AuNconnectFd, &stream_fd);
then call
XtGetValue(recordWidget,args,1);.
The select(), read(), and write() system calls can then be used in the usual manner.
After calling AStopAudio() to stop the transaction, the application program must retrieve all the data in the buffer and close() the file descriptor. A callback routine for AuNStopped can include all of these operations.
Note that for a record streams operation to work, a callback routine for AuNdataAvailable must be added using AtAddCallback().
To enable an application to use a widget after it is created, bind the widget library with the application as follows:
ld my_file.o... -lAt -lAlib
RESOURCES
gain Volume, in percent of total gain. Acceptable values are from 0 to 100. Default is system-dependent.
fileFormat Audio file format. Acceptable values are:
AuFMulaw AuFLinear16 AuFLinear8 AuFLinear8Offset
AuFAlaw AuFSun AuFRiff AuFUnknown
Default is AuFUnknown.
dataFormat Audio data format. Acceptable values are:
AuDMulaw AuDLinear16 AuDLinear8Offset
AuDAlaw AuDLinear8 AuDUnknown
Default is AuDUnknown.
durationType Duration units. Acceptable values are:
AuSamples AuMilliseconds AuFullLength
Default is AuFullLength.
duration Number of units to record. Acceptable values are -1 to MAX_INT. Default is ~0 (-1, record until notified).
fileName Name of the file to receive the data (must be set prior to invocation of the record widget). There is no default value.
startTimeType Type of start time unit. Acceptable values are AuSamples and AuMilliseconds. Default is AuMilliseconds.
startTime Number of units into the file to begin writing (when the recorded file is saved). Acceptable values are 0 to MAX_INT. Default value is 0 (BOF).
pause Start in paused state. Acceptable values are ON or OFF. Default is OFF.
stop Stop mode. Acceptable values are:
AuStopLinkTrans AuStopEndLoopTrans
AuStopThisTrans AuStopNone
Default is AuStopNone.
audioConnection Pointer to Audio structure for this connection, returned by AOpenAUdio(). Specifying a valid pointer for this argument is mandatory. The default value is NULL, which causes the program to fail.
streamOrFile Source of audio data. Acceptable values are AuStream or AuFile. Default is AuFile.
SStream Pointer to SStream structure for this AuStream-type widget. Specifying a valid pointer for this argument is mandatory. The default value is NULL, which causes the program to fail.
connectFd File descriptor of the non-blocking connection made for the stream by the toolkit; created during AuInvokeRecord().
reserved
writeMode Mode for saving data. Acceptable values are:
AuOverWrite AuTruncAppend AuInsert
Default is AuOverWrite.
channels Number of channels. Acceptable values are 1 or 2. Default is 1.
samplingRate Number of cycles per second. Hardware-supported values are
5512 11025 22050 44100
8000 16000 32000 48000
Default is 8000.
Values between 0.995 and 1.0125 times any of the supported values are handled at the supported rate. Rates outside these tolerances are converted by sound bucket transactions to the nearest supported rate, but cause streams transactions to fail and return AEBadSamplingRate.
leftChannel Gain, in percent. Acceptable values are 1 through 100. Default is system-dependent.
rightChannel Gain, in percent. Acceptable values are 1 through 100. Default is system-dependent.
audioIn Line in or mono microphone. Acceptable values are AuMicrophone or AuLineIn. Default is AuMicrophone.
DEPENDENCIES
This widget belongs to the Audio Application Program Interface widget library. The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to the hardware manual that accompanies your system.
SEE ALSO
AtAddCallback(), AtInitialize(), AtRemoveCallback(), AuCreatePlay(), AuInvokePlay(), AuInvokeRecord(), AuPlayWidget, AuSaveFile().
Using the Audio Application Program Interface.
Hewlett-Packard Company — HP-UX Release 9.03: April 1994