DTWAIN_AcquireAudioNativeEx

Top  Previous  Next

The DTWAIN_AcquireAudioNativeEx function starts the acquisition of audio clips from a TWAIN Source using the Audio file transfer method.  The audio clip(s) are returned in a DTWAIN_ARRAY.

 

DTWAIN_BOOL  DTWAIN_AcquireAudioNativeEx (

DTWAIN SOURCE

Source,

LONG

MaxAudioClips,

DTWAIN_BOOL

bShowUI,

DTWAIN_BOOL

bCloseSource,

DTWAIN_ARRAY

Acquisitions

LPLONG

pStatus );

 

Parameters

Source

    Specifies a selected TWAIN Source.

 

MaxAudioClips

    Specifies the maximum number of audio clips to acquire

 

bShowUI

    Specifies whether the Source displays the default User Interface.

 

bCloseSource

    Unused as of DTWAIN 5.x (formerly specifies whether the Source should be automatically closed when the User Interface is closed).

 

Acquisitions

DTWAIN_ARRAY that will hold all the acquired audio data.

 

pStatus

Points to a variable that will be filled in with an error status value or NULL if no error status is desired.

 

Return Values

If the function succeeds TRUE is returned.  


If an error has occurred or no audio clips have been acquired, FALSE is returned.  Call DTWAIN_GetLastError() to get extended information.

 

Comments

The DTWAIN_AcquireAudioNativeEx is the same as DTWAIN_AcquireAudioNative, except that the audio data is copied to the application supplied DTWAIN_ARRAY Acquisitions instead of being returned as a DTWAIN_ARRAY.

 

The advantage of this function is that Acquisitions will have all the audio data that has been acquired for the entire session that the Source is acquiring audio clips.  Your application does not have to wait for DTWAIN_AcquireAudioNativeEx to return to obtain the audio information.  The DTWAIN_ARRAY Acquisitions must have been previously created with DTWAIN_CreateAcquisitionArray, and it must be destroyed when no longer used by DTWAIN_DestroyAcquisitionArray.

 

Once DTWAIN_AcquireAudioNativeEx returns successfully, the audio data can be retrieved using the Image retrieval functions such as DTWAIN_GetAcquiredImage, DTWAIN_GetAcquiredImageArray, etc. (note that the latter two functions will work with both images and audio acquisitions).


Note that if DTWAIN_AcquireAudioNativeEx returns FALSE, this could indicate that the user closed the device's user interface without acquiring any audio clips, thus is not necessarily an error.  In this case, your application should check pStatus for a value of DTWAIN_TN_ACQUIRECANCELED to confirm that the user interface was closed without acquiring any audio clips. 


To get information on the other parameters to DTWAIN_AcquireAudioNativeEx, please see DTWAIN_AcquireAudioNative.pStatus

NULL, or is the address of a variable that will be filled in with an error status value. 


TWAIN State Transitions

State 4(if Source is not opened)

State 5, 6, 7

State 4 (if Source is closed after acquisitions)

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN Source Selection Function