ioap_hf_prepare()

Prepare the system for acoustic processing.

Synopsis:

#include <acoustic/hf.h>

int ioap_hf_prepare(int apd) ;

Arguments:

apd
The handle to io-acoustic.

Library:

libacoustic

Description:

The ioap_hf_prepare() function prepares the system for acoustic processing. You must call this function before you call io_hf_go() to start acoustic processing, including acoustic echo cancellation. It can only be called when acoustic processing is stopped.

This function:

  1. Validates the acoustic processing routing against the current configuration specified by ioap_hf_route() and ensures that there are no inconsistencies.
  2. Allocates the memory needed for audio transfer.
  3. Opens the audio devices in START_ON_GO mode. Audio transfer isn't started until ioap_hf_go() is called.

When ioap_hf_prepare() finishes preparing the system, it delivers the acoustic processing event IOAP_HF_EVENT_PREPARED.

Returns:

0
Success
-1
An error occurred (errno is set).

Errors:

EACCES
Acoustic processing is not stopped.
EINVAL
Invalid handle or null pointer argument.
EIO
Setup error with input or output.
ENODEV
No memory available for data structures.
ENOMEM
No memory available for data structures.

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes