Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wiced_audio_manager.h File Reference

Copyright 2016-2024, Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation. More...

Data Structures

struct  codec_config_t
 Codec configuration. More...
 
struct  audio_config_t
 Audio configuration. More...
 
struct  nrec_config_t
 NREC configuration. More...
 
struct  stream_interface_t
 Stream Interface Functions. More...
 
struct  capture_stream_interface_t
 Capture stream interface. More...
 
struct  render_stream_interface_t
 Render stream interface. More...
 

Macros

#define DEFAULT_VOLUME   80
 
#define DEFAULT_BITSPSAM   16
 
#define DEFAULT_PLAYBACK_SR   44100
 
#define DEFAULT_RECORD_SR   8000
 
#define DEFAULT_CH   2
 
#define AM_VOL_LEVEL_HIGH   10
 
#define AM_VOL_LEVEL_LOW   0
 
#define AM_PLAYBACK_SR_8K   8000
 
#define AM_PLAYBACK_SR_11K   11025
 
#define AM_PLAYBACK_SR_12K   12000
 
#define AM_PLAYBACK_SR_16K   16000
 
#define AM_PLAYBACK_SR_22K   22050
 
#define AM_PLAYBACK_SR_32K   32000
 
#define AM_PLAYBACK_SR_44K   44100
 
#define AM_PLAYBACK_SR_48K   48000
 
#define AM_PLAYBACK_SR_64K   64000
 
#define AM_PLAYBACK_SR_88K   88200
 
#define AM_PLAYBACK_SR_96K   96000
 
#define WICED_AUDIO_MANAGER_STREAM_ID_INVALID   -1
 

Enumerations

enum  stream_type_t {
  CAPTURE, RENDER, FILE_PLAYBACK, A2DP_PLAYBACK,
  HFP, MAX_NO_OF_STREAMS, STREAM_TYPE_INVALD = MAX_NO_OF_STREAMS
}
 Audio Streams. More...
 
enum  param_type_t {
  AM_CODEC_CONFIG, AM_AUDIO_CONFIG, AM_SAMPLE_RATE, AM_CHANNELS,
  AM_BITS_PER_SAMPLE, AM_MIC_GAIN_LEVEL, AM_SPEAKER_VOL_LEVEL, AM_NREC_ENABLE,
  AM_NREC_DISABLE, AM_GAIN_CONFIG, AM_NREC_CONFIG, AM_IO_DEVICE
}
 Audio Parameter types. More...
 
enum  am_audio_io_device_t { AM_SPEAKERS, AM_HEADPHONES, AM_UART }
 audio output type
 

Functions

void wiced_am_init (void)
 The application should call this function to Initialize the Audio Manager. More...
 
int32_t wiced_am_stream_open (uint32_t stream_type)
 The application should call this function to open the stream This will construct the graph of various components in the chain based on the stream type. More...
 
wiced_result_t wiced_am_stream_start (int32_t stream_id)
 The application should call this function to start the stream. More...
 
wiced_result_t wiced_am_stream_stop (int32_t stream_id)
 The application should call this function to stop the stream. More...
 
wiced_result_t wiced_am_stream_close (int32_t stream_id)
 The application should call this function to close the stream. More...
 
wiced_result_t wiced_am_stream_set_param (int32_t stream_id, uint32_t param_type, void *param_config)
 The application should call this function to set the parameters of the stream. More...
 
int32_t wiced_am_stream_get_param (uint32_t stream_id, uint32_t param_type, void *param_config)
 The application should call this function to get parameters of the stream. More...
 
stream_interface_twiced_am_stream_get_intf (uint32_t stream_id, uint32_t inf_type)
 The application should call this function to get interface of the stream. More...
 

Detailed Description

Copyright 2016-2024, Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation.

All rights reserved.

This software, including source code, documentation and related materials ("Software") is owned by Cypress Semiconductor Corporation or one of its affiliates ("Cypress") and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Therefore, you may use this Software only as provided in the license agreement accompanying the software package from which you obtained this Software ("EULA"). If no EULA applies, Cypress hereby grants you a personal, non-exclusive, non-transferable license to copy, modify, and compile the Software source code solely for use in connection with Cypress's integrated circuit products. Any reproduction, modification, translation, compilation, or representation of this Software except as specified above is prohibited without the express written permission of Cypress.

Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes to the Software without notice. Cypress does not assume any liability arising out of the application or use of the Software or any product or circuit described in the Software. Cypress does not authorize its products for use in any products where a malfunction or failure of the Cypress product may reasonably be expected to result in significant property damage, injury or death ("High Risk Product"). By including Cypress's product in a High Risk Product, the manufacturer of such system or application assumes all risk of such use and in doing so agrees to indemnify Cypress against all liability.

Audio manager is a high level interface for applications to use platform audio capabilities. It supports different streams like A2DP_PLAYBACK, HFP etc. Audio manager also has interface for specific stream Start, Stop and also stream specific volume control.

Enumeration Type Documentation

Audio Parameter types.

Enumerator
AM_CODEC_CONFIG 

Codec Configuration.

AM_AUDIO_CONFIG 

Audio Configuration.

AM_SAMPLE_RATE 

Sample rate.

AM_CHANNELS 

No of channels.

AM_BITS_PER_SAMPLE 

No of bits per sample.

AM_MIC_GAIN_LEVEL 

Mic gain level.

AM_SPEAKER_VOL_LEVEL 

volume level

AM_NREC_ENABLE 

NREC enable.

AM_NREC_DISABLE 

NREC disable.

AM_GAIN_CONFIG 

Gain Configuration.

AM_NREC_CONFIG 

NREC Configuration.

AM_IO_DEVICE 

Input/Output device.

Audio Streams.

Enumerator
CAPTURE 

Audio Capture stream.

RENDER 

Audio Render stream.

FILE_PLAYBACK 

File Play back Stream.

A2DP_PLAYBACK 

A2DP Play back Stream.

HFP 

Hands free profile stream.

MAX_NO_OF_STREAMS 

Used to accumulate total stream types.

Function Documentation

void wiced_am_init ( void  )

The application should call this function to Initialize the Audio Manager.

Parameters
NOparameters required.
Returns
none
wiced_result_t wiced_am_stream_close ( int32_t  stream_id)

The application should call this function to close the stream.

Parameters
stream_id: Id of the stream.
Returns
WICED_NOT_FOUND WICED_SUCCESS
stream_interface_t* wiced_am_stream_get_intf ( uint32_t  stream_id,
uint32_t  inf_type 
)

The application should call this function to get interface of the stream.

Parameters
stream_id: Id of the stream.
inf_type: Interface type.
Returns
result
int32_t wiced_am_stream_get_param ( uint32_t  stream_id,
uint32_t  param_type,
void *  param_config 
)

The application should call this function to get parameters of the stream.

Parameters
stream_id: Id of the stream.
param_type: Type of the parameters to be set.
param_configParameter configurations
Returns
result
int32_t wiced_am_stream_open ( uint32_t  stream_type)

The application should call this function to open the stream This will construct the graph of various components in the chain based on the stream type.

Parameters
stream_type: Type of the stream to register (stream_type_t)
args: Arguments to be passed if any.
Returns
stream id invalid if WICED_AUDIO_MANAGER_STREAM_ID_INVALID
wiced_result_t wiced_am_stream_set_param ( int32_t  stream_id,
uint32_t  param_type,
void *  param_config 
)

The application should call this function to set the parameters of the stream.

Parameters
stream_id: Id of the stream.
param_type: Type of the parameters to be set.
param_configParameter configurations
Returns
WICED_NOT_FOUND WICED_ERROR WICED_SUCCESS
wiced_result_t wiced_am_stream_start ( int32_t  stream_id)

The application should call this function to start the stream.

Parameters
stream_id: Id of the stream.
Returns
WICED_NOT_FOUND WICED_SUCCESS
wiced_result_t wiced_am_stream_stop ( int32_t  stream_id)

The application should call this function to stop the stream.

Parameters
stream_id: Id of the stream.
Returns
WICED_NOT_FOUND WICED_SUCCESS