Developer World
Spresense SDK Library v3.2.0-ebc0364
audio_effector_api.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/audio/audio_effector_api.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
36#ifndef __SONY_APPS_INCLUDE_AUDIOUTIL_AUDIO_EFFECTOR_API_H
37#define __SONY_APPS_INCLUDE_AUDIOUTIL_AUDIO_EFFECTOR_API_H
38
44/* API Documents creater with Doxgen */
45
55/****************************************************************************
56 * Included Files
57 ****************************************************************************/
58
59#include <stdint.h>
60#include <stdbool.h>
61
62/****************************************************************************
63 * Pre-processor Definitions
64 ****************************************************************************/
65
66#define AS_FEATURE_EFFECTOR_ENABLE
67
73#define SUB_SETMPP_COMMON 0x00
74
77#define SUB_SETMPP_XLOUD 0x01
78
86#define LENGTH_STARTBB 3
87
90#define LENGTH_STOPBB 3
91
96#define CHECK_XLOUD_VOLUME_RANGE(vol) \
97 (bool)(((0 <= (vol)) && ((vol) <= 59)) ? true : false)
98
99/****************************************************************************
100 * Public Types
101 ****************************************************************************/
102
103/* enum for baseband */
104
105/* StartBB */
106
109typedef enum
110{
116
122
127
130typedef enum
131{
137
143
147
154
157typedef enum
158{
162 AS_SP_OUTPUT_DATA_NUM
164
167typedef enum
168{
172
176 AS_I2S_OUTPUT_DATA_NUM
178
183typedef enum
184{
188
193
194/* InitMFE */
195
198typedef enum
199{
203
207 AS_MFE_MODE_NUM
209
212typedef enum
213{
217
221 AS_MFE_INC_ECHOCANCEL_NUM
223
226typedef enum
227{
231
237 AS_MFE_ENBL_ECHOCANCEL_NUM
239
240/* InitMPP */
241
244typedef enum
245{
249 AS_MPP_MODE_NUM
251
254typedef enum
255{
259
263 AS_MPP_COEF_NUM
265
268typedef enum
269{
273
277
281 AS_MPP_XLOUD_MODE_NUM
283
286 typedef enum
287{
291
295 AS_MPP_EAX_NUM
297
298/* SetBaseBandStatus */
299
302typedef enum
303{
307
311 AS_SET_BBSTS_WITH_MFE_NUM
313
316typedef enum
317{
321
325 AS_SET_BBSTS_WITH_VCMD_NUM
327
330typedef enum
331{
335
341 AS_SET_BBSTS_WITH_MPP_NUM
343
346typedef struct
347{
353 uint16_t input_fs;
354
361
368
375
382
385 uint8_t reserved2;
386
392 uint8_t mfe_mode;
393
396 uint32_t config_table;
398
401typedef struct
402{
409
412 uint8_t reserved1;
413
419 uint16_t input_device;
420
428
431 uint8_t reserved2;
432
439
447
450typedef struct
451{
454 uint8_t stop_device;
455
458 uint8_t reserved1;
459
462 uint16_t reserved2;
463
466 uint8_t reserved3;
467
470 uint8_t reserved4;
471
474 uint8_t reserved5;
475
478 uint8_t reserved6;
480
483typedef struct
484{
487 uint8_t reserved1;
488
494 uint8_t with_MPP;
495
502
508 uint8_t with_MFE;
509
515 uint16_t input_device;
516
519 uint8_t reserved2;
520
527
530 char dsp_path[AS_AUDIO_DSP_PATH_LEN];
531
533
536typedef struct
537{
540 uint8_t effector;
541
544 uint8_t mng;
545
548 uint8_t recognizer;
549
552 uint8_t dsp;
554
557typedef struct
558{
561 uint8_t mic_in;
562
565 uint8_t i2s_in;
566
569 uint8_t sphp_out;
570
573 uint8_t i2s_out;
574
577 uint8_t mfe_out;
579
582typedef struct
583{
587
592
593/****************************************************************************
594 * Public Data
595 ****************************************************************************/
596
597/****************************************************************************
598 * Inline Functions
599 ****************************************************************************/
600
601/****************************************************************************
602 * Public Function Prototypes
603 ****************************************************************************/
604
615 AudioAttentionCb attcb);
616
617__attribute__((deprecated(
618 "\n \
619 \n Deprecated create API is used. \
620 \n Use \"AS_CreateEffector(AsCreateEffectorParam_t * \
621 \n AudioAttentionCb)\". \
622 \n \
623 \n")))
625
633
634#endif /* __SONY_APPS_INCLUDE_AUDIOUTIL_AUDIO_EFFECTOR_API_H */
AsSpOutputData
Definition: audio_effector_api.h:158
AsMppModeId
Definition: audio_effector_api.h:245
AsMfeEnableEchoCancel
Definition: audio_effector_api.h:227
AsInputDevice
Definition: audio_effector_api.h:131
AsI2sOutputData
Definition: audio_effector_api.h:168
AsSetBBStsWithMfe
Definition: audio_effector_api.h:303
AsSelectOutputMic
Definition: audio_effector_api.h:184
AsMppEaxModeId
Definition: audio_effector_api.h:287
AsOutputDevice
Definition: audio_effector_api.h:110
AsMppXloudModeId
Definition: audio_effector_api.h:269
AsSetBBStsWithVoiceCommand
Definition: audio_effector_api.h:317
AsMfeModeId
Definition: audio_effector_api.h:199
AsMppCoefModeId
Definition: audio_effector_api.h:255
bool AS_DeleteEffector(void)
Deactivate sound effector feature.
AsSetBBStsWithMpp
Definition: audio_effector_api.h:331
AsMfeIncludeEchoCancel
Definition: audio_effector_api.h:213
bool AS_CreateEffector(FAR AsCreateEffectorParam_t *param, AudioAttentionCb attcb)
Activate sound effector feature.
@ AS_MPP_OUTPUT_I2SIN
MPP output (I2S in)
Definition: audio_effector_api.h:161
@ AS_MPP_MODE_XLOUD_ONLY
xLOUD only
Definition: audio_effector_api.h:248
@ AS_ENABLE_ECHOCANCEL
EchoCancel ON.
Definition: audio_effector_api.h:236
@ AS_DISABLE_ECHOCANCEL
EchoCancel OFF.
Definition: audio_effector_api.h:230
@ AS_INPUT_DEVICE_AMIC4CH_I2S2CH
Analog Mic 4ch, I2S 2ch.
Definition: audio_effector_api.h:152
@ AS_INPUT_DEVICE_I2S2CH
I2S 2ch.
Definition: audio_effector_api.h:136
@ AS_INPUT_DEVICE_AMIC1CH
Analog Mic 1ch.
Definition: audio_effector_api.h:142
@ AS_INPUT_DEVICE_AMIC1CH_I2S2CH
Analog Mic 1ch, I2S 2ch.
Definition: audio_effector_api.h:146
@ AS_MFE_OUTPUT_MICSIN
MFE output (MIC in)
Definition: audio_effector_api.h:171
@ AS_MIC_THROUGH
MIC through.
Definition: audio_effector_api.h:175
@ AS_SET_BBSTS_WITH_MFE_NONE
no MFE function
Definition: audio_effector_api.h:306
@ AS_SET_BBSTS_WITH_MFE_ACTIVE
MFE active.
Definition: audio_effector_api.h:310
@ AS_SELECT_MIC1_OR_MIC2
MIC1 and MIC2.
Definition: audio_effector_api.h:187
@ AS_SELECT_MIC0_OR_MIC3
MIC0 and MIC3.
Definition: audio_effector_api.h:191
@ AS_MPP_EAX_ENABLE
On.
Definition: audio_effector_api.h:294
@ AS_MPP_EAX_DISABLE
Off.
Definition: audio_effector_api.h:290
@ AS_OUTPUT_DEVICE_I2S2CH
I2S 2ch.
Definition: audio_effector_api.h:115
@ AS_OUTPUT_DEVICE_SP2CH_I2S2CH
I2S 2ch, SP/HP 2ch.
Definition: audio_effector_api.h:125
@ AS_OUTPUT_DEVICE_SP2CH
SP/HP 2ch.
Definition: audio_effector_api.h:121
@ AS_MPP_XLOUD_MODE_NORMAL
Normal mode.
Definition: audio_effector_api.h:272
@ AS_MPP_XLOUD_MODE_DISABLE
Disable.
Definition: audio_effector_api.h:280
@ AS_MPP_XLOUD_MODE_SPEAKING
Speaking mode.
Definition: audio_effector_api.h:276
@ AS_SET_BBSTS_WITH_VCMD_NONE
no Voice Command function
Definition: audio_effector_api.h:320
@ AS_SET_BBSTS_WITH_VCMD_ACTIVE
Voice Command active.
Definition: audio_effector_api.h:324
@ AS_MFE_MODE_RECOGNITION
Voice Recognition mode (default)
Definition: audio_effector_api.h:202
@ AS_MFE_MODE_SPEAKING
Voice Speaking mode.
Definition: audio_effector_api.h:206
@ AS_MPP_COEF_HEADPHONE
for Headphone
Definition: audio_effector_api.h:262
@ AS_MPP_COEF_SPEAKER
for Speaker
Definition: audio_effector_api.h:258
@ AS_SET_BBSTS_WITH_MPP_ACTIVE
MPP active.
Definition: audio_effector_api.h:340
@ AS_SET_BBSTS_WITH_MPP_NONE
no MPP function
Definition: audio_effector_api.h:334
@ AS_INCLUDE_ECHOCANCEL
Incluce echochancel function.
Definition: audio_effector_api.h:220
@ AS_NOINCLUDE_ECHOCANCEL
Not include echochancel function.
Definition: audio_effector_api.h:216
__attribute__((deprecated("\nDeprecated attention callback type is used. \ \nPlease use \"AudioAttentionCb\" as callback type. \ \n"))) int AS_CreateAudioManager(AudioSubSystemIDs ids
Activate AudioSubSystem[Deprecated] This API is to make it compatible with old application....
void(* AudioAttentionCb)(const ErrorAttentionParam *attparam)
Definition: audio_common_defs.h:810
#define AS_AUDIO_DSP_PATH_LEN
Definition: audio_common_defs.h:693
Definition: audio_effector_api.h:583
AsEffectorPoolId_t pool_id
[in] ID of memory pool for processing data
Definition: audio_effector_api.h:590
AsEffectorMsgQueId_t msgq_id
[in] ID for sending messages to each function
Definition: audio_effector_api.h:586
Definition: audio_effector_api.h:537
uint8_t mng
[in] Message queue id of audio_manager
Definition: audio_effector_api.h:544
uint8_t dsp
[in] Message queue id of DSP
Definition: audio_effector_api.h:552
uint8_t effector
[in] Message queue id of sound effector
Definition: audio_effector_api.h:540
uint8_t recognizer
[in] Message queue id of voice recognizer
Definition: audio_effector_api.h:548
Definition: audio_effector_api.h:558
uint8_t i2s_out
[in] Memory pool id of i2s output data
Definition: audio_effector_api.h:573
uint8_t mfe_out
[in] Memory pool id of mfe output data
Definition: audio_effector_api.h:577
uint8_t sphp_out
[in] Memory pool id of speaker/headphone output data
Definition: audio_effector_api.h:569
uint8_t mic_in
[in] Memory pool id of mic input data
Definition: audio_effector_api.h:561
uint8_t i2s_in
[in] Memory pool id of i2s input data
Definition: audio_effector_api.h:565
Definition: audio_effector_api.h:347
uint8_t ref_channel_num
[in] Select MFE SP numbers
Definition: audio_effector_api.h:360
uint8_t mfe_mode
[in] Select MFE mode
Definition: audio_effector_api.h:392
uint8_t mic_channel_num
[in] Select MFE MIC numbers
Definition: audio_effector_api.h:367
uint8_t reserved2
[in] reserved
Definition: audio_effector_api.h:385
uint16_t input_fs
[in] Select MFE sampling frequency
Definition: audio_effector_api.h:353
uint8_t include_echocancel
[in] Select EchoCancel configuration,
Definition: audio_effector_api.h:381
uint8_t enable_echocancel
[in] Select EchoCancel function,
Definition: audio_effector_api.h:374
uint32_t config_table
[in] Configuration table address
Definition: audio_effector_api.h:396
Definition: audio_effector_api.h:484
uint8_t reserved1
[in] reserved
Definition: audio_effector_api.h:487
uint8_t output_device
[in] Select Output Device
Definition: audio_effector_api.h:526
uint16_t input_device
[in] Select Input Device
Definition: audio_effector_api.h:515
uint8_t reserved2
[in] reserved
Definition: audio_effector_api.h:519
uint8_t with_Voice_Command
[in] Select Voice Command function
Definition: audio_effector_api.h:501
uint8_t with_MFE
[in] Select MFE function
Definition: audio_effector_api.h:508
uint8_t with_MPP
[in] Select MPP function
Definition: audio_effector_api.h:494
Definition: audio_effector_api.h:402
uint8_t select_output_mic
[in] Select output MIC channels
Definition: audio_effector_api.h:427
uint8_t reserved1
[in] reserved
Definition: audio_effector_api.h:412
uint8_t output_device
[in] Select Output Device
Definition: audio_effector_api.h:408
uint16_t input_device
[in] Select Input Device
Definition: audio_effector_api.h:419
uint8_t SP_output_data
[in] Select SP/HP output data
Definition: audio_effector_api.h:445
uint8_t reserved2
[in] reserved
Definition: audio_effector_api.h:431
uint8_t I2S_output_data
[in] Select I2S output data
Definition: audio_effector_api.h:438
Definition: audio_effector_api.h:451
uint8_t reserved6
[in] reserved
Definition: audio_effector_api.h:478
uint16_t reserved2
[in] reserved
Definition: audio_effector_api.h:462
uint8_t reserved1
[in] reserved
Definition: audio_effector_api.h:458
uint8_t reserved5
[in] reserved
Definition: audio_effector_api.h:474
uint8_t reserved4
[in] reserved
Definition: audio_effector_api.h:470
uint8_t stop_device
[in] T.B.D.
Definition: audio_effector_api.h:454
uint8_t reserved3
[in] reserved
Definition: audio_effector_api.h:466