# MIC_DoSamplingAsync

## C Specification

      #include <nitro/spi.h>

      MICResult MIC_DoSamplingAsync(
                  MICSamplingType     type,
                  void*               buf,
                  MICCallback         callback,
                  void*               arg );

## Description

Samples the microphone once asynchronously

This function issues a request to ARM7 to execute sampling and returns to the invoking program without waiting for a response from the ARM7 processor.

You must get the ARM7 process result by using the `result` argument that is passed to the user callback function.

If the input volume exceeds the minimum or maximum value, output data will be clamped. It is possible to adjust the input volume that can be sampled before hand using the `PM_SetAmpGain` function.

If this function fails, asynchronous operation is not performed and the callback function will not be called.

## Caution

This function asynchronously writes values to the buffer specified by the `buf` argument. Do not attempt use the returned values until you have confirmed the completion of asynchronous processes by the user callback function.

## Arguments

`type` | The sampling class of the MICSamplingType enumerator type
`buf` | Pointer to the buffer where the sampling result is stored
`callback` | Pointer to the callback function
`arg` | Argument passed to the callback function

## Return Values

Returns 0 if request succeeds.
Returns a non-zero value if request fails.

## See Also

`MIC_DoSampling`

## Revision History

08/10/2004 Added the description to the input volume
06/01/2004 Initial version