Recorder control functions


Detailed Description

These functions support file recording.

Formats supported for recording in this version:

asxFILE_FORMAT

_WAV

_RAW

Filename Extension

.WAV

any

_PCM8 or _PCM16

supported

write only

_PCM24 or _PCM32

supported

write only

_PCM32_FLOAT

supported

write only

_MPEG_L2

supported

supported

_MPEG_L3

supported

supported

_MPEG_AACPLUS

not supported yet

not supported yet

_DOLBY_AC2

not supported yet

not supported yet

Note: A file recorded using _MPEG_L2 or _MPEG_L3 data format and the _RAW file format will comply with the standard for .MP3 files since the additional header information (i.e. ID3 header) is optional.

Recorder State Diagram

ASX Player State Diagram.


Functions

ASX32_API ASX_ERROR ASX_Recorder_Open (ASX_HANDLE hRecorder, const char *pszFile, const enum asxFILE_FORMAT nFileType, const enum asxFILE_MODE nFileMode, const int nChannels, const enum asxAUDIO_FORMAT nFormat, const long lSampleRate, const long lBitrate, const enum asxRECORD_MODE nMode)
 Opens the recorder using the specified format.
ASX32_API ASX_ERROR ASX_Recorder_Start (ASX_HANDLE hRecorder)
 Starts the recording.
ASX32_API ASX_ERROR ASX_Recorder_Stop (ASX_HANDLE hRecorder)
 Stops the recording.
ASX32_API ASX_ERROR ASX_Recorder_Pause (ASX_HANDLE hRecorder)
 Pauses the recording.
ASX32_API ASX_ERROR ASX_Recorder_Close (ASX_HANDLE hRecorder)
 Closes the recording file.
ASX32_API ASX_ERROR ASX_Recorder_GetPosition (ASX_HANDLE hRecorder, const enum asxTIMESCALE nType, unsigned long *plPosition)
 Gets the current record position.
ASX32_API ASX_ERROR ASX_Recorder_GetState (ASX_HANDLE hRecorder, enum asxRECORDER_STATE *peState)
 Get the current record state.
ASX32_API ASX_ERROR ASX_Recorder_GetFilename (ASX_HANDLE hRecorder, char *pszFilename, const int nStringLength, int *pnRequiredLength)
 Get the current filename, if any.
ASX32_API ASX_ERROR ASX_Recorder_EnumerateFormat (ASX_HANDLE hRecorder, const int nIndex, enum asxAUDIO_FORMAT *peFormat, int *pnCount)
 Enumerates supported recorder formats.


Function Documentation

ASX32_API ASX_ERROR ASX_Recorder_Close ASX_HANDLE  hRecorder  ) 
 

Closes the recording file.

Parameters:
hRecorder A handle to an ASX recorder object.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
dual_mono_record/main.c, and record/main.c.

ASX32_API ASX_ERROR ASX_Recorder_EnumerateFormat ASX_HANDLE  hRecorder,
const int  nIndex,
enum asxAUDIO_FORMAT peFormat,
int *  pnCount
 

Enumerates supported recorder formats.

Parameters:
hRecorder A handle to an ASX recorder object.
nIndex The format number.
peFormat Returned enumerated format (See asxFORMAT).
pnCount Returned total numebr of formats.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_Recorder_GetFilename ASX_HANDLE  hRecorder,
char *  pszFilename,
const int  nStringLength,
int *  pnRequiredLength
 

Get the current filename, if any.

Parameters:
hRecorder A handle to an ASX recorder object.
pszFilename The returned pointer to the filename.
nStringLength The length in bytes of pszFilename.
pnRequiredLength The required length in bytes of pszRevision.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned. Returns asxERROR_INDEX_OUT_OF_RANGE if the buffer is too small.

ASX32_API ASX_ERROR ASX_Recorder_GetPosition ASX_HANDLE  hRecorder,
const enum asxTIMESCALE  nType,
unsigned long *  plPosition
 

Gets the current record position.

Parameters:
hRecorder A handle to an ASX recorder object.
nType The units to return the position in (see asxTIMESCALE).
plPosition The current record position.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_Recorder_GetState ASX_HANDLE  hRecorder,
enum asxRECORDER_STATE peState
 

Get the current record state.

Parameters:
hRecorder A handle to an ASX recorder object.
peState The current recorder state. See asxRECORDER_STATE.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.

ASX32_API ASX_ERROR ASX_Recorder_Open ASX_HANDLE  hRecorder,
const char *  pszFile,
const enum asxFILE_FORMAT  nFileType,
const enum asxFILE_MODE  nFileMode,
const int  nChannels,
const enum asxAUDIO_FORMAT  nFormat,
const long  lSampleRate,
const long  lBitrate,
const enum asxRECORD_MODE  nMode
 

Opens the recorder using the specified format.

Parameters:
hRecorder A handle to an ASX recorder object.
pszFile The name of the file to be opened.
nFileType File format. This specifies the header information (if any) to be placed on the audio file. See asxFILE_FORMAT for the complete range of formats.
nFileMode Sets the mode for opening an existing file for recording. See asxFILE_MODE
nChannels The number of channels. Currently either 1 or 2 channels are supported.
nFormat Audio format is used to specified the format of the recorded samples. See asxAUDIO_FORMAT for a complete list of formats. Note that not all formats are supported on all adapters, so it is important to check for errors after making this call.
lSampleRate The sample rate should be set to 8000-192000 Hz. Note that some adapters do not support all sample rates, so it is important to check for errors after making this call.
lBitrate Bitrate = 8000 to 384000 bps (MPEG only)
nMode Recording mode applies to MPEG only. See asxRECORD_MODE.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
dual_mono_record/main.c, and record/main.c.

ASX32_API ASX_ERROR ASX_Recorder_Pause ASX_HANDLE  hRecorder  ) 
 

Pauses the recording.

Use ASX_Recorder_Start to continue recording.

Parameters:
hRecorder A handle to an ASX recorder object.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
record/main.c.

ASX32_API ASX_ERROR ASX_Recorder_Start ASX_HANDLE  hRecorder  ) 
 

Starts the recording.

Parameters:
hRecorder A handle to an ASX recorder object.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
dual_mono_record/main.c, and record/main.c.

ASX32_API ASX_ERROR ASX_Recorder_Stop ASX_HANDLE  hRecorder  ) 
 

Stops the recording.

Parameters:
hRecorder A handle to an ASX recorder object.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
dual_mono_record/main.c, and record/main.c.


Generated on Tue Nov 18 13:03:41 2008 for ASX by  doxygen 1.4.6-NO