ASX Version4.20.14
Functions

Recorder control functions

These functions support file recording. More...

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.

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.

Function Documentation

ASX32_API ASX_ERROR ASX_Recorder_Close ( ASX_HANDLE  hRecorder)

Closes the recording file.

Parameters:
hRecorderA 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:
hRecorderA handle to an ASX recorder object.
nIndexThe format number.
peFormatReturned enumerated format (See asxFORMAT).
pnCountReturned 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:
hRecorderA handle to an ASX recorder object.
pszFilenameThe returned pointer to the filename.
nStringLengthThe length in bytes of pszFilename.
pnRequiredLengthThe 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:
hRecorderA handle to an ASX recorder object.
nTypeThe units to return the position in (see asxTIMESCALE).
plPositionThe 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:
hRecorderA handle to an ASX recorder object.
peStateThe 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:
hRecorderA handle to an ASX recorder object.
pszFileThe name of the file to be opened.
nFileTypeFile format. This specifies the header information (if any) to be placed on the audio file. See asxFILE_FORMAT for the complete range of formats.
nFileModeSets the mode for opening an existing file for recording. See asxFILE_MODE
nChannelsThe number of channels. Currently either 1 or 2 channels are supported.
nFormatAudio 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.
lSampleRateThe 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.
lBitrateBitrate = 8000 to 384000 bps (MPEG only)
nModeRecording 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:
hRecorderA 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:
hRecorderA 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:
hRecorderA 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.